/src/mac/macdelegate.h

http://github.com/tomahawk-player/tomahawk · C Header · 40 lines · 29 code · 9 blank · 2 comment · 1 complexity · 8c3abc9a226ee12e91703ab40fd35c36 MD5 · raw file

  1. #ifndef MACDELEGATE_H
  2. #define MACDELEGATE_H
  3. // This file inspired by clementine's MacDelegate.h
  4. #import <AppKit/NSApplication.h>
  5. #include "SPMediaKeyTap.h"
  6. namespace Tomahawk {
  7. class MacShortcutHandler;
  8. class PlatformInterface;
  9. }
  10. #if ( defined MAC_OS_X_VERSION_10_7 || defined SNOW_LEOPARD )
  11. @interface AppDelegate :NSObject <NSApplicationDelegate> {
  12. #else
  13. @interface AppDelegate :NSObject {
  14. #endif
  15. Tomahawk::PlatformInterface* application_handler_;
  16. NSMenu* dock_menu_;
  17. SPMediaKeyTap* key_tap_;
  18. Tomahawk::MacShortcutHandler* shortcut_handler_;
  19. }
  20. - (id) initWithHandler: (Tomahawk::PlatformInterface*)handler;
  21. // NSApplicationDelegate
  22. - (BOOL) applicationShouldHandleReopen: (NSApplication*)app hasVisibleWindows:(BOOL)flag;
  23. - (NSMenu*) applicationDockMenu: (NSApplication*)sender;
  24. - (void) setDockMenu: (NSMenu*)menu;
  25. - (Tomahawk::MacShortcutHandler*) shortcutHandler;
  26. - (void) setShortcutHandler: (Tomahawk::MacShortcutHandler*)backend;
  27. - (void)applicationDidFinishLaunching:(NSNotification*)aNotification;
  28. - (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication*)sender;
  29. - (void) mediaKeyTap: (SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event;
  30. @end
  31. #endif // MACDELEGATE_H