ASPiK SDK
iplatformtextedit.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __iplatformtextedit__
6 #define __iplatformtextedit__
7 
9 
10 #include "../cfont.h"
11 #include "../ccolor.h"
12 #include "../crect.h"
13 #include "../cdrawcontext.h"
14 
15 struct VstKeyCode;
16 
17 namespace VSTGUI {
18 
19 //-----------------------------------------------------------------------------
20 class IPlatformTextEditCallback
21 {
22 public:
23  virtual CColor platformGetBackColor () const = 0;
24  virtual CColor platformGetFontColor () const = 0;
25  virtual CFontRef platformGetFont () const = 0;
26  virtual CHoriTxtAlign platformGetHoriTxtAlign () const = 0;
27  virtual const UTF8String& platformGetText () const = 0;
28  virtual const UTF8String& platformGetPlaceholderText () const = 0;
29  virtual CRect platformGetSize () const = 0;
30  virtual CRect platformGetVisibleSize () const = 0;
31  virtual CPoint platformGetTextInset () const = 0;
32  virtual void platformLooseFocus (bool returnPressed) = 0;
33  virtual bool platformOnKeyDown (const VstKeyCode& key) = 0;
34  virtual void platformTextDidChange () = 0;
35  virtual bool platformIsSecureTextEdit () = 0;
36 
37 //------------------------------------------------------------------------------------
38 };
39 
40 //-----------------------------------------------------------------------------
41 class IPlatformTextEdit : public AtomicReferenceCounted
42 {
43 public:
44  virtual UTF8String getText () = 0;
45  virtual bool setText (const UTF8String& text) = 0;
46  virtual bool updateSize () = 0;
47 
48 //-----------------------------------------------------------------------------
49 protected:
50  explicit IPlatformTextEdit (IPlatformTextEditCallback* textEdit) : textEdit (textEdit) {}
51  IPlatformTextEditCallback* textEdit;
52 };
53 
54 } // namespace
55 
57 
58 #endif // __iplatformtextedit__
Definition: vstkeycode.h:12
Definition: customcontrols.cpp:8