19 #ifndef GNASH_TEXTFIELD_H
20 #define GNASH_TEXTFIELD_H
22 #include <boost/intrusive_ptr.hpp>
36 class DefineEditTextTag;
47 ,std::char_traits<wchar_t>
48 ,std::allocator<wchar_t> >
136 virtual int getDefinitionVersion()
const;
139 void mouseEvent(
const event_id&
id);
146 return _variable_name;
155 void set_variable_name(
const std::string& newname);
163 void updateText(
const std::string&
s);
166 std::string get_text_value()
const;
169 std::string get_htmltext_value()
const;
189 void replaceSelection(
const std::string& replace);
198 void setSelection(
int start,
int end);
203 virtual void setWidth(
double width);
222 bool pointInShape(boost::int32_t
x, boost::int32_t
y)
const;
225 bool getDrawBackground()
const;
230 void setDrawBackground(
bool draw);
233 rgba getBackgroundColor()
const;
240 void setBackgroundColor(
const rgba& col);
243 bool getDrawBorder()
const;
248 void setDrawBorder(
bool draw);
251 rgba getBorderColor()
const;
258 void setBorderColor(
const rgba& col);
270 void setTextColor(
const rgba& col);
322 void setEmbedFonts(
bool use);
331 TextAlignment getTextAlignment();
338 void setAutoSize(AutoSize val);
363 static TypeValue parseTypeValue(
const std::string& val);
373 static const char* typeValueName(TypeValue val);
391 void setWordWrap(
bool on);
425 return isSelectable();
436 void removeTextField();
443 boost::intrusive_ptr<const Font> setFont(
444 boost::intrusive_ptr<const Font> newfont);
454 void setFontHeight(boost::uint16_t
h);
461 void setLeftMargin(boost::uint16_t
h);
468 void setRightMargin(boost::uint16_t
h);
475 void setIndent(boost::uint16_t
h);
482 void setBlockIndent(boost::uint16_t
h);
489 void setAlignment(TextAlignment
h);
496 void setLeading(boost::int16_t
h);
520 return _restrictDefined;
550 return _bottomScroll;
553 void setUnderlined(
bool v);
554 void setTabStops(
const std::vector<int>& tabStops);
555 void setBullet(
bool b);
556 void setURL(std::string
url);
557 void setTarget(std::string target);
558 void setRestrict(
const std::string& restrict);
559 void setDisplay(TextFormatDisplay display);
565 _maxScroll = maxScroll;
573 _maxHScroll = maxHScroll;
577 _bottomScroll = bottomScroll;
583 size_t cursorRecord();
588 return m_text_bounding_box;
595 void setTextValue(
const std::wstring& wstr);
607 void updateText(
const std::wstring&
s);
609 void updateHtmlText(
const std::wstring&
s);
617 virtual bool handleFocus();
620 virtual void killFocus();
626 void reset_bounding_box(boost::int32_t
x, boost::int32_t
y)
628 m_text_bounding_box.set_to_point(x, y);
640 void newLine(boost::int32_t& x, boost::int32_t& y,
641 SWF::TextRecord& rec,
int& last_space_glyph,
642 LineStarts::value_type& last_line_start_record,
float div);
645 void handleChar(std::wstring::const_iterator& it,
646 const std::wstring::const_iterator&
e, boost::int32_t& x,
647 boost::int32_t& y, SWF::TextRecord& rec,
int& last_code,
648 int& last_space_glyph,
649 LineStarts::value_type& last_line_start_record);
661 bool parseHTML(std::wstring& tag,
662 std::map<std::string, std::string>& attributes,
663 std::wstring::const_iterator& it,
664 const std::wstring::const_iterator&
e,
665 bool& selfclosing)
const;
671 float align_line(TextAlignment align,
int last_line_start_record,
float x);
690 void registerTextVariable();
692 typedef std::pair<as_object*, ObjectURI> VariableRef;
698 VariableRef parseTextVariableRef(
const std::string& variableName)
const;
704 void show_cursor(Renderer& renderer,
const SWFMatrix& mat);
709 boost::intrusive_ptr<const SWF::DefineEditTextTag> _tag;
721 std::wstring _htmlText;
724 SWFRect m_text_bounding_box;
726 typedef std::vector<SWF::TextRecord> TextRecords;
727 TextRecords _textRecords;
729 std::vector<size_t> _recordStarts;
731 TextRecords _displayRecords;
735 std::string _restrict;
736 std::set<wchar_t> _restrictedchars;
737 TextFormatDisplay _display;
738 std::vector<int> _tabStops;
739 LineStarts _line_starts;
746 std::string _variable_name;
748 rgba _backgroundColor;
754 TextAlignment _alignment;
756 boost::intrusive_ptr<const Font> _font;
763 size_t _bottomScroll;
764 size_t _linesindisplay;
783 std::pair<size_t, size_t> _selection;
785 boost::int16_t _leading;
786 boost::uint16_t _indent;
790 boost::uint16_t _blockIndent;
792 boost::uint16_t _leftMargin;
794 boost::uint16_t _rightMargin;
796 boost::uint16_t _fontHeight;
804 bool _restrictDefined;
822 bool _text_variable_registered;
824 bool _drawBackground;
SWFRect & _bounds
Definition: MovieClip.cpp:369
The TextFormat_as Relay type stores text properties.
Definition: TextFormat_as.h:44
AutoSize getAutoSize() const
Get autoSize value.
Definition: TextField.h:325
size_t getCaretIndex() const
Definition: TextField.h:174
const std::pair< size_t, size_t > & getSelection() const
Get a std::pair of size_t with start/end of selection.
Definition: TextField.h:182
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:168
A Font resource.
Definition: Font.h:90
boost::uint16_t getLeftMargin() const
Definition: TextField.h:456
TextAlignment getAlignment() const
Definition: TextField.h:484
bool getEmbedFonts() const
Return true if this TextField should use embedded font glyphs, false if it should use device font gly...
Definition: TextField.h:275
SWFStream & s
Definition: DefineBitsTag.cpp:73
bool isRestrict() const
Definition: TextField.h:518
Definition: klash_part.cpp:330
Invalid value.
Definition: TextField.h:99
void setMaxHScroll(size_t maxHScroll)
Definition: TextField.h:572
bool password() const
Get the current password setting of the TextField.
Definition: TextField.h:306
void multiline(bool b)
Set the current multiline setting of the TextField.
Definition: TextField.h:301
Definition: TextField.h:67
bool doHtml() const
Return true if HTML markup in text should be rendered.
Definition: TextField.h:394
boost::uint16_t getRightMargin() const
Definition: TextField.h:463
void maxChars(boost::int32_t max)
Set the current maxChars setting of the TextField.
Definition: TextField.h:288
std::vector< size_t > LineStarts
Definition: TextField.h:61
Definition: GnashKey.h:157
bool getUnderlined() const
Definition: TextField.h:498
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
size_t getMaxHScroll() const
Definition: TextField.h:543
bool isReadOnly() const
Return true if this TextField is read-only.
Definition: TextField.h:354
Definition: TextField.h:103
const std::string & getRestrict() const
Definition: TextField.h:523
Definition: klash_part.cpp:329
const SWFRect & getTextBoundingBox() const
Definition: TextField.h:587
The base class for all ActionScript objects.
Definition: as_object.h:161
bool getTextDefined() const
Return true if text is defined.
Definition: TextField.h:172
TypeValue getType() const
Get type (input, dynamic or invalid)
Definition: TextField.h:348
Base class for render handlers.
Definition: Renderer.h:190
void setHtml(bool on)
Set html parameter.
Definition: TextField.h:402
void setType(TypeValue val)
Set type (input or dynamic)
Definition: TextField.h:345
const URL _url
Definition: NetConnection_as.cpp:258
code
Definition: GnashKey.h:43
Expand TextField, anchor the horizontal center.
Definition: TextField.h:89
bool isSelectable() const
Return true if the TextField text is selectable.
Definition: TextField.h:407
Definition: klash_part.cpp:329
Definition: TextField.h:68
TextAlignment
Text alignment values.
Definition: TextField.h:64
boost::uint16_t getIndent() const
Definition: TextField.h:470
Store a TextRecord.
Definition: TextRecord.h:47
const std::string & getVariableName() const
Definition: TextField.h:144
size_t getHScroll() const
Definition: TextField.h:538
size_t getScroll() const
Definition: TextField.h:528
void setScroll(size_t scroll)
Definition: TextField.h:560
tuple v
Definition: test.py:11
TextFormatDisplay
Text format display values.
Definition: TextField.h:73
boost::int32_t x
Definition: BitmapData_as.cpp:434
boost::int16_t getLeading() const
Definition: TextField.h:491
TypeValue
Possible type values.
Definition: TextField.h:96
const std::vector< int > & getTabStops() const
Definition: TextField.h:513
Definition: GnashKey.h:148
bool getBullet() const
Definition: TextField.h:508
TextFormatDisplay getDisplay() const
Definition: TextField.h:503
bool doWordWrap() const
Return true if text should continue to next available line when hitting end of bounding box...
Definition: TextField.h:379
const rgba & getTextColor() const
Return color of the text.
Definition: TextField.h:261
void setSelectable(bool v)
Set 'selectable' parameter.
Definition: TextField.h:416
void setHScroll(size_t hScroll)
Definition: TextField.h:568
The base class for interactive objects.
Definition: InteractiveObject.h:44
SWF Tag DefineEditText (37).
Definition: DefineEditTextTag.h:56
boost::uint16_t getFontHeight() const
Definition: TextField.h:449
boost::int32_t y
Definition: BitmapData_as.cpp:435
Definition: GnashKey.h:154
Expand TextField, anchor the top-left side.
Definition: TextField.h:86
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:44
std::string url
Definition: gnash.cpp:59
boost::uint16_t getBlockIndent() const
Definition: TextField.h:477
Definition: GnashKey.h:151
Do not automatically resize TextField as text grow/shrink.
Definition: TextField.h:83
size_t getBottomScroll() const
Definition: TextField.h:548
#define DSOTEXPORT
Definition: dsodefs.h:63
virtual bool isSelectableTextField() const
Return true if the TextField text is selectable.
Definition: TextField.h:423
pixel_iterator< T > end(GnashImage &im)
Definition: ImageIterators.h:198
void setbottomScroll(size_t bottomScroll)
Definition: TextField.h:576
size_t getMaxScroll() const
Definition: TextField.h:533
A class to identify 'static' SWF events (system events).
Definition: event_id.h:52
void setMaxScroll(size_t maxScroll)
Definition: TextField.h:564
virtual SWFRect getBounds() const
Get bounding SWFRect of this TextField.
Definition: TextField.h:216
void setHeight(DisplayObject &o, const as_value &val)
Definition: DisplayObject.cpp:366
Definition: GnashKey.h:331
boost::int32_t maxChars() const
Get the current maxChars setting of the TextField.
Definition: TextField.h:280
bool mouseEnabled() const
Returns true for now, TextField is always "Mouse-Enabled".
Definition: TextField.h:125
An instance of a DefineEditTextTag.
Definition: TextField.h:56
void password(bool b)
Set the current password setting of the TextField.
Definition: TextField.h:314
const Font * getFont()
Definition: TextField.h:446
AutoSize
Possible autoSize values.
Definition: TextField.h:80
bool multiline() const
Get the current multiline setting of the TextField.
Definition: TextField.h:293
A basic RGBA type.
Definition: RGBA.h:35