]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/iphone/private.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[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
4849f027
SC
9// Copyright: (c) Stefan Csomor
10// Licence: wxWindows licence
11/////////////////////////////////////////////////////////////////////////////
12
13#ifndef _WX_PRIVATE_IPHONE_H_
14#define _WX_PRIVATE_IPHONE_H_
15
4849f027
SC
16#ifdef __OBJC__
17 #import <UIKit/UIKit.h>
18#endif
19
721ba9cb
SC
20#include <CoreText/CTFont.h>
21#include <CoreText/CTStringAttributes.h>
22#include <CoreText/CTLine.h>
23
24
4849f027
SC
25#if wxUSE_GUI
26
d3929256
SC
27OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage(
28 CGContextRef inContext,
29 const CGRect * inBounds,
30 CGImageRef inImage) ;
31
59d866ad 32WX_UIImage WXDLLIMPEXP_CORE wxOSXGetUIImageFromCGImage( CGImageRef image );
ca9eebc3 33wxBitmap WXDLLIMPEXP_CORE wxOSXCreateSystemBitmap(const wxString& id, const wxString &client, const wxSize& size);
d3929256 34
4849f027
SC
35class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl
36{
37public :
415f4a01 38 wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false, bool isUserPane = false ) ;
03647350
VZ
39 wxWidgetIPhoneImpl() ;
40 ~wxWidgetIPhoneImpl();
41
4849f027 42 void Init();
03647350 43
4849f027
SC
44 virtual bool IsVisible() const ;
45 virtual void SetVisibility( bool visible );
03647350 46
4849f027 47 virtual void Raise();
03647350 48
4849f027
SC
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 ) ;
719ddf1e 56 virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
4849f027
SC
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;
d3929256 62 virtual void SetControlSize( wxWindowVariant variant );
f082dcd5 63 virtual double GetContentScaleFactor() const ;
f18b5ee7 64
4849f027
SC
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 );
03647350 75
d3929256
SC
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 );
9e55f38d
SC
86
87 virtual wxBitmap GetBitmap() const;
88 virtual void SetBitmap( const wxBitmap& bitmap );
89 virtual void SetBitmapPosition( wxDirection dir );
03647350 90
d3929256
SC
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 );
03647350
VZ
106
107 virtual void DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* otherWindow);
d3929256
SC
108
109 // thunk connected calls
03647350 110
d3929256
SC
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
03647350 117
719ddf1e
SC
118 virtual void controlAction(void* sender, wxUint32 controlEvent, WX_UIEvent rawEvent);
119 virtual void controlTextDidChange();
4849f027
SC
120protected:
121 WXWidget m_osxView;
122 DECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetIPhoneImpl)
123};
124
125class wxNonOwnedWindowIPhoneImpl : public wxNonOwnedWindowImpl
126{
127public :
128 wxNonOwnedWindowIPhoneImpl( wxNonOwnedWindow* nonownedwnd) ;
129 wxNonOwnedWindowIPhoneImpl();
03647350 130
4849f027 131 virtual ~wxNonOwnedWindowIPhoneImpl();
03647350 132
0aaa6ace 133 virtual void WillBeDestroyed() ;
4849f027
SC
134 void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
135 long style, long extraStyle, const wxString& name ) ;
719ddf1e 136 void Create( wxWindow* parent, WXWindow nativeWindow );
03647350 137
4849f027 138 WXWindow GetWXWindow() const;
03647350 139 void Raise();
4849f027 140 void Lower();
03647350 141 bool Show(bool show);
4849f027 142 bool ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout);
03647350 143
4849f027
SC
144 void Update();
145 bool SetTransparent(wxByte alpha);
146 bool SetBackgroundColour(const wxColour& col );
03647350
VZ
147 void SetExtraStyle( long exStyle );
148 bool SetBackgroundStyle(wxBackgroundStyle style);
4849f027
SC
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
03647350 155 void GetContentArea( int &left , int &top , int &width , int &height ) const;
4849f027 156 bool SetShape(const wxRegion& region);
03647350 157
4849f027 158 virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) ;
03647350 159
4849f027 160 virtual bool IsMaximized() const;
03647350 161
4849f027 162 virtual bool IsIconized() const;
03647350 163
4849f027 164 virtual void Iconize( bool iconize );
03647350 165
4849f027 166 virtual void Maximize(bool maximize);
03647350 167
4849f027 168 virtual bool IsFullScreen() const;
03647350 169
4849f027
SC
170 virtual bool ShowFullScreen(bool show, long style);
171
172 virtual void RequestUserAttention(int flags);
03647350 173
4849f027 174 virtual void ScreenToWindow( int *x, int *y );
03647350 175
4849f027 176 virtual void WindowToScreen( int *x, int *y );
03647350 177
dbc7ceb9
KO
178 // FIXME: Does iPhone have a concept of inactive windows?
179 virtual bool IsActive() { return true; }
ce00f59b 180
4849f027 181 wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
878357d8
SC
182
183 virtual bool InitialShowEventSent() { return m_initialShowSent; }
4849f027
SC
184protected :
185 WX_UIWindow m_macWindow;
186 void * m_macFullScreenData ;
878357d8 187 bool m_initialShowSent;
4849f027 188 DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowIPhoneImpl)
03647350 189};
4849f027 190
d3929256
SC
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 );
03647350
VZ
197
198 CGRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
d3929256
SC
199 bool adjustForOrigin = true );
200
201 @interface wxUIButton : UIButton
202 {
203 }
03647350 204
d3929256
SC
205 @end
206
98040646
SC
207 @interface wxUIView : UIView
208 {
209 }
210
211 @end // wxUIView
212
719ddf1e 213
d3929256
SC
214 void WXDLLIMPEXP_CORE wxOSXIPhoneClassAddWXMethods(Class c);
215
216#endif
217
4849f027
SC
218#endif // wxUSE_GUI
219
220#endif
221 // _WX_PRIVATE_IPHONE_H_