]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/iphone/private.h
implementing rollover and pressed image for bitmapbutton on osx_cocoa
[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
17#include "wx/osx/core/private.h"
18
19#ifdef __OBJC__
20 #import <UIKit/UIKit.h>
21#endif
22
23#if wxUSE_GUI
24
d3929256
SC
25OSStatus WXDLLIMPEXP_CORE wxMacDrawCGImage(
26 CGContextRef inContext,
27 const CGRect * inBounds,
28 CGImageRef inImage) ;
29
30WX_UIImage WXDLLIMPEXP_CORE wxOSXCreateUIImageFromCGImage( CGImageRef image );
31
4849f027
SC
32class WXDLLIMPEXP_CORE wxWidgetIPhoneImpl : public wxWidgetImpl
33{
34public :
03647350
VZ
35 wxWidgetIPhoneImpl( wxWindowMac* peer , WXWidget w, bool isRootControl = false ) ;
36 wxWidgetIPhoneImpl() ;
37 ~wxWidgetIPhoneImpl();
38
4849f027 39 void Init();
03647350 40
4849f027
SC
41 virtual bool IsVisible() const ;
42 virtual void SetVisibility( bool visible );
03647350 43
4849f027 44 virtual void Raise();
03647350 45
4849f027
SC
46 virtual void Lower();
47
48 virtual void ScrollRect( const wxRect *rect, int dx, int dy );
49
50 virtual WXWidget GetWXWidget() const { return m_osxView; }
51
52 virtual void SetBackgroundColour( const wxColour& col ) ;
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
d3929256
SC
113 virtual void touchUpInsideAction(void* sender, WX_UIEvent evt, WXWidget slf, void* _cmd);
114
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
4849f027
SC
128 virtual void Destroy() ;
129 void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
130 long style, long extraStyle, const wxString& name ) ;
03647350 131
4849f027 132 WXWindow GetWXWindow() const;
03647350 133 void Raise();
4849f027 134 void Lower();
03647350 135 bool Show(bool show);
4849f027 136 bool ShowWithEffect(bool show, wxShowEffect effect, unsigned timeout);
03647350 137
4849f027
SC
138 void Update();
139 bool SetTransparent(wxByte alpha);
140 bool SetBackgroundColour(const wxColour& col );
03647350
VZ
141 void SetExtraStyle( long exStyle );
142 bool SetBackgroundStyle(wxBackgroundStyle style);
4849f027
SC
143 bool CanSetTransparent();
144
145 void MoveWindow(int x, int y, int width, int height);
146 void GetPosition( int &x, int &y ) const;
147 void GetSize( int &width, int &height ) const;
148
03647350 149 void GetContentArea( int &left , int &top , int &width , int &height ) const;
4849f027 150 bool SetShape(const wxRegion& region);
03647350 151
4849f027 152 virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) ;
03647350 153
4849f027 154 virtual bool IsMaximized() const;
03647350 155
4849f027 156 virtual bool IsIconized() const;
03647350 157
4849f027 158 virtual void Iconize( bool iconize );
03647350 159
4849f027 160 virtual void Maximize(bool maximize);
03647350 161
4849f027 162 virtual bool IsFullScreen() const;
03647350 163
4849f027
SC
164 virtual bool ShowFullScreen(bool show, long style);
165
166 virtual void RequestUserAttention(int flags);
03647350 167
4849f027 168 virtual void ScreenToWindow( int *x, int *y );
03647350 169
4849f027 170 virtual void WindowToScreen( int *x, int *y );
03647350 171
4849f027
SC
172 wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
173protected :
174 WX_UIWindow m_macWindow;
175 void * m_macFullScreenData ;
176 DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowIPhoneImpl)
03647350 177};
4849f027 178
d3929256
SC
179#ifdef __OBJC__
180
181 WXDLLIMPEXP_CORE CGRect wxToNSRect( UIView* parent, const wxRect& r );
182 WXDLLIMPEXP_CORE wxRect wxFromNSRect( UIView* parent, const CGRect& rect );
183 WXDLLIMPEXP_CORE CGPoint wxToNSPoint( UIView* parent, const wxPoint& p );
184 WXDLLIMPEXP_CORE wxPoint wxFromNSPoint( UIView* parent, const CGPoint& p );
03647350
VZ
185
186 CGRect WXDLLIMPEXP_CORE wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const wxSize &size ,
d3929256
SC
187 bool adjustForOrigin = true );
188
189 @interface wxUIButton : UIButton
190 {
191 }
03647350 192
d3929256
SC
193 @end
194
195 void WXDLLIMPEXP_CORE wxOSXIPhoneClassAddWXMethods(Class c);
196
197#endif
198
4849f027
SC
199#endif // wxUSE_GUI
200
201#endif
202 // _WX_PRIVATE_IPHONE_H_