ASPiK SDK
hiviewtextedit.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 __hiviewtextedit__
6 #define __hiviewtextedit__
7 
8 #include "../../iplatformtextedit.h"
9 
10 #if MAC_CARBON
11 
12 #include <Carbon/Carbon.h>
13 
14 namespace VSTGUI {
15 
16 //-----------------------------------------------------------------------------
17 class HIViewTextEdit : public IPlatformTextEdit
18 {
19 public:
20  HIViewTextEdit (HIViewRef parent, IPlatformTextEditCallback* textEdit);
21  ~HIViewTextEdit () noexcept;
22 
23  UTF8String getText () override;
24  bool setText (const UTF8String& text) override;
25  bool updateSize () override;
26 
27  HIViewRef getPlatformControl () const { return platformControl; }
28 //-----------------------------------------------------------------------------
29 protected:
30  void freeText ();
31 
32  HIViewRef platformControl;
33  EventHandlerRef eventHandler;
34  UTF8StringBuffer text;
35 
36  static pascal OSStatus CarbonEventsTextControlProc (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData);
37 };
38 
39 } // namespace
40 
41 #endif // MAC_CARBON
42 
43 #endif // __hiviewtextedit__
Definition: customcontrols.cpp:8