ASPiK SDK
uiviewframe.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 __uiviewframe__
6 #define __uiviewframe__
7 
8 #include "../../../vstguifwd.h"
9 #include "../../../cview.h"
10 #include "../../iplatformframe.h"
11 
12 #if TARGET_OS_IPHONE
13 
14 #ifdef __OBJC__
15 #import <UIKit/UIKit.h>
16 #else
17 struct UIView;
18 #endif
19 
20 namespace VSTGUI {
21 
22 //-----------------------------------------------------------------------------
23 class UIViewFrame : public IPlatformFrame
24 {
25 public:
26  UIViewFrame (IPlatformFrameCallback* frame, const CRect& size, UIView* parent);
27  ~UIViewFrame ();
28 
29  UIView* getPlatformControl () const { return uiView; }
30  IPlatformFrameCallback* getFrame () const { return frame; }
31 
32  // IPlatformFrame
33  bool getGlobalPosition (CPoint& pos) const override;
34  bool setSize (const CRect& newSize) override;
35  bool getSize (CRect& size) const override;
36  bool getCurrentMousePosition (CPoint& mousePosition) const override { return false; };
37  bool getCurrentMouseButtons (CButtonState& buttons) const override { return false; };
38  bool setMouseCursor (CCursorType type) override { return false; };
39  bool invalidRect (const CRect& rect) override;
40  bool scrollRect (const CRect& src, const CPoint& distance) override;
41  bool showTooltip (const CRect& rect, const char* utf8Text) override { return false; };
42  bool hideTooltip () override { return false; };
43  void* getPlatformRepresentation () const override { return (__bridge void*)uiView; }
44  SharedPointer<IPlatformTextEdit> createPlatformTextEdit (IPlatformTextEditCallback* textEdit) override;
45  SharedPointer<IPlatformOptionMenu> createPlatformOptionMenu () override;
46 #if VSTGUI_OPENGL_SUPPORT
47  SharedPointer<IPlatformOpenGLView> createPlatformOpenGLView () override;
48 #endif
49  SharedPointer<IPlatformViewLayer> createPlatformViewLayer (IPlatformViewLayerDelegate* drawDelegate, IPlatformViewLayer* parentLayer) override;
50  SharedPointer<COffscreenContext> createOffscreenContext (CCoord width, CCoord height, double scaleFactor = 1.) override;
51  DragResult doDrag (IDataPackage* source, const CPoint& offset, CBitmap* dragBitmap) override;
52  void setClipboard (const SharedPointer<IDataPackage>& data) override;
53  SharedPointer<IDataPackage> getClipboard () override;
54  PlatformType getPlatformType () const override { return PlatformType::kUIView; }
55 
56 //-----------------------------------------------------------------------------
57 protected:
58  UIView* uiView;
59 };
60 
61 }
62 
63 #endif // TARGET_OS_IPHONE
64 
65 #endif
Definition: customcontrols.cpp:8