2018-02-27 18:06:05 +01:00
|
|
|
#import <AppKit/NSApplication.h>
|
|
|
|
|
|
|
|
#include "config.h"
|
2021-01-26 19:13:29 +01:00
|
|
|
#include "globalshortcuts/globalshortcutsbackend-macos.h"
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
class PlatformInterface;
|
2021-01-06 14:46:21 +01:00
|
|
|
@class SPMediaKeyTap;
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
@interface AppDelegate : NSObject<NSApplicationDelegate, NSUserNotificationCenterDelegate> {
|
|
|
|
PlatformInterface* application_handler_;
|
|
|
|
NSMenu* dock_menu_;
|
2021-01-26 19:13:29 +01:00
|
|
|
GlobalShortcutsBackendMacOS* shortcut_handler_;
|
2021-01-06 14:46:21 +01:00
|
|
|
SPMediaKeyTap* key_tap_;
|
2018-10-02 00:38:52 +02:00
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id) initWithHandler: (PlatformInterface*)handler;
|
|
|
|
|
|
|
|
// NSApplicationDelegate
|
|
|
|
- (BOOL) applicationShouldHandleReopen: (NSApplication*)app hasVisibleWindows:(BOOL)flag;
|
|
|
|
- (NSMenu*) applicationDockMenu: (NSApplication*)sender;
|
|
|
|
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification;
|
|
|
|
- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication*)sender;
|
|
|
|
|
|
|
|
// NSUserNotificationCenterDelegate
|
|
|
|
- (BOOL) userNotificationCenter: (id)center
|
|
|
|
shouldPresentNotification: (id)notification;
|
|
|
|
|
|
|
|
- (void) setDockMenu: (NSMenu*)menu;
|
2021-01-26 19:13:29 +01:00
|
|
|
- (GlobalShortcutsBackendMacOS*) shortcut_handler;
|
|
|
|
- (void) setShortcutHandler: (GlobalShortcutsBackendMacOS*)backend;
|
2021-01-06 14:46:21 +01:00
|
|
|
- (void) mediaKeyTap: (SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event;
|
2018-02-27 18:06:05 +01:00
|
|
|
@end
|