1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/NSApplication.h
3 // Purpose: wxNSApplicationDelegate definition
4 // Author: David Elliott
8 // Copyright: (c) 2003,2004 David Elliott
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_COCOA_NSAPPLICATION_H__
13 #define _WX_COCOA_NSAPPLICATION_H__
15 // ========================================================================
16 // wxNSApplicationDelegate
17 // ========================================================================
19 @class wxNSApplicationDelegate
20 @discussion Implements an NSApplication delegate which can respond to messages sent by Cocoa to change Cocoa's behavior.
22 wxCocoa will set a singleton instance of this class as the NSApplication delegate upon startup unless wxWidgets is running
23 in a "plugin" manner in which case it would not be appropriate to do this.
25 Although Cocoa will send notifications to the delegate it is also possible to register a different object to listen for
26 them. Because we want to support the plugin case, we use a separate notification observer object when we can.
28 @interface wxNSApplicationDelegate
: NSObject
33 - (BOOL
)applicationShouldTerminateAfterLastWindowClosed
:(NSApplication
*)theApplication
;
34 @end
// interface wxNSApplicationDelegate : NSObject
36 // ========================================================================
37 // wxNSApplicationObserver
38 // ========================================================================
40 @class wxNSApplicationObserver
41 @discussion Observes most notifications sent by the NSApplication singleton.
43 wxCocoa will create a singleton instance of this class upon startup and register it with the default notification center to
44 listen for several events sent by the NSApplication singleton.
46 Because there can be any number of notification observers, this method allows wxCocoa to function properly even when it is
47 running as a plugin of some other (most likely not wxWidgets) application.
49 @interface wxNSApplicationObserver
: NSObject
53 // Methods defined as (but not used here) as NSApplication delegate methods.
54 - (void)applicationWillBecomeActive
:(NSNotification
*)notification
;
55 - (void)applicationDidBecomeActive
:(NSNotification
*)notification
;
56 - (void)applicationWillResignActive
:(NSNotification
*)notification
;
57 - (void)applicationDidResignActive
:(NSNotification
*)notification
;
58 - (void)applicationWillUpdate
:(NSNotification
*)notification
;
60 // Other notifications
61 - (void)controlTintChanged
:(NSNotification
*)notification
;
62 @end
// interface wxNSApplicationObserver : NSObject
64 #endif //ndef _WX_COCOA_NSAPPLICATION_H__