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