MyGUI  3.2.0
MyGUI_ISubWidgetText.h
Go to the documentation of this file.
00001 
00006 /*
00007     This file is part of MyGUI.
00008 
00009     MyGUI is free software: you can redistribute it and/or modify
00010     it under the terms of the GNU Lesser General Public License as published by
00011     the Free Software Foundation, either version 3 of the License, or
00012     (at your option) any later version.
00013 
00014     MyGUI is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
00021 */
00022 #ifndef __MYGUI_I_SUB_WIDGET_TEXT_H__
00023 #define __MYGUI_I_SUB_WIDGET_TEXT_H__
00024 
00025 #include "MyGUI_Prerequest.h"
00026 #include "MyGUI_ISubWidget.h"
00027 #include "MyGUI_Colour.h"
00028 
00029 namespace MyGUI
00030 {
00031 
00032     class MYGUI_EXPORT ISubWidgetText :
00033         public ISubWidget
00034     {
00035         MYGUI_RTTI_DERIVED( ISubWidgetText )
00036 
00037     public:
00038         virtual ~ISubWidgetText()  { }
00039 
00041         virtual size_t getTextSelectionStart() const
00042         {
00043             return 0;
00044         }
00045 
00047         virtual size_t getTextSelectionEnd() const
00048         {
00049             return 0;
00050         }
00051 
00053         virtual void setTextSelection(size_t _start, size_t _end) { }
00054 
00055         // интенсивность выделенного текста
00056         virtual bool getSelectBackground() const
00057         {
00058             return true;
00059         }
00060 
00061         virtual void setSelectBackground(bool _normal) { }
00062 
00063         // нужно ли инвертировать выделение
00064         virtual bool getInvertSelected() const
00065         {
00066             return true;
00067         }
00068 
00069         virtual void setInvertSelected(bool _value) { }
00070 
00071         // нужно ли показывать тень
00072         virtual bool getShadow() const
00073         {
00074             return false;
00075         }
00076 
00077         virtual void setShadow(bool _value) { }
00078 
00079         // управление видимостью курсора
00080         virtual bool isVisibleCursor() const
00081         {
00082             return false;
00083         }
00084 
00085         virtual void setVisibleCursor(bool _value) { }
00086 
00087         // управление положением курсора
00088         virtual size_t getCursorPosition() const
00089         {
00090             return 0;
00091         }
00092 
00093         virtual void setCursorPosition(size_t _index) { }
00094 
00095         virtual void setWordWrap(bool _value) { }
00096 
00097         // возвращает положение курсора по произвольному положению
00098         // позиция абсолютная, без учета смещений
00099         virtual size_t getCursorPosition(const IntPoint& _point) /*const*/
00100         {
00101             return 0;
00102         }
00103 
00104         // возвращает положение курсора в обсолютных координатах
00105         virtual IntCoord getCursorCoord(size_t _position) /*const*/
00106         {
00107             return IntCoord();
00108         }
00109 
00110         // возвращает положение курсора в обсолютных координатах
00111         IntPoint getCursorPoint(size_t _position) /*const*/
00112         {
00113             const IntCoord& coord = getCursorCoord(_position);
00114             return IntPoint(coord.left + coord.width / 2, coord.top + coord.height / 2);
00115         }
00116 
00117         // возвращает положение курсора в обсолютных координатах
00118         IntRect getCursorRect(size_t _position) /*const*/
00119         {
00120             const IntCoord& coord = getCursorCoord(_position);
00121             return IntRect(coord.left, coord.top, coord.left + coord.width, coord.top + coord.height);
00122         }
00123 
00124         // возвращает размер текста в пикселях
00125         virtual IntSize getTextSize() /*const*/
00126         {
00127             return IntSize();
00128         }
00129 
00130         // устанавливает смещение текста в пикселях
00131         virtual void setViewOffset(const IntPoint& _point) { }
00132         virtual IntPoint getViewOffset() const
00133         {
00134             return IntPoint();
00135         }
00136 
00137         virtual void setCaption(const UString& _value) { }
00138         virtual const UString& getCaption() const
00139         {
00140             static UString caption;
00141             return caption;
00142         }
00143 
00144         virtual void setTextColour(const Colour& _value) { }
00145         virtual const Colour& getTextColour() const
00146         {
00147             return Colour::Zero;
00148         }
00149 
00150         virtual void setFontName(const std::string& _value) { }
00151         virtual const std::string& getFontName() const
00152         {
00153             static std::string name;
00154             return name;
00155         }
00156 
00157         virtual void setFontHeight(int _value) { }
00158         virtual int getFontHeight() const
00159         {
00160             return 0;
00161         }
00162 
00163         virtual void setTextAlign(Align _value) { }
00164         virtual Align getTextAlign() const
00165         {
00166             return Align::Default;
00167         }
00168 
00169         virtual void setShiftText(bool _value) { }
00170 
00171         virtual void setShadowColour(const Colour& _value) { }
00172         virtual const Colour& getShadowColour() const
00173         {
00174             return Colour::Zero;
00175         }
00176 
00177     };
00178 
00179 } // namespace MyGUI
00180 
00181 #endif // __MYGUI_I_SUB_WIDGET_TEXT_H__