ASPiK SDK
cocoatextedit.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 __cocoatextedit__
6 #define __cocoatextedit__
7 
8 #include "../../iplatformtextedit.h"
9 
10 #if MAC_COCOA
11 
12 #ifdef __OBJC__
13 @class NSView;
14 @class NSTextField;
15 #else
16 struct NSView;
17 struct NSTextField;
18 #endif
19 
20 namespace VSTGUI {
21 
22 //-----------------------------------------------------------------------------
23 class CocoaTextEdit : public IPlatformTextEdit
24 {
25 public:
26  CocoaTextEdit (NSView* parent, IPlatformTextEditCallback* textEdit);
27  ~CocoaTextEdit () noexcept override;
28 
29  UTF8String getText () override;
30  bool setText (const UTF8String& text) override;
31  bool updateSize () override;
32 
33  NSTextField* getPlatformControl () const { return platformControl; }
34  NSView* getParent () const { return parent; }
35  IPlatformTextEditCallback* getTextEdit () const { return textEdit; }
36 
37 //-----------------------------------------------------------------------------
38 protected:
39  static void initClass ();
40 
41  NSTextField* platformControl;
42  NSView* parent;
43 };
44 
45 } // namespace
46 
47 #endif // MAC_COCOA
48 
49 #endif // __cocoatextedit__
Definition: customcontrols.cpp:8