MyGUI 3.0.1

MyGUI_ISubWidgetText.h

Go to the documentation of this file.
00001 
00007 /*
00008     This file is part of MyGUI.
00009 
00010     MyGUI is free software: you can redistribute it and/or modify
00011     it under the terms of the GNU Lesser General Public License as published by
00012     the Free Software Foundation, either version 3 of the License, or
00013     (at your option) any later version.
00014 
00015     MyGUI is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU Lesser General Public License for more details.
00019 
00020     You should have received a copy of the GNU Lesser General Public License
00021     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
00022 */
00023 #ifndef __MYGUI_I_SUB_WIDGET_TEXT_H__
00024 #define __MYGUI_I_SUB_WIDGET_TEXT_H__
00025 
00026 #include "MyGUI_Prerequest.h"
00027 #include "MyGUI_ISubWidget.h"
00028 #include "MyGUI_Colour.h"
00029 
00030 namespace MyGUI
00031 {
00032 
00033     class MYGUI_EXPORT ISubWidgetText : public ISubWidget
00034     {
00035         MYGUI_RTTI_DERIVED( ISubWidgetText )
00036 
00037     public:
00038         virtual ~ISubWidgetText()  { }
00039 
00041         virtual size_t getTextSelectionStart() { return 0; }
00043         virtual size_t getTextSelectionEnd() { return 0; }
00045         virtual void setTextSelection(size_t _start, size_t _end) { }
00046 
00047         // интенсивность выделенного текста
00048         virtual bool getSelectBackground() { return true; }
00049         virtual void setSelectBackground(bool _normal) { }
00050 
00051         // нужно ли инвертировать выделение
00052         virtual bool getInvertSelected() { return true; }
00053         virtual void setInvertSelected(bool _value) { }
00054 
00055         // управление видимостью курсора
00056         virtual bool isVisibleCursor() { return false; }
00057         virtual void setVisibleCursor(bool _value) { }
00058 
00059         // управление положением курсора
00060         virtual size_t getCursorPosition() { return 0; }
00061         virtual void setCursorPosition(size_t _index) { }
00062 
00063         virtual void setWordWrap(bool _value) { }
00064 
00065         // возвращает положение курсора по произвольному положению
00066         // позиция абсолютная, без учета смещений
00067         virtual size_t getCursorPosition(const IntPoint& _point) { return 0; }
00068 
00069         // возвращает положение курсора в обсолютных координатах
00070         virtual IntCoord getCursorCoord(size_t _position) { return IntCoord(); }
00071 
00072         // возвращает положение курсора в обсолютных координатах
00073         IntPoint getCursorPoint(size_t _position)
00074         {
00075             const IntCoord& coord = getCursorCoord(_position);
00076             return IntPoint(coord.left + coord.width / 2, coord.top + coord.height / 2);
00077         }
00078 
00079         // возвращает положение курсора в обсолютных координатах
00080         IntRect getCursorRect(size_t _position)
00081         {
00082             const IntCoord& coord = getCursorCoord(_position);
00083             return IntRect(coord.left, coord.top, coord.left + coord.width, coord.top + coord.height);
00084         }
00085 
00086         // возвращает размер текста в пикселях
00087         virtual IntSize getTextSize() { return IntSize(); }
00088 
00089         // устанавливает смещение текста в пикселях
00090         virtual void setViewOffset(const IntPoint& _point) { }
00091         virtual IntPoint getViewOffset() { return IntPoint(); }
00092 
00093         virtual void setCaption(const UString& _value) { }
00094         virtual const UString& getCaption() { static UString caption; return caption; }
00095 
00096         virtual void setTextColour(const Colour& _value) { }
00097         virtual const Colour& getTextColour() { return Colour::Zero; }
00098 
00099         virtual void setFontName(const std::string& _value) { }
00100         virtual const std::string& getFontName() { static std::string name; return name; }
00101 
00102         virtual void setFontHeight(int _value) { }
00103         virtual int getFontHeight() { return 0; }
00104 
00105         virtual void setTextAlign(Align _value) { }
00106         virtual Align getTextAlign() { return Align::Default; }
00107 
00108         virtual void setShiftText(bool _value) { }
00109 
00110     };
00111 
00112 } // namespace MyGUI
00113 
00114 #endif // __MYGUI_I_SUB_WIDGET_TEXT_H__
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines