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 #ifndef GNASH_SWF_DEFINEEDITTEXTTAG_H
00019 #define GNASH_SWF_DEFINEEDITTEXTTAG_H
00020
00021 #include "SWFRect.h"
00022 #include "DefinitionTag.h"
00023 #include "SWF.h"
00024 #include "RGBA.h"
00025 #include "TextField.h"
00026
00027 #include <boost/intrusive_ptr.hpp>
00028 #include <string>
00029 #include <boost/cstdint.hpp>
00030
00031
00032
00033 namespace gnash {
00034 class SWFStream;
00035 class movie_definition;
00036 class RunResources;
00037 class Font;
00038 }
00039
00040 namespace gnash {
00041 namespace SWF {
00042
00044
00055 class DefineEditTextTag : public DefinitionTag
00056 {
00057
00058 public:
00059
00060 ~DefineEditTextTag() {}
00061
00063 static void loader(SWFStream& in, TagType tag, movie_definition& m,
00064 const RunResources& r);
00065
00066 const SWFRect& bounds() const { return _rect; }
00067
00068 DisplayObject* createDisplayObject(Global_as& gl,
00069 DisplayObject* parent) const;
00070
00073 const std::string& defaultText() const {
00074 return _defaultText;
00075 }
00076
00082 const std::string& variableName() const {
00083 return _variableName;
00084 }
00085
00087
00090 unsigned int maxChars() const {
00091 return _maxChars;
00092 }
00093
00095 boost::uint16_t rightMargin() const {
00096 return _rightMargin;
00097 }
00098
00100 boost::uint16_t leftMargin() const {
00101 return _leftMargin;
00102 }
00103
00105 boost::uint16_t indent() const {
00106 return _indent;
00107 }
00108
00110
00111 boost::uint16_t textHeight() const {
00112 return _textHeight;
00113 }
00114
00116 const rgba& color() const {
00117 return _color;
00118 }
00119
00122
00124 boost::uint16_t leading() const {
00125 return _leading;
00126 }
00127
00128 bool multiline() const {
00129 return _multiline;
00130 }
00131
00132 bool password() const {
00133 return _password;
00134 }
00135
00137 TextField::TextAlignment alignment() const {
00138 return _alignment;
00139 }
00140
00142 bool border() const {
00143 return _border;
00144 }
00145
00146 bool autoSize() const {
00147 return _autoSize;
00148 }
00149
00151 bool wordWrap() const {
00152 return _wordWrap;
00153 }
00154
00156 bool hasText() const {
00157 return _hasText;
00158 }
00159
00160 bool readOnly() const
00161 {
00162 return _readOnly;
00163 }
00164
00165 bool noSelect() const
00166 {
00167 return _noSelect;
00168 }
00169
00171 bool html() const { return _html; }
00172
00174
00177 bool getUseEmbeddedGlyphs() const
00178 {
00179 return _useOutlines;
00180 }
00181
00182 boost::intrusive_ptr<Font> getFont() const
00183 {
00184 return _font;
00185 }
00186
00187 private:
00188
00190
00192 DefineEditTextTag(SWFStream& in, movie_definition& m, boost::uint16_t id);
00193
00195 void read(SWFStream& in, movie_definition& m);
00196
00197 SWFRect _rect;
00198
00199 std::string _variableName;
00200
00201
00202
00203
00204 bool _hasText;
00205 bool _wordWrap;
00206 bool _multiline;
00207
00209 bool _password;
00210 bool _readOnly;
00212 bool _autoSize;
00213 bool _noSelect;
00214
00217 bool _border;
00218
00220
00243 bool _html;
00244
00251
00252
00253
00254 bool _useOutlines;
00255
00256 int _fontID;
00257 boost::intrusive_ptr<Font> _font;
00258
00260
00261
00262
00263 boost::uint16_t _textHeight;
00264
00266 rgba _color;
00267
00269
00272 unsigned int _maxChars;
00273
00274 TextField::TextAlignment _alignment;
00275
00277 boost::uint16_t _leftMargin;
00278
00280 boost::uint16_t _rightMargin;
00281
00283 boost::uint16_t _indent;
00284
00288 boost::uint16_t _leading;
00289
00291 std::string _defaultText;
00292 };
00293
00294
00295 }
00296 }
00297
00298 #endif