]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/iphone/private.h
Remove all lines containing cvs/svn "$Id$" keyword.
[wxWidgets.git] / include / wx / osx / iphone / private.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/iphone/private.h
3 // Purpose: Private declarations: as this header is only included by
4 // wxWidgets itself, it may contain identifiers which don't start
5 // with "wx".
6 // Author: Stefan Csomor
7 // Modified by:
8 // Created: 1998-01-01
9 // Copyright: (c) Stefan Csomor
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_PRIVATE_IPHONE_H_
14 #define _WX_PRIVATE_IPHONE_H_
15
16 #ifdef __OBJC__
17 #import <UIKit/UIKit.h>
18 #endif
19
20 #include <CoreText/CTFont.h>
21 #include <CoreText/CTStringAttributes.h>
22 #include <CoreText/CTLine.h>
23
24
25 #if wxUSE_GUI
26
27 OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage(
28 CGContextRef inContext,
29 const CGRect * inBounds,
30 CGImageRef inImage) ;
31
32 WX_UIImage WXDLLIMPEXP_CORE wxOSXGetUIImageFromCGImage( CGImageRef image );
33 wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
34
35 class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl
36 {
37 public :
38 wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false, bool isUserPane = false ) ;
39 wxWidgetIPhoneImpl() ;
40 ~wxWidgetIPhoneImpl();
41
42 void Init();
43
44 virtual bool IsVisible() const ;
45 virtual void SetVisibility( bool visible );
46
47 virtual void Raise();
48
49 virtual void Lower();
50
51 virtual void ScrollRect( const wxRect *rect, int dx, int dy );
52
53 virtual WXWidget GetWXWidget() const { return m_osxView; }
54
55 virtual void SetBackgroundColour( const wxColour& col ) ;
56 virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
57
58 virtual void GetContentArea( int &left , int &top , int &width , int &height ) const;
59 virtual void Move(int x, int y, int width, int height);
60 virtual void GetPosition( int &x, int &y ) const;
61 virtual void GetSize( int &width, int &height ) const;
62 virtual void SetControlSize( wxWindowVariant variant );
63 virtual double GetContentScaleFactor() const ;
64
65 virtual void SetNeedsDisplay( const wxRect* where = NULL );
66 virtual bool GetNeedsDisplay() const;
67
68 virtual bool CanFocus() const;
69 // return true if successful
70 virtual bool SetFocus();
71 virtual bool HasFocus() const;
72
73 void RemoveFromParent();
74 void Embed( wxWidgetImpl *parent );
75
76 void SetDefaultButton( bool isDefault );
77 void PerformClick();
78 virtual void SetLabel(const wxString& title, wxFontEncoding encoding);
79
80 void SetCursor( const wxCursor & cursor );
81 void CaptureMouse();
82 void ReleaseMouse();
83
84 wxInt32 GetValue() const;
85 void SetValue( wxInt32 v );
86
87 virtual wxBitmap GetBitmap() const;
88 virtual void SetBitmap( const wxBitmap& bitmap );
89 virtual void SetBitmapPosition( wxDirection dir );
90
91 void SetupTabs( const wxNotebook &notebook );
92 void GetBestRect( wxRect *r ) const;
93 bool IsEnabled() const;
94 void Enable( bool enable );
95 bool ButtonClickDidStateChange() { return true ;}
96 void SetMinimum( wxInt32 v );
97 void SetMaximum( wxInt32 v );
98 wxInt32 GetMinimum() const;
99 wxInt32 GetMaximum() const;
100 void PulseGauge();
101 void SetScrollThumb( wxInt32 value, wxInt32 thumbSize );
102
103 void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
104
105 void InstallEventHandler( WXWidget control = NULL );
106
107 virtual void DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow);
108
109 // thunk connected calls
110
111 virtual void drawRect(CGRect* rect, WXWidget slf, void* _cmd);
112 virtual void touchEvent(WX_NSSet touches, WX_UIEvent event, WXWidget slf, void* _cmd);
113 virtual bool becomeFirstResponder(WXWidget slf, void* _cmd);
114 virtual bool resignFirstResponder(WXWidget slf, void* _cmd);
115
116 // action
117
118 virtual void controlAction(void* sender, wxUint32 controlEvent, WX_UIEvent rawEvent);
119 virtual void controlTextDidChange();
120 protected:
121 WXWidget m_osxView;
122 DECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetIPhoneImpl)
123 };
124
125 class wxNonOwnedWindowIPhoneImpl : public wxNonOwnedWindowImpl
126 {
127 public :
128 wxNonOwnedWindowIPhoneImpl( wxNonOwnedWindow* nonownedwnd) ;
129 wxNonOwnedWindowIPhoneImpl();
130
131 virtual ~wxNonOwnedWindowIPhoneImpl();
132
133 virtual void WillBeDestroyed() ;
134 void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
135 long style, long extraStyle, const wxString& name ) ;
136 void Create( wxWindow* parent, WXWindow nativeWindow );
137
138 WXWindow GetWXWindow() const;
139 void Raise();
140 void Lower();
141 bool Show(bool show);
142 bool ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout);
143
144 void Update();
145 bool SetTransparent(wxByte alpha);
146 bool SetBackgroundColour(const wxColour& col );
147 void SetExtraStyle( long exStyle );
148 bool SetBackgroundStyle(wxBackgroundStyle style);
149 bool CanSetTransparent();
150
151 void MoveWindow(int x, int y, int width, int height);
152 void GetPosition( int &x, int &y ) const;
153 void GetSize( int &width, int &height ) const;
154
155 void GetContentArea( int &left , int &top , int &width , int &height ) const;
156 bool SetShape(const wxRegion& region);
157
158 virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) ;
159
160 virtual bool IsMaximized() const;
161
162 virtual bool IsIconized() const;
163
164 virtual void Iconize( bool iconize );
165
166 virtual void Maximize(bool maximize);
167
168 virtual bool IsFullScreen() const;
169
170 virtual bool ShowFullScreen(bool show, long style);
171
172 virtual void RequestUserAttention(int flags);
173
174 virtual void ScreenToWindow( int *x, int *y );
175
176 virtual void WindowToScreen( int *x, int *y );
177
178 // FIXME: Does iPhone have a concept of inactive windows?
179 virtual bool IsActive() { return true; }
180
181 wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
182
183 virtual bool InitialShowEventSent() { return m_initialShowSent; }
184 protected :
185 WX_UIWindow m_macWindow;
186 void * m_macFullScreenData ;
187 bool m_initialShowSent;
188 DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowIPhoneImpl)
189 };
190
191 #ifdef __OBJC__
192
193 WXDLLIMPEXP_CORE CGRect wxToNSRect( UIView* parent, const wxRect& r );
194 WXDLLIMPEXP_CORE wxRect wxFromNSRect( UIView* parent, const CGRect& rect );
195 WXDLLIMPEXP_CORE CGPoint wxToNSPoint( UIView* parent, const wxPoint& p );
196 WXDLLIMPEXP_CORE wxPoint wxFromNSPoint( UIView* parent, const CGPoint& p );
197
198 CGRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
199 bool adjustForOrigin = true );
200
201 @interface wxUIButton : UIButton
202 {
203 }
204
205 @end
206
207 @interface wxUIView : UIView
208 {
209 }
210
211 @end // wxUIView
212
213
214 void WXDLLIMPEXP_CORE wxOSXIPhoneClassAddWXMethods(Class c);
215
216 #endif
217
218 #endif // wxUSE_GUI
219
220 #endif
221 // _WX_PRIVATE_IPHONE_H_