MyGUI  3.2.1
MyGUI_TextView.h
Go to the documentation of this file.
1 /*
2  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3  * Distributed under the MIT License
4  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5  */
6 
7 #ifndef __MYGUI_TEXT_VIEW_H__
8 #define __MYGUI_TEXT_VIEW_H__
9 
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_TextureUtility.h"
12 #include "MyGUI_TextViewData.h"
13 #include "MyGUI_IFont.h"
14 
15 namespace MyGUI
16 {
17 
18  class TextView
19  {
20  public:
21  TextView();
22 
23  void update(const UString& _text, IFont* _font, int _height, Align _align, VertexColourType _format, int _maxWidth = -1);
24 
25  size_t getCursorPosition(const IntPoint& _value);
26 
27  IntPoint getCursorPoint(size_t _position);
28 
29  const IntSize& getViewSize() const;
30 
31  size_t getTextLength() const;
32 
33  const VectorLineInfo& getData() const;
34 
35  private:
36  IntSize mViewSize;
37  size_t mLength;
38  VectorLineInfo mLineInfo;
39  int mFontHeight;
40  };
41 
42 } // namespace MyGUI
43 
44 #endif // __MYGUI_TEXT_VIEW_H__