Mac OS 9
AppleEvents.h
Go to the documentation of this file.
1 
19 #ifndef __APPLEEVENTS__
20 #define __APPLEEVENTS__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __MIXEDMODE__
27 #include <MixedMode.h>
28 #endif
29 
34 #ifndef __AEDATAMODEL__
35 #include <AEDataModel.h>
36 #endif
37 
42 #ifndef __AEINTERACTION__
43 #include <AEInteraction.h>
44 #endif
45 
46 #if PRAGMA_ONCE
47 #pragma once
48 #endif
49 
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif
54 
55 #if PRAGMA_IMPORT
56 #pragma import on
57 #endif
58 
59 #if PRAGMA_STRUCT_ALIGN
60 #pragma options align = mac68k
61 #elif PRAGMA_STRUCT_PACKPUSH
62 #pragma pack(push, 2)
63 #elif PRAGMA_STRUCT_PACK
64 #pragma pack(2)
65 #endif
66 
67  enum
68  {
70  keyDirectObject = FOUR_CHAR_CODE('----'),
71  keyErrorNumber = FOUR_CHAR_CODE('errn'),
72  keyErrorString = FOUR_CHAR_CODE('errs'),
73  keyProcessSerialNumber =
74  FOUR_CHAR_CODE('psn '),
75  keyPreDispatch = FOUR_CHAR_CODE('phac'),
76  keySelectProc = FOUR_CHAR_CODE('selh'),
79  FOUR_CHAR_CODE('recr'),
81  keyAEVersion =
82  FOUR_CHAR_CODE('vers')
83  };
84 
86  enum
87  {
88  kCoreEventClass = FOUR_CHAR_CODE('aevt')
89  };
90 
92  enum
93  {
94  kAEOpenApplication = FOUR_CHAR_CODE('oapp'),
95  kAEOpenDocuments = FOUR_CHAR_CODE('odoc'),
96  kAEPrintDocuments = FOUR_CHAR_CODE('pdoc'),
97  kAEQuitApplication = FOUR_CHAR_CODE('quit'),
98  kAEAnswer = FOUR_CHAR_CODE('ansr'),
99  kAEApplicationDied = FOUR_CHAR_CODE('obit'),
100  kAEShowPreferences = FOUR_CHAR_CODE(
101  'pref')
102  };
103 
105  enum
106  {
107  kAEStartRecording =
108  FOUR_CHAR_CODE('reca'),
110  FOUR_CHAR_CODE('recc'),
112  FOUR_CHAR_CODE('rec1'),
114  FOUR_CHAR_CODE('rec0'),
116  FOUR_CHAR_CODE('recr')
117  };
118 
126  typedef SInt8 AEEventSource;
127  enum
128  {
129  kAEUnknownSource = 0,
130  kAEDirectCall = 1,
131  kAESameProcess = 2,
132  kAELocalProcess = 3,
133  kAERemoteProcess = 4
134  };
135 
136  /***************************************************************************
137  These calls are used to set up and modify the event dispatch table.
138  **************************************************************************/
147  OSErr
148  AEInstallEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID,
149  AEEventHandlerUPP handler, long handlerRefcon,
150  Boolean isSysHandler);
151 
160  OSErr
161  AERemoveEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID,
162  AEEventHandlerUPP handler, Boolean isSysHandler);
163 
172  OSErr
173  AEGetEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID,
174  AEEventHandlerUPP *handler, long *handlerRefcon,
175  Boolean isSysHandler);
176 
177  /***************************************************************************
178  These calls are used to set up and modify special hooks into the
179  AppleEvent manager.
180  **************************************************************************/
189  OSErr
190  AEInstallSpecialHandler(AEKeyword functionClass, AEEventHandlerUPP handler,
191  Boolean isSysHandler);
192 
201  OSErr
202  AERemoveSpecialHandler(AEKeyword functionClass, AEEventHandlerUPP handler,
203  Boolean isSysHandler);
204 
213  OSErr
214  AEGetSpecialHandler(AEKeyword functionClass, AEEventHandlerUPP *handler,
215  Boolean isSysHandler);
216 
217  /***************************************************************************
218  This call was added in version 1.0.1. If called with the keyword
219  keyAERecorderCount ('recr'), the number of recorders that are
220  currently active is returned in 'result'
221  (available only in vers 1.0.1 and greater).
222  **************************************************************************/
231  OSErr
232  AEManagerInfo(AEKeyword keyWord, long *result);
233 
234 #if PRAGMA_STRUCT_ALIGN
235 #pragma options align = reset
236 #elif PRAGMA_STRUCT_PACKPUSH
237 #pragma pack(pop)
238 #elif PRAGMA_STRUCT_PACK
239 #pragma pack()
240 #endif
241 
242 #ifdef PRAGMA_IMPORT_OFF
243 #pragma import off
244 #elif PRAGMA_IMPORT
245 #pragma import reset
246 #endif
247 
248 #ifdef __cplusplus
249 }
250 #endif
251 
252 #endif
AppleEvent Data Model Interfaces.
AppleEvent functions that deal with Events and interacting with user.
OSErr AEGetEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP *handler, long *handlerRefcon, Boolean isSysHandler)
OSErr AEGetSpecialHandler(AEKeyword functionClass, AEEventHandlerUPP *handler, Boolean isSysHandler)
OSErr AERemoveEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP handler, Boolean isSysHandler)
OSErr AEInstallEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP handler, long handlerRefcon, Boolean isSysHandler)
OSErr AERemoveSpecialHandler(AEKeyword functionClass, AEEventHandlerUPP handler, Boolean isSysHandler)
SInt8 AEEventSource
Definition: AppleEvents.h:126
@ kAENotifyRecording
Definition: AppleEvents.h:115
@ kAEStopRecording
Definition: AppleEvents.h:109
@ kAENotifyStopRecording
Definition: AppleEvents.h:113
@ kAENotifyStartRecording
Definition: AppleEvents.h:111
@ keyDirectObject
Definition: AppleEvents.h:70
@ keyAEVersion
Definition: AppleEvents.h:81
@ keySelectProc
Definition: AppleEvents.h:76
@ keyAERecorderCount
Definition: AppleEvents.h:78
@ keyPreDispatch
Definition: AppleEvents.h:75
OSErr AEInstallSpecialHandler(AEKeyword functionClass, AEEventHandlerUPP handler, Boolean isSysHandler)
OSErr AEManagerInfo(AEKeyword keyWord, long *result)
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Mixed Mode Manager Interfaces.