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
00064 const String& getText() const;
00065
00067 const String& getTextVisual() const;
00068
00082 void setText(const String& text);
00083
00091 const String& getFont() const;
00092
00106 void setFont(const String& font);
00107
00115 VerticalTextFormatting getVerticalFormatting() const;
00116
00127 void setVerticalFormatting(VerticalTextFormatting fmt);
00128
00136 HorizontalTextFormatting getHorizontalFormatting() const;
00137
00148 void setHorizontalFormatting(HorizontalTextFormatting fmt);
00149
00161 void writeXMLToStream(XMLSerializer& xml_stream) const;
00162
00171 bool isTextFetchedFromProperty() const;
00172
00181 const String& getTextPropertySource() const;
00182
00194 void setTextPropertySource(const String& property);
00195
00204 bool isFontFetchedFromProperty() const;
00205
00214 const String& getFontPropertySource() const;
00215
00227 void setFontPropertySource(const String& property);
00228
00229 protected:
00230
00231 void render_impl(Window& srcWindow, Rect& destRect, const CEGUI::ColourRect* modColours, const Rect* clipper, bool clipToDisplay) const;
00233 void setupStringFormatter(const Window& window,
00234 const RenderedString& rendered_string) const;
00235 private:
00236 String d_textLogical;
00237
00238 BiDiVisualMapping* d_bidiVisualMapping;
00240 mutable bool d_bidiDataValid;
00242 mutable RenderedString d_renderedString;
00244 mutable RefCounted<FormattedRenderedString> d_formattedRenderedString;
00246 mutable HorizontalTextFormatting d_lastHorzFormatting;
00247
00248 String d_font;
00249 VerticalTextFormatting d_vertFormatting;
00250 HorizontalTextFormatting d_horzFormatting;
00251 String d_textPropertyName;
00252 String d_fontPropertyName;
00253 };
00254
00255 }
00256
00257 #if defined(_MSC_VER)
00258 # pragma warning(pop)
00259 #endif
00260
00261 #endif // end of guard _CEGUIFalTextComponent_h_