Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GNASH_SWF_DEFINEEDITTEXTTAG_H
00020 #define GNASH_SWF_DEFINEEDITTEXTTAG_H
00021
00022 #include "SWFRect.h"
00023 #include "DefinitionTag.h"
00024 #include "SWF.h"
00025 #include "RGBA.h"
00026 #include "TextField.h"
00027
00028 #include <boost/intrusive_ptr.hpp>
00029 #include <string>
00030 #include <boost/cstdint.hpp>
00031
00032
00033
00034 namespace gnash {
00035 class SWFStream;
00036 class movie_definition;
00037 class RunResources;
00038 class Font;
00039 }
00040
00041 namespace gnash {
00042 namespace SWF {
00043
00045
00056 class DefineEditTextTag : public DefinitionTag
00057 {
00058
00059 public:
00060
00061 ~DefineEditTextTag() {}
00062
00064 static void loader(SWFStream& in, TagType tag, movie_definition& m,
00065 const RunResources& r);
00066
00067 const SWFRect& bounds() const { return _rect; }
00068
00069 DisplayObject* createDisplayObject(Global_as& gl,
00070 DisplayObject* parent) const;
00071
00074 const std::string& defaultText() const {
00075 return _defaultText;
00076 }
00077
00083 const std::string& variableName() const {
00084 return _variableName;
00085 }
00086
00088
00091 unsigned int maxChars() const {
00092 return _maxChars;
00093 }
00094
00096 boost::uint16_t rightMargin() const {
00097 return _rightMargin;
00098 }
00099
00101 boost::uint16_t leftMargin() const {
00102 return _leftMargin;
00103 }
00104
00106 boost::uint16_t indent() const {
00107 return _indent;
00108 }
00109
00111
00112 boost::uint16_t textHeight() const {
00113 return _textHeight;
00114 }
00115
00117 const rgba& color() const {
00118 return _color;
00119 }
00120
00123
00125 boost::uint16_t leading() const {
00126 return _leading;
00127 }
00128
00129 bool multiline() const {
00130 return _multiline;
00131 }
00132
00133 bool password() const {
00134 return _password;
00135 }
00136
00138 TextField::TextAlignment alignment() const {
00139 return _alignment;
00140 }
00141
00143 bool border() const {
00144 return _border;
00145 }
00146
00147 bool autoSize() const {
00148 return _autoSize;
00149 }
00150
00152 bool wordWrap() const {
00153 return _wordWrap;
00154 }
00155
00157 bool hasText() const {
00158 return _hasText;
00159 }
00160
00161 bool readOnly() const
00162 {
00163 return _readOnly;
00164 }
00165
00166 bool noSelect() const
00167 {
00168 return _noSelect;
00169 }
00170
00172 bool html() const { return _html; }
00173
00175
00178 bool getUseEmbeddedGlyphs() const
00179 {
00180 return _useOutlines;
00181 }
00182
00183 boost::intrusive_ptr<Font> getFont() const
00184 {
00185 return _font;
00186 }
00187
00188 private:
00189
00191
00193 DefineEditTextTag(SWFStream& in, movie_definition& m, boost::uint16_t id);
00194
00196 void read(SWFStream& in, movie_definition& m);
00197
00198 SWFRect _rect;
00199
00200 std::string _variableName;
00201
00202
00203
00204
00205 bool _hasText;
00206 bool _wordWrap;
00207 bool _multiline;
00208
00210 bool _password;
00211 bool _readOnly;
00213 bool _autoSize;
00214 bool _noSelect;
00215
00218 bool _border;
00219
00221
00244 bool _html;
00245
00252
00253
00254
00255 bool _useOutlines;
00256
00257 int _fontID;
00258 boost::intrusive_ptr<Font> _font;
00259
00261
00262
00263
00264 boost::uint16_t _textHeight;
00265
00267 rgba _color;
00268
00270
00273 unsigned int _maxChars;
00274
00275 TextField::TextAlignment _alignment;
00276
00278 boost::uint16_t _leftMargin;
00279
00281 boost::uint16_t _rightMargin;
00282
00284 boost::uint16_t _indent;
00285
00289 boost::uint16_t _leading;
00290
00292 std::string _defaultText;
00293 };
00294
00295
00296 }
00297 }
00298
00299 #endif