00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _CEGUIFalTextComponent_h_
00029 #define _CEGUIFalTextComponent_h_
00030
00031 #include "CEGUIFalComponentBase.h"
00032 #include "../CEGUIRenderedString.h"
00033 #include "../CEGUIRefCounted.h"
00034 #include "../CEGUIFormattedRenderedString.h"
00035
00036 #if defined(_MSC_VER)
00037 # pragma warning(push)
00038 # pragma warning(disable : 4251)
00039 #endif
00040
00041
00042 namespace CEGUI
00043 {
00048 class CEGUIEXPORT TextComponent : public FalagardComponentBase
00049 {
00050 public:
00055 TextComponent();
00056
00058 ~TextComponent();
00059
00061 TextComponent(const TextComponent& obj);
00062
00064 TextComponent& operator=(const TextComponent& other);
00065
00073 const String& getText() const;
00074
00076 const String& getTextVisual() const;
00077
00091 void setText(const String& text);
00092
00100 const String& getFont() const;
00101
00115 void setFont(const String& font);
00116
00124 VerticalTextFormatting getVerticalFormatting() const;
00125
00136 void setVerticalFormatting(VerticalTextFormatting fmt);
00137
00145 HorizontalTextFormatting getHorizontalFormatting() const;
00146
00157 void setHorizontalFormatting(HorizontalTextFormatting fmt);
00158
00170 void writeXMLToStream(XMLSerializer& xml_stream) const;
00171
00180 bool isTextFetchedFromProperty() const;
00181
00190 const String& getTextPropertySource() const;
00191
00203 void setTextPropertySource(const String& property);
00204
00213 bool isFontFetchedFromProperty() const;
00214
00223 const String& getFontPropertySource() const;
00224
00236 void setFontPropertySource(const String& property);
00237
00238 protected:
00239
00240 void render_impl(Window& srcWindow, Rect& destRect, const CEGUI::ColourRect* modColours, const Rect* clipper, bool clipToDisplay) const;
00242 void setupStringFormatter(const Window& window,
00243 const RenderedString& rendered_string) const;
00244 private:
00245 String d_textLogical;
00246
00247 BiDiVisualMapping* d_bidiVisualMapping;
00249 mutable bool d_bidiDataValid;
00251 mutable RenderedString d_renderedString;
00253 mutable RefCounted<FormattedRenderedString> d_formattedRenderedString;
00255 mutable HorizontalTextFormatting d_lastHorzFormatting;
00256
00257 String d_font;
00258 VerticalTextFormatting d_vertFormatting;
00259 HorizontalTextFormatting d_horzFormatting;
00260 String d_textPropertyName;
00261 String d_fontPropertyName;
00262 };
00263
00264 }
00265
00266 #if defined(_MSC_VER)
00267 # pragma warning(pop)
00268 #endif
00269
00270 #endif // end of guard _CEGUIFalTextComponent_h_