2004-01-26 19:50:57 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/cocoa/NSApplication.h
|
|
|
|
// Purpose: wxNSApplicationDelegate definition
|
|
|
|
// Author: David Elliott
|
|
|
|
// Modified by:
|
|
|
|
// Created: 2004/01/26
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2003,2004 David Elliott
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2004-01-26 19:50:57 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_COCOA_NSAPPLICATION_H__
|
|
|
|
#define _WX_COCOA_NSAPPLICATION_H__
|
|
|
|
|
2007-05-27 00:52:04 -04:00
|
|
|
#include "wx/cocoa/objc/objc_uniquifying.h"
|
|
|
|
|
2004-01-26 19:50:57 -05:00
|
|
|
// ========================================================================
|
|
|
|
// wxNSApplicationDelegate
|
|
|
|
// ========================================================================
|
2007-05-14 03:00:30 -04:00
|
|
|
/*!
|
|
|
|
@class wxNSApplicationDelegate
|
|
|
|
@discussion Implements an NSApplication delegate which can respond to messages sent by Cocoa to change Cocoa's behavior.
|
|
|
|
|
|
|
|
wxCocoa will set a singleton instance of this class as the NSApplication delegate upon startup unless wxWidgets is running
|
|
|
|
in a "plugin" manner in which case it would not be appropriate to do this.
|
|
|
|
|
|
|
|
Although Cocoa will send notifications to the delegate it is also possible to register a different object to listen for
|
|
|
|
them. Because we want to support the plugin case, we use a separate notification observer object when we can.
|
|
|
|
*/
|
2004-01-26 19:50:57 -05:00
|
|
|
@interface wxNSApplicationDelegate : NSObject
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delegate methods
|
|
|
|
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication;
|
2007-05-14 03:00:30 -04:00
|
|
|
@end // interface wxNSApplicationDelegate : NSObject
|
2007-05-27 00:52:04 -04:00
|
|
|
WX_DECLARE_GET_OBJC_CLASS(wxNSApplicationDelegate,NSObject)
|
2007-05-14 03:00:30 -04:00
|
|
|
|
|
|
|
// ========================================================================
|
|
|
|
// wxNSApplicationObserver
|
|
|
|
// ========================================================================
|
|
|
|
/*!
|
|
|
|
@class wxNSApplicationObserver
|
|
|
|
@discussion Observes most notifications sent by the NSApplication singleton.
|
|
|
|
|
|
|
|
wxCocoa will create a singleton instance of this class upon startup and register it with the default notification center to
|
|
|
|
listen for several events sent by the NSApplication singleton.
|
|
|
|
|
|
|
|
Because there can be any number of notification observers, this method allows wxCocoa to function properly even when it is
|
|
|
|
running as a plugin of some other (most likely not wxWidgets) application.
|
|
|
|
*/
|
|
|
|
@interface wxNSApplicationObserver : NSObject
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Methods defined as (but not used here) as NSApplication delegate methods.
|
2004-01-26 19:50:57 -05:00
|
|
|
- (void)applicationWillBecomeActive:(NSNotification *)notification;
|
|
|
|
- (void)applicationDidBecomeActive:(NSNotification *)notification;
|
|
|
|
- (void)applicationWillResignActive:(NSNotification *)notification;
|
|
|
|
- (void)applicationDidResignActive:(NSNotification *)notification;
|
2007-05-14 03:00:30 -04:00
|
|
|
- (void)applicationWillUpdate:(NSNotification *)notification;
|
2004-06-22 00:16:22 -04:00
|
|
|
|
|
|
|
// Other notifications
|
|
|
|
- (void)controlTintChanged:(NSNotification *)notification;
|
2007-05-14 03:00:30 -04:00
|
|
|
@end // interface wxNSApplicationObserver : NSObject
|
2007-05-27 00:52:04 -04:00
|
|
|
WX_DECLARE_GET_OBJC_CLASS(wxNSApplicationObserver,NSObject)
|
2004-01-26 19:50:57 -05:00
|
|
|
|
|
|
|
#endif //ndef _WX_COCOA_NSAPPLICATION_H__
|