summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/foundation/NSAppleEventManager.inc
blob: 78092b5df86913bc7b3f78f7c81c1f130367ee30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{ Parsed from Foundation.framework NSAppleEventManager.h }

{$ifdef TYPES}
{$ifndef NSAPPLEEVENTMANAGER_PAS_T}
{$define NSAPPLEEVENTMANAGER_PAS_T}

{ Types }
type
  NSAppleEventManagerSuspensionID = __NSAppleEventManagerSuspensionPtr;
  NSAppleEventManagerSuspensionIDPtr = ^NSAppleEventManagerSuspensionID;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSAPPLEEVENTMANAGER_PAS_R}
{$define NSAPPLEEVENTMANAGER_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSAPPLEEVENTMANAGER_PAS_F}
{$define NSAPPLEEVENTMANAGER_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSAPPLEEVENTMANAGER_PAS_S}
{$define NSAPPLEEVENTMANAGER_PAS_S}

{ External symbols }
var
  NSAppleEventTimeOutDefault: double; cvar; external;
  NSAppleEventTimeOutNone: double; cvar; external;

{ External string constants }
var
  NSAppleEventManagerWillProcessFirstEventNotification: NSString; cvar; external;

{$endif}
{$endif}

{$ifdef FORWARD}
  NSAppleEventManager = objcclass;
  NSAppleEventManagerPointer = ^NSAppleEventManager;
  NSAppleEventManagerPtr = NSAppleEventManagerPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSAPPLEEVENTMANAGER_PAS_C}
{$define NSAPPLEEVENTMANAGER_PAS_C}

{ NSAppleEventManager }
  NSAppleEventManager = objcclass external (NSObject)
  private
    _isPreparedForDispatch: Boolean;
    _padding: array[0..(3)-1] of char;
    
  public
    class function sharedAppleEventManager: NSAppleEventManager; message 'sharedAppleEventManager';
    procedure setEventHandler_andSelector_forEventClass_andEventID(handler: id; handleEventSelector: SEL; eventClass: AEEventClass; eventID: AEEventID); message 'setEventHandler:andSelector:forEventClass:andEventID:';
    procedure removeEventHandlerForEventClass_andEventID(eventClass: AEEventClass; eventID: AEEventID); message 'removeEventHandlerForEventClass:andEventID:';
    function dispatchRawAppleEvent_withRawReply_handlerRefCon(theAppleEvent: AppleEventPtr; theReply: AppleEventPtr; handlerRefCon: SRefCon): OSErr; message 'dispatchRawAppleEvent:withRawReply:handlerRefCon:';
    function currentAppleEvent: NSAppleEventDescriptor; message 'currentAppleEvent';
    function currentReplyAppleEvent: NSAppleEventDescriptor; message 'currentReplyAppleEvent';
    function suspendCurrentAppleEvent: NSAppleEventManagerSuspensionID; message 'suspendCurrentAppleEvent';
    function appleEventForSuspensionID(suspensionID: NSAppleEventManagerSuspensionID): NSAppleEventDescriptor; message 'appleEventForSuspensionID:';
    function replyAppleEventForSuspensionID(suspensionID: NSAppleEventManagerSuspensionID): NSAppleEventDescriptor; message 'replyAppleEventForSuspensionID:';
    procedure setCurrentAppleEventAndReplyEventWithSuspensionID(suspensionID: NSAppleEventManagerSuspensionID); message 'setCurrentAppleEventAndReplyEventWithSuspensionID:';
    procedure resumeWithSuspensionID(suspensionID: NSAppleEventManagerSuspensionID); message 'resumeWithSuspensionID:';
  end;

{$endif}
{$endif}