| 1 | /////////////////////////////////////////////////////////////////////////////// |
| 2 | // Name: wx/cocoa/NSWindow.h |
| 3 | // Purpose: wxCocoaNSWindow class |
| 4 | // Author: David Elliott |
| 5 | // Modified by: |
| 6 | // Created: 2003/03/16 |
| 7 | // RCS-ID: $Id$ |
| 8 | // Copyright: (c) 2003 David Elliott |
| 9 | // Licence: wxWindows licence |
| 10 | /////////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | #ifndef __WX_COCOA_NSWINDOW_H__ |
| 13 | #define __WX_COCOA_NSWINDOW_H__ |
| 14 | |
| 15 | #include "wx/hashmap.h" |
| 16 | #include "wx/cocoa/ObjcAssociate.h" |
| 17 | |
| 18 | WX_DECLARE_OBJC_HASHMAP(NSWindow); |
| 19 | |
| 20 | class WXDLLIMPEXP_FWD_CORE wxMenuBar; |
| 21 | class WXDLLIMPEXP_FWD_CORE wxTopLevelWindowCocoa; |
| 22 | |
| 23 | DECLARE_WXCOCOA_OBJC_CLASS(NSMenuItem); |
| 24 | DECLARE_WXCOCOA_OBJC_CLASS(wxNSWindowDelegate); |
| 25 | |
| 26 | class WXDLLIMPEXP_CORE wxCocoaNSWindow |
| 27 | { |
| 28 | /* NSWindow is a rather special case and requires some extra attention */ |
| 29 | WX_DECLARE_OBJC_INTERFACE_HASHMAP(NSWindow) |
| 30 | public: |
| 31 | void AssociateNSWindow(WX_NSWindow cocoaNSWindow); |
| 32 | void DisassociateNSWindow(WX_NSWindow cocoaNSWindow); |
| 33 | virtual bool Cocoa_canBecomeKeyWindow(bool &WXUNUSED(canBecome)) |
| 34 | { return false; } |
| 35 | virtual bool Cocoa_canBecomeMainWindow(bool &WXUNUSED(canBecome)) |
| 36 | { return false; } |
| 37 | virtual bool CocoaDelegate_windowShouldClose(void) = 0; |
| 38 | virtual void CocoaDelegate_windowWillClose(void) = 0; |
| 39 | virtual void CocoaDelegate_windowDidBecomeKey(void) { } |
| 40 | virtual void CocoaDelegate_windowDidResignKey(void) { } |
| 41 | virtual void CocoaDelegate_windowDidBecomeMain(void) { } |
| 42 | virtual void CocoaDelegate_windowDidResignMain(void) { } |
| 43 | virtual void CocoaDelegate_wxMenuItemAction(WX_NSMenuItem menuItem) = 0; |
| 44 | virtual bool CocoaDelegate_validateMenuItem(WX_NSMenuItem menuItem) = 0; |
| 45 | virtual wxMenuBar* GetAppMenuBar(wxCocoaNSWindow *win); |
| 46 | inline wxTopLevelWindowCocoa* GetWxTopLevelWindowCocoa() |
| 47 | { return m_wxTopLevelWindowCocoa; } |
| 48 | protected: |
| 49 | wxCocoaNSWindow(wxTopLevelWindowCocoa *tlw = NULL); |
| 50 | virtual ~wxCocoaNSWindow(); |
| 51 | WX_wxNSWindowDelegate m_cocoaDelegate; |
| 52 | wxTopLevelWindowCocoa *m_wxTopLevelWindowCocoa; |
| 53 | }; |
| 54 | |
| 55 | #endif // _WX_COCOA_NSWINDOW_H_ |