Added -reopenWith:.
5 #import <AppKit/AppKit.h>
6 #import <ScriptingBridge/ScriptingBridge.h>
9 @class iChatItem, iChatApplication, iChatColor, iChatDocument, iChatWindow, iChatRichText, iChatCharacter, iChatParagraph, iChatWord, iChatAttributeRun, iChatAttachment, iChatApplication, iChatBuddy, iChatService, iChatChat, iChatTextChat, iChatAudioChat, iChatVideoChat, iChatFileTransfer;
12 iChatSaveOptionsYes = 'yes ' /* Save the file. */,
13 iChatSaveOptionsNo = 'no ' /* Do not save the file. */,
14 iChatSaveOptionsAsk = 'ask ' /* Ask the user whether or not to save the file. */
18 iChatInviteTypeAudioInvitation = 'acon',
19 iChatInviteTypeTextChatInvitation = 'tcon',
20 iChatInviteTypeVideoInvitation = 'vcon'
24 iChatAccountStatusAvailable = 'aval',
25 iChatAccountStatusAway = 'away',
26 iChatAccountStatusOffline = 'offl',
27 iChatAccountStatusInvisible = 'invs',
28 iChatAccountStatusIdle = 'idle',
29 iChatAccountStatusUnknown = 'unkn'
33 iChatMyStatusAway = 'away',
34 iChatMyStatusAvailable = 'aval',
35 iChatMyStatusOffline = 'offl',
36 iChatMyStatusInvisible = 'invs'
40 iChatConnectionStatusDisconnecting = 'dcng',
41 iChatConnectionStatusConnected = 'conn',
42 iChatConnectionStatusConnecting = 'cong',
43 iChatConnectionStatusDisconnected = 'dcon'
44 } iChatConnectionStatus;
47 iChatCapabilitiesVideoChat = 'vcon',
48 iChatCapabilitiesAudioChat = 'acon',
49 iChatCapabilitiesMultipersonVideo = 'mwvc',
50 iChatCapabilitiesMultipersonAudio = 'mwac'
54 iChatScreenSharingNone = 'ssns',
55 iChatScreenSharingLocalScreen = 'ssls',
56 iChatScreenSharingRemoteScreen = 'ssrs'
60 iChatServiceTypeAIM = 'saim',
61 iChatServiceTypeBonjour = 'ssub',
62 iChatServiceTypeJabber = 'sjab'
66 iChatDirectionIncoming = 'FTic',
67 iChatDirectionOutgoing = 'FTog'
71 iChatTransferStatusPreparing = 'FTsp',
72 iChatTransferStatusWaiting = 'FTsw',
73 iChatTransferStatusTransferring = 'FTsg',
74 iChatTransferStatusFinalizing = 'FTsz',
75 iChatTransferStatusFinished = 'FTsf',
76 iChatTransferStatusFailed = 'FTse'
77 } iChatTransferStatus;
80 iChatAvTypeAudio = 'ICAa',
81 iChatAvTypeVideo = 'ICAv'
85 iChatChatTypeInstantMessage = 'ICim',
86 iChatChatTypeDirectInstantMessage = 'ICdi',
87 iChatChatTypeChatRoom = 'ICcr'
91 iChatJoinStateNotJoined = 'ICJc',
92 iChatJoinStateJoining = 'ICJg',
93 iChatJoinStateJoined = 'ICJj'
97 iChatAvConnectionStatusInvited = 'ICAi',
98 iChatAvConnectionStatusWaiting = 'ICAw',
99 iChatAvConnectionStatusConnecting = 'ICAx',
100 iChatAvConnectionStatusConnected = 'ICAc',
101 iChatAvConnectionStatusEnded = 'ICAn'
102 } iChatAvConnectionStatus;
110 // A scriptable object.
111 @interface iChatItem : SBObject
113 @property (copy) NSDictionary *properties; // All of the object's properties.
115 - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document.
116 - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document.
117 - (void) delete; // Delete an object.
118 - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
119 - (BOOL) exists; // Verify if an object exists.
120 - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
124 // The application's top-level scripting object.
125 @interface iChatApplication : SBApplication
127 - (SBElementArray *) documents;
128 - (SBElementArray *) windows;
130 @property (copy, readonly) NSString *name; // The name of the application.
131 @property (readonly) BOOL frontmost; // Is this the frontmost (active) application?
132 @property (copy, readonly) NSString *version; // The version of the application.
134 - (void) open:(NSArray *)x; // Open a document.
135 - (void) print:(NSURL *)x; // Print an object.
136 - (void) quitSaving:(iChatSaveOptions)saving; // Quit the application.
137 - (void) invite:(NSArray *)x to:(id)to withMessage:(NSString *)withMessage; // Invites a buddy to join an existing chat.
138 - (void) logIn; // Log in to the specified service, or all services if none is specified. If the account password is not in the keychain the user will be prompted to enter one.
139 - (void) logOut; // Logs out of a service, or all services if none is specified.
140 - (void) send:(id)x to:(id)to; // Sends a message or file to a buddy or to a chat.
141 - (void) storeRecentPicture; // Stores the currently set buddy picture into your recent pictures.
142 - (void) showChatChooserFor:(iChatBuddy *)for_; // displays a dialog in iChat to start a new chat with the specified buddy
147 @interface iChatColor : SBObject
149 - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document.
150 - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document.
151 - (void) delete; // Delete an object.
152 - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
153 - (BOOL) exists; // Verify if an object exists.
154 - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
158 // An iChat document.
159 @interface iChatDocument : SBObject
161 @property (copy, readonly) NSString *name; // The document's name.
162 @property (readonly) BOOL modified; // Has the document been modified since the last save?
163 @property (copy, readonly) NSURL *file; // The document's location on disk.
165 - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document.
166 - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document.
167 - (void) delete; // Delete an object.
168 - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
169 - (BOOL) exists; // Verify if an object exists.
170 - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
175 @interface iChatWindow : SBObject
177 @property (copy, readonly) NSString *name; // The full title of the window.
178 - (NSInteger) id; // The unique identifier of the window.
179 @property NSInteger index; // The index of the window, ordered front to back.
180 @property NSRect bounds; // The bounding rectangle of the window.
181 @property (readonly) BOOL closeable; // Whether the window has a close box.
182 @property (readonly) BOOL minimizable; // Whether the window can be minimized.
183 @property BOOL minimized; // Whether the window is currently minimized.
184 @property (readonly) BOOL resizable; // Whether the window can be resized.
185 @property BOOL visible; // Whether the window is currently visible.
186 @property (readonly) BOOL zoomable; // Whether the window can be zoomed.
187 @property BOOL zoomed; // Whether the window is currently zoomed.
188 @property (copy, readonly) iChatDocument *document; // The document whose contents are being displayed in the window.
190 - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document.
191 - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document.
192 - (void) delete; // Delete an object.
193 - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
194 - (BOOL) exists; // Verify if an object exists.
195 - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
205 // Rich (styled) text
206 @interface iChatRichText : SBObject
208 - (SBElementArray *) characters;
209 - (SBElementArray *) paragraphs;
210 - (SBElementArray *) words;
211 - (SBElementArray *) attributeRuns;
212 - (SBElementArray *) attachments;
214 @property (copy) NSColor *color; // The color of the first character.
215 @property (copy) NSString *font; // The name of the font of the first character.
216 @property double size; // The size in points of the first character.
218 - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document.
219 - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document.
220 - (void) delete; // Delete an object.
221 - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
222 - (BOOL) exists; // Verify if an object exists.
223 - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
227 // This subdivides the text into characters.
228 @interface iChatCharacter : SBObject
230 - (SBElementArray *) characters;
231 - (SBElementArray *) paragraphs;
232 - (SBElementArray *) words;
233 - (SBElementArray *) attributeRuns;
234 - (SBElementArray *) attachments;
236 @property (copy) NSColor *color; // The color of the first character.
237 @property (copy) NSString *font; // The name of the font of the first character.
238 @property NSInteger size; // The size in points of the first character.
240 - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document.
241 - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document.
242 - (void) delete; // Delete an object.
243 - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
244 - (BOOL) exists; // Verify if an object exists.
245 - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
249 // This subdivides the text into paragraphs.
250 @interface iChatParagraph : SBObject
252 - (SBElementArray *) characters;
253 - (SBElementArray *) paragraphs;
254 - (SBElementArray *) words;
255 - (SBElementArray *) attributeRuns;
256 - (SBElementArray *) attachments;
258 @property (copy) NSColor *color; // The color of the first character.
259 @property (copy) NSString *font; // The name of the font of the first character.
260 @property NSInteger size; // The size in points of the first character.
262 - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document.
263 - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document.
264 - (void) delete; // Delete an object.
265 - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
266 - (BOOL) exists; // Verify if an object exists.
267 - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
271 // This subdivides the text into words.
272 @interface iChatWord : SBObject
274 - (SBElementArray *) characters;
275 - (SBElementArray *) paragraphs;
276 - (SBElementArray *) words;
277 - (SBElementArray *) attributeRuns;
278 - (SBElementArray *) attachments;
280 @property (copy) NSColor *color; // The color of the first character.
281 @property (copy) NSString *font; // The name of the font of the first character.
282 @property NSInteger size; // The size in points of the first character.
284 - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document.
285 - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document.
286 - (void) delete; // Delete an object.
287 - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
288 - (BOOL) exists; // Verify if an object exists.
289 - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
293 // This subdivides the text into chunks that all have the same attributes.
294 @interface iChatAttributeRun : SBObject
296 - (SBElementArray *) characters;
297 - (SBElementArray *) paragraphs;
298 - (SBElementArray *) words;
299 - (SBElementArray *) attributeRuns;
300 - (SBElementArray *) attachments;
302 @property (copy) NSColor *color; // The color of the first character.
303 @property (copy) NSString *font; // The name of the font of the first character.
304 @property NSInteger size; // The size in points of the first character.
306 - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document.
307 - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document.
308 - (void) delete; // Delete an object.
309 - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
310 - (BOOL) exists; // Verify if an object exists.
311 - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
315 // Represents an inline text attachment. This class is used mainly for make commands.
316 @interface iChatAttachment : iChatRichText
318 @property (copy, readonly) NSURL *file; // The path to the file for the attachment
329 // iChat application.
330 @interface iChatApplication (IChatSuite)
332 - (SBElementArray *) buddies;
333 - (SBElementArray *) services;
334 - (SBElementArray *) fileTransfers;
335 - (SBElementArray *) chats;
336 - (SBElementArray *) textChats;
337 - (SBElementArray *) audioChats;
338 - (SBElementArray *) videoChats;
340 @property (readonly) NSInteger idleTime; // Time in seconds that I have been idle.
341 @property (copy) NSImage *image; // My image as it appears in all services.
342 @property (copy) NSString *statusMessage; // My status message, visible to other people while I am online.
343 @property iChatMyStatus status; // My status on all services.
344 @property (copy) iChatAudioChat *activeAvChat; // The currently active audio or video chat.
348 // A buddy on a service.
349 @interface iChatBuddy : iChatItem
351 - (NSString *) id; // The buddy's service and handle. For example: AIM:JohnDoe007
352 @property (copy, readonly) iChatService *service; // The service on which this buddy exists.
353 @property (copy, readonly) NSString *name; // The buddy's name as it appears in the buddy list.
354 @property (copy, readonly) NSString *handle; // The buddy's online account name.
355 @property (readonly) iChatAccountStatus status; // The buddy's current status.
356 @property (copy, readonly) NSString *statusMessage; // The buddy's current status message.
357 @property (readonly) NSInteger idleTime; // The time in seconds the buddy has been idle.
358 @property (copy, readonly) NSArray *capabilities; // The buddy's messaging capabilities.
359 @property (copy, readonly) NSImage *image; // The buddy's custom image.
360 @property (copy, readonly) NSString *firstName; // The first name from this buddy's Address Book card, if available
361 @property (copy, readonly) NSString *lastName; // The last name from this buddy's Address Book card, if available
362 @property (copy, readonly) NSString *fullName; // The full name from this buddy's Address Book card, if available
367 // A service that can be logged in from this system
368 @interface iChatService : iChatItem
370 - (SBElementArray *) buddies;
371 - (SBElementArray *) chats;
373 - (NSString *) id; // A guid identifier for this service.
374 @property (copy) NSString *name; // The name of this service as defined in Account preferences description field
375 @property BOOL enabled; // Is the service enabled?
376 @property (readonly) iChatConnectionStatus status; // The connection status for this account.
377 @property (readonly) iChatServiceType serviceType; // The type of protocol for this service
379 - (void) logIn; // Log in to the specified service, or all services if none is specified. If the account password is not in the keychain the user will be prompted to enter one.
380 - (void) logOut; // Logs out of a service, or all services if none is specified.
384 // An audio, video, or text chat.
385 @interface iChatChat : SBObject
387 - (NSString *) id; // A guid identifier for this chat.
388 @property (copy, readonly) iChatService *service; // The service which is participating in this chat.
389 @property (copy, readonly) NSArray *participants; // Other participants of this chat. This property may be specified at time of creation.
390 @property (readonly) BOOL secure; // Is this chat secure?
391 @property (readonly) BOOL invitation; // Is this an invitation to a chat?
392 @property (readonly) BOOL active; // Is this chat currently active?
393 @property (copy, readonly) NSDate *started; // The date on which this chat started.
394 @property (copy, readonly) NSDate *updated; // The date when this chat was last updated.
396 - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document.
397 - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document.
398 - (void) delete; // Delete an object.
399 - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
400 - (BOOL) exists; // Verify if an object exists.
401 - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
402 - (void) accept; // Accepts an incoming text, audio, or video chat invitation, or file transfer
403 - (void) decline; // Declines an incoming text, audio, or video chat invitation, or file transfer
408 @interface iChatTextChat : iChatChat
410 @property (copy, readonly) NSString *subject; // The subject of this chat, if available.
411 @property (copy, readonly) NSString *invitationMessage; // An invitation message. This may only be specified at the time of creation. This message will be sent to chat participants when the chat is created.
412 @property (readonly) iChatJoinState joinState; // How you are joined to this chat
413 @property (copy, readonly) NSString *name; // The address or room name of this chat. This property may be specified at time of creation.
414 @property (readonly) iChatChatType chatType; // The type of this chat.
419 // An audio or video chat.
420 @interface iChatAudioChat : iChatChat
422 @property (readonly) iChatScreenSharing screenSharing; // Type of screen sharing session taking place within this chat.
423 @property BOOL muted; // Is the chat muted?
424 @property (readonly) iChatAvConnectionStatus avConnectionStatus; // The connection state for this av chat.
426 - (void) requestRecording; // Sends a recording request to all participants of an audio or video chat. Recording will not start until all participants have agreed to allow recording.
427 - (void) stopRecording; // Ends recording of an audio or video chat.
431 @interface iChatVideoChat : iChatAudioChat
433 @property BOOL paused; // Is the chat paused?
434 @property BOOL showingFullScreen; // Is the chat being displayed in full screen mode?
435 @property BOOL showingLocalVideo; // Is the local video preview being displayed?
437 - (void) takeSnapshot; // Takes a snapshot of a video chat and saves it to a desktop.
441 // A file being sent or received
442 @interface iChatFileTransfer : iChatItem
444 - (NSString *) id; // The guid for this file transfer
445 @property (copy, readonly) NSString *name; // The name of this file
446 @property (copy, readonly) NSURL *file; // The local path to this file transfer
447 @property (readonly) iChatDirection direction; // The direction in which this file is being sent
448 @property (copy, readonly) iChatService *service; // The service on which this file transfer is taking place
449 @property (copy, readonly) iChatBuddy *buddy; // The account participating in this file transfer
450 @property (readonly) BOOL secure; // Is this file transfer secure?
451 @property (readonly) NSInteger fileSize; // The total size in bytes of the completed file transfer
452 @property (readonly) NSInteger fileProgress; // The number of bytes that have been transferred
453 @property (readonly) iChatTransferStatus transferStatus; // The current status of this file transfer
454 @property (copy, readonly) NSDate *started; // The date that this file transfer started
456 - (void) accept; // Accepts an incoming text, audio, or video chat invitation, or file transfer
457 - (void) decline; // Declines an incoming text, audio, or video chat invitation, or file transfer