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