]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/core/private.h
Revert a workaround for Windows native border side-effect since latter is now fixed
[wxWidgets.git] / include / wx / osx / core / private.h
CommitLineData
5c6eb3a8 1/////////////////////////////////////////////////////////////////////////////
eefe52da 2// Name: wx/osx/core/private.h
5c6eb3a8
SC
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
eefe52da
SC
14#ifndef _WX_PRIVATE_CORE_H_
15#define _WX_PRIVATE_CORE_H_
5c6eb3a8
SC
16
17#include "wx/defs.h"
18
19#include <CoreFoundation/CoreFoundation.h>
20
ef0e9220
SC
21#include "wx/osx/core/cfstring.h"
22#include "wx/osx/core/cfdataref.h"
5c6eb3a8 23
524c47aa 24#if wxOSX_USE_COCOA_OR_CARBON
1e181c7a 25
524c47aa 26WXDLLIMPEXP_BASE long UMAGetSystemVersion() ;
1e181c7a
SC
27
28void WXDLLIMPEXP_CORE wxMacStringToPascal( const wxString&from , unsigned char * to );
29wxString WXDLLIMPEXP_CORE wxMacMakeStringFromPascal( const unsigned char * from );
30
524c47aa
SC
31#endif
32
5c6eb3a8
SC
33#if wxUSE_GUI
34
eefe52da 35#if wxOSX_USE_IPHONE
5c6eb3a8 36#include <CoreGraphics/CoreGraphics.h>
eefe52da 37#else
09f0f2cf 38#include <ApplicationServices/ApplicationServices.h>
eefe52da
SC
39#endif
40
41#include "wx/bitmap.h"
42#include "wx/window.h"
5c6eb3a8
SC
43
44class WXDLLIMPEXP_CORE wxMacCGContextStateSaver
45{
c0c133e1 46 wxDECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver);
5c6eb3a8
SC
47
48public:
49 wxMacCGContextStateSaver( CGContextRef cg )
50 {
51 m_cg = cg;
52 CGContextSaveGState( cg );
53 }
54 ~wxMacCGContextStateSaver()
55 {
56 CGContextRestoreGState( m_cg );
57 }
58private:
59 CGContextRef m_cg;
60};
61
eefe52da
SC
62class WXDLLIMPEXP_CORE wxDeferredObjectDeleter : public wxObject
63{
64public :
03647350 65 wxDeferredObjectDeleter( wxObject* obj ) : m_obj(obj)
eefe52da
SC
66 {
67 }
68 virtual ~wxDeferredObjectDeleter()
69 {
70 delete m_obj;
71 }
72protected :
73 wxObject* m_obj ;
74} ;
5c6eb3a8
SC
75
76// Quartz
77
78WXDLLIMPEXP_CORE CGImageRef wxMacCreateCGImageFromBitmap( const wxBitmap& bitmap );
79
80WXDLLIMPEXP_CORE CGDataProviderRef wxMacCGDataProviderCreateWithCFData( CFDataRef data );
81WXDLLIMPEXP_CORE CGDataConsumerRef wxMacCGDataConsumerCreateWithCFData( CFMutableDataRef data );
82WXDLLIMPEXP_CORE CGDataProviderRef wxMacCGDataProviderCreateWithMemoryBuffer( const wxMemoryBuffer& buf );
83
84CGColorSpaceRef WXDLLIMPEXP_CORE wxMacGetGenericRGBColorSpace(void);
85
eefe52da
SC
86class wxWindowMac;
87// to
88extern wxWindow* g_MacLastWindow;
89class wxNonOwnedWindow;
90
524c47aa
SC
91// temporary typedef so that no additional casts are necessary within carbon code at the moment
92
93class wxMacControl;
94class wxWidgetImpl;
95class wxNotebook;
de24bdf2 96class wxTextCtrl;
524c47aa 97
8fa9ac5e
SC
98WXDLLIMPEXP_CORE wxWindowMac * wxFindWindowFromWXWidget(WXWidget inControl );
99
524c47aa
SC
100#if wxOSX_USE_CARBON
101typedef wxMacControl wxWidgetImplType;
102#else
103typedef wxWidgetImpl wxWidgetImplType;
104#endif
105
6c1f25cc 106#if wxUSE_MENUS
03647350 107class wxMenuItemImpl : public wxObject
524c47aa
SC
108{
109public :
110 wxMenuItemImpl( wxMenuItem* peer ) : m_peer(peer)
111 {
112 }
03647350 113
524c47aa
SC
114 virtual ~wxMenuItemImpl() ;
115 virtual void SetBitmap( const wxBitmap& bitmap ) = 0;
116 virtual void Enable( bool enable ) = 0;
117 virtual void Check( bool check ) = 0;
118 virtual void SetLabel( const wxString& text, wxAcceleratorEntry *entry ) = 0;
119 virtual void Hide( bool hide = true ) = 0;
03647350 120
524c47aa
SC
121 virtual void * GetHMenuItem() = 0;
122
123 wxMenuItem* GetWXPeer() { return m_peer ; }
124
125 static wxMenuItemImpl* Create( wxMenuItem* peer, wxMenu *pParentMenu,
126 int id,
127 const wxString& text,
128 wxAcceleratorEntry *entry,
129 const wxString& strHelp,
130 wxItemKind kind,
131 wxMenu *pSubMenu );
132
133protected :
134 wxMenuItem* m_peer;
03647350 135
69cc4323 136 DECLARE_ABSTRACT_CLASS(wxMenuItemImpl)
524c47aa
SC
137} ;
138
03647350 139class wxMenuImpl : public wxObject
524c47aa
SC
140{
141public :
142 wxMenuImpl( wxMenu* peer ) : m_peer(peer)
143 {
144 }
03647350
VZ
145
146 virtual ~wxMenuImpl() ;
147 virtual void InsertOrAppend(wxMenuItem *pItem, size_t pos) = 0;
524c47aa 148 virtual void Remove( wxMenuItem *pItem ) = 0;
03647350 149
524c47aa
SC
150 virtual void MakeRoot() = 0;
151
152 virtual void SetTitle( const wxString& text ) = 0;
153
154 virtual WXHMENU GetHMenu() = 0;
03647350 155
524c47aa
SC
156 wxMenu* GetWXPeer() { return m_peer ; }
157
2cb5d2d2
SC
158 virtual void PopUp( wxWindow *win, int x, int y ) = 0;
159
524c47aa
SC
160 static wxMenuImpl* Create( wxMenu* peer, const wxString& title );
161 static wxMenuImpl* CreateRootMenu( wxMenu* peer );
162protected :
163 wxMenu* m_peer;
03647350 164
69cc4323 165 DECLARE_ABSTRACT_CLASS(wxMenuItemImpl)
524c47aa 166} ;
6c1f25cc 167#endif
524c47aa
SC
168
169
eefe52da
SC
170class WXDLLIMPEXP_CORE wxWidgetImpl : public wxObject
171{
172public :
173 wxWidgetImpl( wxWindowMac* peer , bool isRootControl = false );
174 wxWidgetImpl();
175 virtual ~wxWidgetImpl();
176
177 void Init();
178
eefe52da
SC
179 bool IsRootControl() const { return m_isRootControl; }
180
181 wxWindowMac* GetWXPeer() const { return m_wxPeer; }
03647350 182
eefe52da
SC
183 bool IsOk() const { return GetWXWidget() != NULL; }
184
185 // not only the control itself, but also all its parents must be visible
186 // in order for this function to return true
187 virtual bool IsVisible() const = 0;
188 // set the visibility of this widget (maybe latent)
189 virtual void SetVisibility( bool visible ) = 0;
190
ab9a0b84
VZ
191 virtual bool ShowWithEffect(bool WXUNUSED(show),
192 wxShowEffect WXUNUSED(effect),
193 unsigned WXUNUSED(timeout))
194 {
195 return false;
196 }
197
eefe52da 198 virtual void Raise() = 0;
03647350 199
eefe52da
SC
200 virtual void Lower() = 0;
201
202 virtual void ScrollRect( const wxRect *rect, int dx, int dy ) = 0;
203
204 virtual WXWidget GetWXWidget() const = 0;
03647350 205
eefe52da
SC
206 virtual void SetBackgroundColour( const wxColour& col ) = 0;
207
208 // all coordinates in native parent widget relative coordinates
209 virtual void GetContentArea( int &left , int &top , int &width , int &height ) const = 0;
210 virtual void Move(int x, int y, int width, int height) = 0;
211 virtual void GetPosition( int &x, int &y ) const = 0;
212 virtual void GetSize( int &width, int &height ) const = 0;
524c47aa 213 virtual void SetControlSize( wxWindowVariant variant ) = 0;
eefe52da 214
ee032c59
SC
215 // native view coordinates are topleft to bottom right (flipped regarding CoreGraphics origin)
216 virtual bool IsFlipped() const { return true; }
217
eefe52da
SC
218 virtual void SetNeedsDisplay( const wxRect* where = NULL ) = 0;
219 virtual bool GetNeedsDisplay() const = 0;
220
221 virtual bool NeedsFocusRect() const;
222 virtual void SetNeedsFocusRect( bool needs );
223
f2f6030e
SC
224 virtual bool NeedsFrame() const;
225 virtual void SetNeedsFrame( bool needs );
226
eefe52da
SC
227 virtual bool CanFocus() const = 0;
228 // return true if successful
229 virtual bool SetFocus() = 0;
230 virtual bool HasFocus() const = 0;
03647350 231
eefe52da
SC
232 virtual void RemoveFromParent() = 0;
233 virtual void Embed( wxWidgetImpl *parent ) = 0;
03647350 234
524c47aa
SC
235 virtual void SetDefaultButton( bool isDefault ) = 0;
236 virtual void PerformClick() = 0;
237 virtual void SetLabel( const wxString& title, wxFontEncoding encoding ) = 0;
238
54f11060
SC
239 virtual void SetCursor( const wxCursor & cursor ) = 0;
240 virtual void CaptureMouse() = 0;
241 virtual void ReleaseMouse() = 0;
242
524c47aa
SC
243 virtual wxInt32 GetValue() const = 0;
244 virtual void SetValue( wxInt32 v ) = 0;
e5d05b90 245 virtual wxBitmap GetBitmap() const = 0;
524c47aa 246 virtual void SetBitmap( const wxBitmap& bitmap ) = 0;
e5d05b90 247 virtual void SetBitmapPosition( wxDirection dir ) = 0;
524c47aa
SC
248 virtual void SetupTabs( const wxNotebook &notebook ) =0;
249 virtual void GetBestRect( wxRect *r ) const = 0;
250 virtual bool IsEnabled() const = 0;
251 virtual void Enable( bool enable ) = 0;
252 virtual void SetMinimum( wxInt32 v ) = 0;
253 virtual void SetMaximum( wxInt32 v ) = 0;
19c7ac3d
SC
254 virtual wxInt32 GetMinimum() const = 0;
255 virtual wxInt32 GetMaximum() const = 0;
524c47aa
SC
256 virtual void PulseGauge() = 0;
257 virtual void SetScrollThumb( wxInt32 value, wxInt32 thumbSize ) = 0;
258
1e181c7a
SC
259 virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ) = 0;
260
524c47aa
SC
261 // is the clicked event sent AFTER the state already changed, so no additional
262 // state changing logic is required from the outside
263 virtual bool ButtonClickDidStateChange() = 0;
03647350 264
c4825ef7 265 virtual void InstallEventHandler( WXWidget control = NULL ) = 0;
eefe52da 266
f55d9f74
SC
267 // static methods for associating native controls and their implementations
268
03647350 269 static wxWidgetImpl*
f55d9f74 270 FindFromWXWidget(WXWidget control);
03647350 271
f55d9f74 272 static void RemoveAssociations( wxWidgetImpl* impl);
03647350 273
f55d9f74 274 static void Associate( WXWidget control, wxWidgetImpl *impl );
03647350 275
f06e0fea 276 static WXWidget FindFocus();
03647350 277
eefe52da 278 // static creation methods, must be implemented by all toolkits
03647350
VZ
279
280 static wxWidgetImplType* CreateUserPane( wxWindowMac* wxpeer,
281 wxWindowMac* parent,
282 wxWindowID id,
283 const wxPoint& pos,
524c47aa 284 const wxSize& size,
03647350 285 long style,
524c47aa
SC
286 long extraStyle) ;
287 static wxWidgetImplType* CreateContentView( wxNonOwnedWindow* now ) ;
288
03647350
VZ
289 static wxWidgetImplType* CreateButton( wxWindowMac* wxpeer,
290 wxWindowMac* parent,
291 wxWindowID id,
524c47aa 292 const wxString& label,
03647350 293 const wxPoint& pos,
524c47aa 294 const wxSize& size,
03647350 295 long style,
524c47aa
SC
296 long extraStyle) ;
297
03647350
VZ
298 static wxWidgetImplType* CreateDisclosureTriangle( wxWindowMac* wxpeer,
299 wxWindowMac* parent,
300 wxWindowID id,
524c47aa 301 const wxString& label,
03647350 302 const wxPoint& pos,
524c47aa 303 const wxSize& size,
03647350 304 long style,
524c47aa 305 long extraStyle) ;
03647350
VZ
306
307 static wxWidgetImplType* CreateStaticLine( wxWindowMac* wxpeer,
308 wxWindowMac* parent,
309 wxWindowID id,
310 const wxPoint& pos,
524c47aa 311 const wxSize& size,
03647350 312 long style,
524c47aa
SC
313 long extraStyle) ;
314
03647350
VZ
315 static wxWidgetImplType* CreateGroupBox( wxWindowMac* wxpeer,
316 wxWindowMac* parent,
317 wxWindowID id,
524c47aa 318 const wxString& label,
03647350 319 const wxPoint& pos,
524c47aa 320 const wxSize& size,
03647350 321 long style,
524c47aa
SC
322 long extraStyle) ;
323
03647350
VZ
324 static wxWidgetImplType* CreateStaticText( wxWindowMac* wxpeer,
325 wxWindowMac* parent,
326 wxWindowID id,
524c47aa 327 const wxString& label,
03647350 328 const wxPoint& pos,
524c47aa 329 const wxSize& size,
03647350 330 long style,
524c47aa
SC
331 long extraStyle) ;
332
03647350
VZ
333 static wxWidgetImplType* CreateTextControl( wxTextCtrl* wxpeer,
334 wxWindowMac* parent,
335 wxWindowID id,
524c47aa 336 const wxString& content,
03647350 337 const wxPoint& pos,
524c47aa 338 const wxSize& size,
03647350 339 long style,
524c47aa
SC
340 long extraStyle) ;
341
03647350
VZ
342 static wxWidgetImplType* CreateSearchControl( wxTextCtrl* wxpeer,
343 wxWindowMac* parent,
344 wxWindowID id,
1e181c7a 345 const wxString& content,
03647350 346 const wxPoint& pos,
1e181c7a 347 const wxSize& size,
03647350 348 long style,
1e181c7a
SC
349 long extraStyle) ;
350
03647350
VZ
351 static wxWidgetImplType* CreateCheckBox( wxWindowMac* wxpeer,
352 wxWindowMac* parent,
353 wxWindowID id,
524c47aa 354 const wxString& label,
03647350 355 const wxPoint& pos,
524c47aa 356 const wxSize& size,
03647350 357 long style,
524c47aa 358 long extraStyle);
03647350
VZ
359
360 static wxWidgetImplType* CreateRadioButton( wxWindowMac* wxpeer,
361 wxWindowMac* parent,
362 wxWindowID id,
524c47aa 363 const wxString& label,
03647350 364 const wxPoint& pos,
524c47aa 365 const wxSize& size,
03647350 366 long style,
524c47aa
SC
367 long extraStyle);
368
03647350
VZ
369 static wxWidgetImplType* CreateToggleButton( wxWindowMac* wxpeer,
370 wxWindowMac* parent,
371 wxWindowID id,
524c47aa 372 const wxString& label,
03647350 373 const wxPoint& pos,
524c47aa 374 const wxSize& size,
03647350 375 long style,
524c47aa
SC
376 long extraStyle);
377
03647350
VZ
378 static wxWidgetImplType* CreateBitmapToggleButton( wxWindowMac* wxpeer,
379 wxWindowMac* parent,
380 wxWindowID id,
524c47aa 381 const wxBitmap& bitmap,
03647350 382 const wxPoint& pos,
524c47aa 383 const wxSize& size,
03647350 384 long style,
524c47aa
SC
385 long extraStyle);
386
03647350
VZ
387 static wxWidgetImplType* CreateBitmapButton( wxWindowMac* wxpeer,
388 wxWindowMac* parent,
389 wxWindowID id,
524c47aa 390 const wxBitmap& bitmap,
03647350 391 const wxPoint& pos,
524c47aa 392 const wxSize& size,
03647350 393 long style,
524c47aa
SC
394 long extraStyle);
395
03647350
VZ
396 static wxWidgetImplType* CreateTabView( wxWindowMac* wxpeer,
397 wxWindowMac* parent,
398 wxWindowID id,
399 const wxPoint& pos,
524c47aa 400 const wxSize& size,
03647350 401 long style,
524c47aa
SC
402 long extraStyle);
403
03647350
VZ
404 static wxWidgetImplType* CreateGauge( wxWindowMac* wxpeer,
405 wxWindowMac* parent,
406 wxWindowID id,
524c47aa
SC
407 wxInt32 value,
408 wxInt32 minimum,
409 wxInt32 maximum,
03647350 410 const wxPoint& pos,
524c47aa 411 const wxSize& size,
03647350 412 long style,
524c47aa
SC
413 long extraStyle);
414
03647350
VZ
415 static wxWidgetImplType* CreateSlider( wxWindowMac* wxpeer,
416 wxWindowMac* parent,
417 wxWindowID id,
524c47aa
SC
418 wxInt32 value,
419 wxInt32 minimum,
420 wxInt32 maximum,
03647350 421 const wxPoint& pos,
524c47aa 422 const wxSize& size,
03647350 423 long style,
524c47aa
SC
424 long extraStyle);
425
03647350
VZ
426 static wxWidgetImplType* CreateSpinButton( wxWindowMac* wxpeer,
427 wxWindowMac* parent,
428 wxWindowID id,
524c47aa
SC
429 wxInt32 value,
430 wxInt32 minimum,
431 wxInt32 maximum,
03647350 432 const wxPoint& pos,
524c47aa 433 const wxSize& size,
03647350 434 long style,
524c47aa
SC
435 long extraStyle);
436
03647350
VZ
437 static wxWidgetImplType* CreateScrollBar( wxWindowMac* wxpeer,
438 wxWindowMac* parent,
439 wxWindowID id,
440 const wxPoint& pos,
524c47aa 441 const wxSize& size,
03647350 442 long style,
524c47aa
SC
443 long extraStyle);
444
03647350
VZ
445 static wxWidgetImplType* CreateChoice( wxWindowMac* wxpeer,
446 wxWindowMac* parent,
447 wxWindowID id,
524c47aa 448 wxMenu* menu,
03647350 449 const wxPoint& pos,
524c47aa 450 const wxSize& size,
03647350 451 long style,
524c47aa
SC
452 long extraStyle);
453
03647350
VZ
454 static wxWidgetImplType* CreateListBox( wxWindowMac* wxpeer,
455 wxWindowMac* parent,
456 wxWindowID id,
457 const wxPoint& pos,
524c47aa 458 const wxSize& size,
03647350 459 long style,
524c47aa 460 long extraStyle);
eefe52da
SC
461
462 // converts from Toplevel-Content relative to local
463 static void Convert( wxPoint *pt , wxWidgetImpl *from , wxWidgetImpl *to );
464protected :
465 bool m_isRootControl;
466 wxWindowMac* m_wxPeer;
467 bool m_needsFocusRect;
f2f6030e 468 bool m_needsFrame;
eefe52da
SC
469
470 DECLARE_ABSTRACT_CLASS(wxWidgetImpl)
471};
472
524c47aa
SC
473//
474// the interface to be implemented eg by a listbox
475//
476
03647350 477class WXDLLIMPEXP_CORE wxListWidgetColumn
524c47aa
SC
478{
479public :
480 virtual ~wxListWidgetColumn() {}
481} ;
482
483class WXDLLIMPEXP_CORE wxListWidgetCellValue
484{
485public :
486 wxListWidgetCellValue() {}
487 virtual ~wxListWidgetCellValue() {}
03647350 488
524c47aa
SC
489 virtual void Set( CFStringRef value ) = 0;
490 virtual void Set( const wxString& value ) = 0;
491 virtual void Set( int value ) = 0;
60ebcb8a 492 virtual void Check( bool check );
03647350 493
60ebcb8a 494 virtual bool IsChecked() const;
524c47aa
SC
495 virtual int GetIntValue() const = 0;
496 virtual wxString GetStringValue() const = 0;
497} ;
498
499class WXDLLIMPEXP_CORE wxListWidgetImpl
500{
501public:
502 wxListWidgetImpl() {}
503 virtual ~wxListWidgetImpl() { }
03647350
VZ
504
505 virtual wxListWidgetColumn* InsertTextColumn( unsigned pos, const wxString& title, bool editable = false,
524c47aa 506 wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) = 0 ;
03647350 507 virtual wxListWidgetColumn* InsertCheckColumn( unsigned pos , const wxString& title, bool editable = false,
524c47aa 508 wxAlignment just = wxALIGN_LEFT , int defaultWidth = -1) = 0 ;
03647350 509
524c47aa
SC
510 // add and remove
511
512 // TODO will be replaced
513 virtual void ListDelete( unsigned int n ) = 0;
514 virtual void ListInsert( unsigned int n ) = 0;
515 virtual void ListClear() = 0;
516
517 // selecting
518
519 virtual void ListDeselectAll() = 0;
520 virtual void ListSetSelection( unsigned int n, bool select, bool multi ) = 0;
521 virtual int ListGetSelection() const = 0;
522 virtual int ListGetSelections( wxArrayInt& aSelections ) const = 0;
523 virtual bool ListIsSelected( unsigned int n ) const = 0;
03647350 524
524c47aa
SC
525 // display
526
527 virtual void ListScrollTo( unsigned int n ) = 0;
528 virtual void UpdateLine( unsigned int n, wxListWidgetColumn* col = NULL ) = 0;
529 virtual void UpdateLineToEnd( unsigned int n) = 0;
530
531 // accessing content
532
533 virtual unsigned int ListGetCount() const = 0;
534};
535
1e181c7a
SC
536//
537// interface to be implemented by a textcontrol
538//
539
21a9d326
SC
540class WXDLLIMPEXP_FWD_CORE wxTextAttr;
541
1e181c7a
SC
542// common interface for all implementations
543class WXDLLIMPEXP_CORE wxTextWidgetImpl
544
545{
546public :
547 wxTextWidgetImpl() {}
548
549 virtual ~wxTextWidgetImpl() {}
550
551 virtual bool CanFocus() const { return true; }
552
553 virtual wxString GetStringValue() const = 0 ;
554 virtual void SetStringValue( const wxString &val ) = 0 ;
555 virtual void SetSelection( long from, long to ) = 0 ;
556 virtual void GetSelection( long* from, long* to ) const = 0 ;
557 virtual void WriteText( const wxString& str ) = 0 ;
558
559 virtual void SetStyle( long start, long end, const wxTextAttr& style ) ;
560 virtual void Copy() ;
561 virtual void Cut() ;
562 virtual void Paste() ;
563 virtual bool CanPaste() const ;
564 virtual void SetEditable( bool editable ) ;
0b6a49c2 565 virtual long GetLastPosition() const ;
1e181c7a
SC
566 virtual void Replace( long from, long to, const wxString &str ) ;
567 virtual void Remove( long from, long to ) ;
568
569
570 virtual bool HasOwnContextMenu() const
571 { return false ; }
572
573 virtual bool SetupCursor( const wxPoint& WXUNUSED(pt) )
574 { return false ; }
575
576 virtual void Clear() ;
577 virtual bool CanUndo() const;
578 virtual void Undo() ;
579 virtual bool CanRedo() const;
580 virtual void Redo() ;
581 virtual int GetNumberOfLines() const ;
582 virtual long XYToPosition(long x, long y) const;
583 virtual bool PositionToXY(long pos, long *x, long *y) const ;
584 virtual void ShowPosition(long WXUNUSED(pos)) ;
585 virtual int GetLineLength(long lineNo) const ;
586 virtual wxString GetLineText(long lineNo) const ;
587 virtual void CheckSpelling(bool WXUNUSED(check)) { }
588};
589
411a1c35
SC
590//
591// common interface bitmapbuttons
592//
593
594class wxBitmapButtonImpl
595{
596 public :
597 wxBitmapButtonImpl(){}
598 virtual ~wxBitmapButtonImpl(){}
599
600 virtual void SetPressedBitmap( const wxBitmap& bitmap ) = 0;
601} ;
602
1e181c7a
SC
603//
604// common interface for search controls
605//
606
607class wxSearchWidgetImpl
608{
609public :
610 wxSearchWidgetImpl(){}
611 virtual ~wxSearchWidgetImpl(){}
612
613 // search field options
614 virtual void ShowSearchButton( bool show ) = 0;
615 virtual bool IsSearchButtonVisible() const = 0;
616
617 virtual void ShowCancelButton( bool show ) = 0;
618 virtual bool IsCancelButtonVisible() const = 0;
619
620 virtual void SetSearchMenu( wxMenu* menu ) = 0;
621
622 virtual void SetDescriptiveText(const wxString& text) = 0;
623} ;
624
524c47aa
SC
625//
626// toplevel window implementation class
627//
628
eefe52da
SC
629class wxNonOwnedWindowImpl : public wxObject
630{
631public :
632 wxNonOwnedWindowImpl( wxNonOwnedWindow* nonownedwnd) : m_wxPeer(nonownedwnd)
633 {
634 }
635 wxNonOwnedWindowImpl()
636 {
637 }
638 virtual ~wxNonOwnedWindowImpl()
639 {
640 }
03647350
VZ
641
642 virtual void Destroy()
eefe52da
SC
643 {
644 }
645
646 virtual void Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
647 long style, long extraStyle, const wxString& name ) = 0;
03647350
VZ
648
649
eefe52da 650 virtual WXWindow GetWXWindow() const = 0;
03647350 651
eefe52da
SC
652 virtual void Raise()
653 {
654 }
03647350 655
eefe52da
SC
656 virtual void Lower()
657 {
658 }
659
1aec1f8b 660 virtual bool Show(bool WXUNUSED(show))
eefe52da
SC
661 {
662 return false;
663 }
03647350 664
1aec1f8b 665 virtual bool ShowWithEffect(bool show, wxShowEffect WXUNUSED(effect), unsigned WXUNUSED(timeout))
eefe52da
SC
666 {
667 return Show(show);
668 }
03647350 669
eefe52da
SC
670 virtual void Update()
671 {
672 }
673
1aec1f8b 674 virtual bool SetTransparent(wxByte WXUNUSED(alpha))
eefe52da
SC
675 {
676 return false;
677 }
678
1aec1f8b 679 virtual bool SetBackgroundColour(const wxColour& WXUNUSED(col) )
eefe52da
SC
680 {
681 return false;
682 }
683
1aec1f8b 684 virtual void SetExtraStyle( long WXUNUSED(exStyle) )
eefe52da
SC
685 {
686 }
03647350 687
1aec1f8b 688 virtual bool SetBackgroundStyle(wxBackgroundStyle WXUNUSED(style))
03647350 689 {
eefe52da
SC
690 return false ;
691 }
03647350 692
eefe52da
SC
693 bool CanSetTransparent()
694 {
695 return false;
696 }
697
03647350 698 virtual void GetContentArea( int &left , int &top , int &width , int &height ) const = 0;
eefe52da
SC
699 virtual void MoveWindow(int x, int y, int width, int height) = 0;
700 virtual void GetPosition( int &x, int &y ) const = 0;
701 virtual void GetSize( int &width, int &height ) const = 0;
702
1aec1f8b 703 virtual bool SetShape(const wxRegion& WXUNUSED(region))
eefe52da
SC
704 {
705 return false;
706 }
03647350 707
eefe52da 708 virtual void SetTitle( const wxString& title, wxFontEncoding encoding ) = 0;
03647350 709
eefe52da 710 virtual bool IsMaximized() const = 0;
03647350 711
eefe52da 712 virtual bool IsIconized() const= 0;
03647350 713
eefe52da 714 virtual void Iconize( bool iconize )= 0;
03647350 715
eefe52da 716 virtual void Maximize(bool maximize) = 0;
03647350 717
eefe52da 718 virtual bool IsFullScreen() const= 0;
03647350 719
eefe52da
SC
720 virtual bool ShowFullScreen(bool show, long style)= 0;
721
722 virtual void RequestUserAttention(int flags) = 0;
03647350
VZ
723
724 virtual void ScreenToWindow( int *x, int *y ) = 0;
725
eefe52da 726 virtual void WindowToScreen( int *x, int *y ) = 0;
03647350 727
eefe52da 728 wxNonOwnedWindow* GetWXPeer() { return m_wxPeer; }
03647350 729
524c47aa 730 // static creation methods, must be implemented by all toolkits
03647350 731
524c47aa
SC
732 static wxNonOwnedWindowImpl* CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
733 long style, long extraStyle, const wxString& name ) ;
734
eefe52da
SC
735protected :
736 wxNonOwnedWindow* m_wxPeer;
737 DECLARE_ABSTRACT_CLASS(wxNonOwnedWindowImpl)
738};
739
5c6eb3a8
SC
740#endif // wxUSE_GUI
741
742//---------------------------------------------------------------------------
743// cocoa bridging utilities
744//---------------------------------------------------------------------------
745
746bool wxMacInitCocoa();
747
748class WXDLLIMPEXP_CORE wxMacAutoreleasePool
749{
750public :
751 wxMacAutoreleasePool();
752 ~wxMacAutoreleasePool();
753private :
754 void* m_pool;
755};
756
757// NSObject
758
759void wxMacCocoaRelease( void* obj );
760void wxMacCocoaAutorelease( void* obj );
f1c40652 761void* wxMacCocoaRetain( void* obj );
5c6eb3a8
SC
762
763
764#endif
eefe52da 765 // _WX_PRIVATE_CORE_H_