jens@0: /* jens@0: * iChat.h jens@0: */ jens@0: jens@0: #import jens@0: #import jens@0: jens@0: jens@0: @class iChatItem, iChatApplication, iChatColor, iChatDocument, iChatWindow, iChatRichText, iChatCharacter, iChatParagraph, iChatWord, iChatAttributeRun, iChatAttachment, iChatApplication, iChatBuddy, iChatService, iChatChat, iChatTextChat, iChatAudioChat, iChatVideoChat, iChatFileTransfer; jens@0: jens@0: typedef enum { jens@0: iChatSaveOptionsYes = 'yes ' /* Save the file. */, jens@0: iChatSaveOptionsNo = 'no ' /* Do not save the file. */, jens@0: iChatSaveOptionsAsk = 'ask ' /* Ask the user whether or not to save the file. */ jens@0: } iChatSaveOptions; jens@0: jens@0: typedef enum { jens@0: iChatInviteTypeAudioInvitation = 'acon', jens@0: iChatInviteTypeTextChatInvitation = 'tcon', jens@0: iChatInviteTypeVideoInvitation = 'vcon' jens@0: } iChatInviteType; jens@0: jens@0: typedef enum { jens@0: iChatAccountStatusAvailable = 'aval', jens@0: iChatAccountStatusAway = 'away', jens@0: iChatAccountStatusOffline = 'offl', jens@0: iChatAccountStatusInvisible = 'invs', jens@0: iChatAccountStatusIdle = 'idle', jens@0: iChatAccountStatusUnknown = 'unkn' jens@0: } iChatAccountStatus; jens@0: jens@0: typedef enum { jens@0: iChatMyStatusAway = 'away', jens@0: iChatMyStatusAvailable = 'aval', jens@0: iChatMyStatusOffline = 'offl', jens@0: iChatMyStatusInvisible = 'invs' jens@0: } iChatMyStatus; jens@0: jens@0: typedef enum { jens@0: iChatConnectionStatusDisconnecting = 'dcng', jens@0: iChatConnectionStatusConnected = 'conn', jens@0: iChatConnectionStatusConnecting = 'cong', jens@0: iChatConnectionStatusDisconnected = 'dcon' jens@0: } iChatConnectionStatus; jens@0: jens@0: typedef enum { jens@0: iChatCapabilitiesVideoChat = 'vcon', jens@0: iChatCapabilitiesAudioChat = 'acon', jens@0: iChatCapabilitiesMultipersonVideo = 'mwvc', jens@0: iChatCapabilitiesMultipersonAudio = 'mwac' jens@0: } iChatCapabilities; jens@0: jens@0: typedef enum { jens@0: iChatScreenSharingNone = 'ssns', jens@0: iChatScreenSharingLocalScreen = 'ssls', jens@0: iChatScreenSharingRemoteScreen = 'ssrs' jens@0: } iChatScreenSharing; jens@0: jens@0: typedef enum { jens@0: iChatServiceTypeAIM = 'saim', jens@0: iChatServiceTypeBonjour = 'ssub', jens@0: iChatServiceTypeJabber = 'sjab' jens@0: } iChatServiceType; jens@0: jens@0: typedef enum { jens@0: iChatDirectionIncoming = 'FTic', jens@0: iChatDirectionOutgoing = 'FTog' jens@0: } iChatDirection; jens@0: jens@0: typedef enum { jens@0: iChatTransferStatusPreparing = 'FTsp', jens@0: iChatTransferStatusWaiting = 'FTsw', jens@0: iChatTransferStatusTransferring = 'FTsg', jens@0: iChatTransferStatusFinalizing = 'FTsz', jens@0: iChatTransferStatusFinished = 'FTsf', jens@0: iChatTransferStatusFailed = 'FTse' jens@0: } iChatTransferStatus; jens@0: jens@0: typedef enum { jens@0: iChatAvTypeAudio = 'ICAa', jens@0: iChatAvTypeVideo = 'ICAv' jens@0: } iChatAvType; jens@0: jens@0: typedef enum { jens@0: iChatChatTypeInstantMessage = 'ICim', jens@0: iChatChatTypeDirectInstantMessage = 'ICdi', jens@0: iChatChatTypeChatRoom = 'ICcr' jens@0: } iChatChatType; jens@0: jens@0: typedef enum { jens@0: iChatJoinStateNotJoined = 'ICJc', jens@0: iChatJoinStateJoining = 'ICJg', jens@0: iChatJoinStateJoined = 'ICJj' jens@0: } iChatJoinState; jens@0: jens@0: typedef enum { jens@0: iChatAvConnectionStatusInvited = 'ICAi', jens@0: iChatAvConnectionStatusWaiting = 'ICAw', jens@0: iChatAvConnectionStatusConnecting = 'ICAx', jens@0: iChatAvConnectionStatusConnected = 'ICAc', jens@0: iChatAvConnectionStatusEnded = 'ICAn' jens@0: } iChatAvConnectionStatus; jens@0: jens@0: jens@0: jens@0: /* jens@0: * Standard Suite jens@0: */ jens@0: jens@0: // A scriptable object. jens@0: @interface iChatItem : SBObject jens@0: jens@0: @property (copy) NSDictionary *properties; // All of the object's properties. jens@0: jens@0: - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. jens@0: - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document. jens@0: - (void) delete; // Delete an object. jens@0: - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. jens@0: - (BOOL) exists; // Verify if an object exists. jens@0: - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location. jens@0: jens@0: @end jens@0: jens@0: // The application's top-level scripting object. jens@0: @interface iChatApplication : SBApplication jens@0: jens@0: - (SBElementArray *) documents; jens@0: - (SBElementArray *) windows; jens@0: jens@0: @property (copy, readonly) NSString *name; // The name of the application. jens@0: @property (readonly) BOOL frontmost; // Is this the frontmost (active) application? jens@0: @property (copy, readonly) NSString *version; // The version of the application. jens@0: jens@0: - (void) open:(NSArray *)x; // Open a document. jens@0: - (void) print:(NSURL *)x; // Print an object. jens@0: - (void) quitSaving:(iChatSaveOptions)saving; // Quit the application. jens@0: - (void) invite:(NSArray *)x to:(id)to withMessage:(NSString *)withMessage; // Invites a buddy to join an existing chat. jens@0: - (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. jens@0: - (void) logOut; // Logs out of a service, or all services if none is specified. jens@0: - (void) send:(id)x to:(id)to; // Sends a message or file to a buddy or to a chat. jens@0: - (void) storeRecentPicture; // Stores the currently set buddy picture into your recent pictures. jens@0: - (void) showChatChooserFor:(iChatBuddy *)for_; // displays a dialog in iChat to start a new chat with the specified buddy jens@0: jens@0: @end jens@0: jens@0: // A color. jens@0: @interface iChatColor : SBObject jens@0: jens@0: - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. jens@0: - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document. jens@0: - (void) delete; // Delete an object. jens@0: - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. jens@0: - (BOOL) exists; // Verify if an object exists. jens@0: - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location. jens@0: jens@0: @end jens@0: jens@0: // An iChat document. jens@0: @interface iChatDocument : SBObject jens@0: jens@0: @property (copy, readonly) NSString *name; // The document's name. jens@0: @property (readonly) BOOL modified; // Has the document been modified since the last save? jens@0: @property (copy, readonly) NSURL *file; // The document's location on disk. jens@0: jens@0: - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. jens@0: - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document. jens@0: - (void) delete; // Delete an object. jens@0: - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. jens@0: - (BOOL) exists; // Verify if an object exists. jens@0: - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location. jens@0: jens@0: @end jens@0: jens@0: // A window. jens@0: @interface iChatWindow : SBObject jens@0: jens@0: @property (copy, readonly) NSString *name; // The full title of the window. jens@0: - (NSInteger) id; // The unique identifier of the window. jens@0: @property NSInteger index; // The index of the window, ordered front to back. jens@0: @property NSRect bounds; // The bounding rectangle of the window. jens@0: @property (readonly) BOOL closeable; // Whether the window has a close box. jens@0: @property (readonly) BOOL minimizable; // Whether the window can be minimized. jens@0: @property BOOL minimized; // Whether the window is currently minimized. jens@0: @property (readonly) BOOL resizable; // Whether the window can be resized. jens@0: @property BOOL visible; // Whether the window is currently visible. jens@0: @property (readonly) BOOL zoomable; // Whether the window can be zoomed. jens@0: @property BOOL zoomed; // Whether the window is currently zoomed. jens@0: @property (copy, readonly) iChatDocument *document; // The document whose contents are being displayed in the window. jens@0: jens@0: - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. jens@0: - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document. jens@0: - (void) delete; // Delete an object. jens@0: - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. jens@0: - (BOOL) exists; // Verify if an object exists. jens@0: - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location. jens@0: jens@0: @end jens@0: jens@0: jens@0: jens@0: /* jens@0: * Text Suite jens@0: */ jens@0: jens@0: // Rich (styled) text jens@0: @interface iChatRichText : SBObject jens@0: jens@0: - (SBElementArray *) characters; jens@0: - (SBElementArray *) paragraphs; jens@0: - (SBElementArray *) words; jens@0: - (SBElementArray *) attributeRuns; jens@0: - (SBElementArray *) attachments; jens@0: jens@0: @property (copy) NSColor *color; // The color of the first character. jens@0: @property (copy) NSString *font; // The name of the font of the first character. jens@0: @property double size; // The size in points of the first character. jens@0: jens@0: - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. jens@0: - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document. jens@0: - (void) delete; // Delete an object. jens@0: - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. jens@0: - (BOOL) exists; // Verify if an object exists. jens@0: - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location. jens@0: jens@0: @end jens@0: jens@0: // This subdivides the text into characters. jens@0: @interface iChatCharacter : SBObject jens@0: jens@0: - (SBElementArray *) characters; jens@0: - (SBElementArray *) paragraphs; jens@0: - (SBElementArray *) words; jens@0: - (SBElementArray *) attributeRuns; jens@0: - (SBElementArray *) attachments; jens@0: jens@0: @property (copy) NSColor *color; // The color of the first character. jens@0: @property (copy) NSString *font; // The name of the font of the first character. jens@0: @property NSInteger size; // The size in points of the first character. jens@0: jens@0: - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. jens@0: - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document. jens@0: - (void) delete; // Delete an object. jens@0: - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. jens@0: - (BOOL) exists; // Verify if an object exists. jens@0: - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location. jens@0: jens@0: @end jens@0: jens@0: // This subdivides the text into paragraphs. jens@0: @interface iChatParagraph : SBObject jens@0: jens@0: - (SBElementArray *) characters; jens@0: - (SBElementArray *) paragraphs; jens@0: - (SBElementArray *) words; jens@0: - (SBElementArray *) attributeRuns; jens@0: - (SBElementArray *) attachments; jens@0: jens@0: @property (copy) NSColor *color; // The color of the first character. jens@0: @property (copy) NSString *font; // The name of the font of the first character. jens@0: @property NSInteger size; // The size in points of the first character. jens@0: jens@0: - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. jens@0: - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document. jens@0: - (void) delete; // Delete an object. jens@0: - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. jens@0: - (BOOL) exists; // Verify if an object exists. jens@0: - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location. jens@0: jens@0: @end jens@0: jens@0: // This subdivides the text into words. jens@0: @interface iChatWord : SBObject jens@0: jens@0: - (SBElementArray *) characters; jens@0: - (SBElementArray *) paragraphs; jens@0: - (SBElementArray *) words; jens@0: - (SBElementArray *) attributeRuns; jens@0: - (SBElementArray *) attachments; jens@0: jens@0: @property (copy) NSColor *color; // The color of the first character. jens@0: @property (copy) NSString *font; // The name of the font of the first character. jens@0: @property NSInteger size; // The size in points of the first character. jens@0: jens@0: - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. jens@0: - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document. jens@0: - (void) delete; // Delete an object. jens@0: - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. jens@0: - (BOOL) exists; // Verify if an object exists. jens@0: - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location. jens@0: jens@0: @end jens@0: jens@0: // This subdivides the text into chunks that all have the same attributes. jens@0: @interface iChatAttributeRun : SBObject jens@0: jens@0: - (SBElementArray *) characters; jens@0: - (SBElementArray *) paragraphs; jens@0: - (SBElementArray *) words; jens@0: - (SBElementArray *) attributeRuns; jens@0: - (SBElementArray *) attachments; jens@0: jens@0: @property (copy) NSColor *color; // The color of the first character. jens@0: @property (copy) NSString *font; // The name of the font of the first character. jens@0: @property NSInteger size; // The size in points of the first character. jens@0: jens@0: - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. jens@0: - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document. jens@0: - (void) delete; // Delete an object. jens@0: - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. jens@0: - (BOOL) exists; // Verify if an object exists. jens@0: - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location. jens@0: jens@0: @end jens@0: jens@0: // Represents an inline text attachment. This class is used mainly for make commands. jens@0: @interface iChatAttachment : iChatRichText jens@0: jens@0: @property (copy, readonly) NSURL *file; // The path to the file for the attachment jens@0: jens@0: jens@0: @end jens@0: jens@0: jens@0: jens@0: /* jens@0: * iChat Suite jens@0: */ jens@0: jens@0: // iChat application. jens@0: @interface iChatApplication (IChatSuite) jens@0: jens@0: - (SBElementArray *) buddies; jens@0: - (SBElementArray *) services; jens@0: - (SBElementArray *) fileTransfers; jens@0: - (SBElementArray *) chats; jens@0: - (SBElementArray *) textChats; jens@0: - (SBElementArray *) audioChats; jens@0: - (SBElementArray *) videoChats; jens@0: jens@0: @property (readonly) NSInteger idleTime; // Time in seconds that I have been idle. jens@0: @property (copy) NSImage *image; // My image as it appears in all services. jens@0: @property (copy) NSString *statusMessage; // My status message, visible to other people while I am online. jens@0: @property iChatMyStatus status; // My status on all services. jens@0: @property (copy) iChatAudioChat *activeAvChat; // The currently active audio or video chat. jens@0: jens@0: @end jens@0: jens@0: // A buddy on a service. jens@0: @interface iChatBuddy : iChatItem jens@0: jens@0: - (NSString *) id; // The buddy's service and handle. For example: AIM:JohnDoe007 jens@0: @property (copy, readonly) iChatService *service; // The service on which this buddy exists. jens@0: @property (copy, readonly) NSString *name; // The buddy's name as it appears in the buddy list. jens@0: @property (copy, readonly) NSString *handle; // The buddy's online account name. jens@0: @property (readonly) iChatAccountStatus status; // The buddy's current status. jens@0: @property (copy, readonly) NSString *statusMessage; // The buddy's current status message. jens@0: @property (readonly) NSInteger idleTime; // The time in seconds the buddy has been idle. jens@0: @property (copy, readonly) NSArray *capabilities; // The buddy's messaging capabilities. jens@0: @property (copy, readonly) NSImage *image; // The buddy's custom image. jens@0: @property (copy, readonly) NSString *firstName; // The first name from this buddy's Address Book card, if available jens@0: @property (copy, readonly) NSString *lastName; // The last name from this buddy's Address Book card, if available jens@0: @property (copy, readonly) NSString *fullName; // The full name from this buddy's Address Book card, if available jens@0: jens@0: jens@0: @end jens@0: jens@0: // A service that can be logged in from this system jens@0: @interface iChatService : iChatItem jens@0: jens@0: - (SBElementArray *) buddies; jens@0: - (SBElementArray *) chats; jens@0: jens@0: - (NSString *) id; // A guid identifier for this service. jens@0: @property (copy) NSString *name; // The name of this service as defined in Account preferences description field jens@0: @property BOOL enabled; // Is the service enabled? jens@0: @property (readonly) iChatConnectionStatus status; // The connection status for this account. jens@0: @property (readonly) iChatServiceType serviceType; // The type of protocol for this service jens@0: jens@0: - (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. jens@0: - (void) logOut; // Logs out of a service, or all services if none is specified. jens@0: jens@0: @end jens@0: jens@0: // An audio, video, or text chat. jens@0: @interface iChatChat : SBObject jens@0: jens@0: - (NSString *) id; // A guid identifier for this chat. jens@0: @property (copy, readonly) iChatService *service; // The service which is participating in this chat. jens@0: @property (copy, readonly) NSArray *participants; // Other participants of this chat. This property may be specified at time of creation. jens@0: @property (readonly) BOOL secure; // Is this chat secure? jens@0: @property (readonly) BOOL invitation; // Is this an invitation to a chat? jens@0: @property (readonly) BOOL active; // Is this chat currently active? jens@0: @property (copy, readonly) NSDate *started; // The date on which this chat started. jens@0: @property (copy, readonly) NSDate *updated; // The date when this chat was last updated. jens@0: jens@0: - (void) closeSaving:(iChatSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. jens@0: - (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save a document. jens@0: - (void) delete; // Delete an object. jens@0: - (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. jens@0: - (BOOL) exists; // Verify if an object exists. jens@0: - (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location. jens@0: - (void) accept; // Accepts an incoming text, audio, or video chat invitation, or file transfer jens@0: - (void) decline; // Declines an incoming text, audio, or video chat invitation, or file transfer jens@0: jens@0: @end jens@0: jens@0: // A text chat. jens@0: @interface iChatTextChat : iChatChat jens@0: jens@0: @property (copy, readonly) NSString *subject; // The subject of this chat, if available. jens@0: @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. jens@0: @property (readonly) iChatJoinState joinState; // How you are joined to this chat jens@0: @property (copy, readonly) NSString *name; // The address or room name of this chat. This property may be specified at time of creation. jens@0: @property (readonly) iChatChatType chatType; // The type of this chat. jens@0: jens@0: jens@0: @end jens@0: jens@0: // An audio or video chat. jens@0: @interface iChatAudioChat : iChatChat jens@0: jens@0: @property (readonly) iChatScreenSharing screenSharing; // Type of screen sharing session taking place within this chat. jens@0: @property BOOL muted; // Is the chat muted? jens@0: @property (readonly) iChatAvConnectionStatus avConnectionStatus; // The connection state for this av chat. jens@0: jens@0: - (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. jens@0: - (void) stopRecording; // Ends recording of an audio or video chat. jens@0: jens@0: @end jens@0: jens@0: @interface iChatVideoChat : iChatAudioChat jens@0: jens@0: @property BOOL paused; // Is the chat paused? jens@0: @property BOOL showingFullScreen; // Is the chat being displayed in full screen mode? jens@0: @property BOOL showingLocalVideo; // Is the local video preview being displayed? jens@0: jens@0: - (void) takeSnapshot; // Takes a snapshot of a video chat and saves it to a desktop. jens@0: jens@0: @end jens@0: jens@0: // A file being sent or received jens@0: @interface iChatFileTransfer : iChatItem jens@0: jens@0: - (NSString *) id; // The guid for this file transfer jens@0: @property (copy, readonly) NSString *name; // The name of this file jens@0: @property (copy, readonly) NSURL *file; // The local path to this file transfer jens@0: @property (readonly) iChatDirection direction; // The direction in which this file is being sent jens@0: @property (copy, readonly) iChatService *service; // The service on which this file transfer is taking place jens@0: @property (copy, readonly) iChatBuddy *buddy; // The account participating in this file transfer jens@0: @property (readonly) BOOL secure; // Is this file transfer secure? jens@0: @property (readonly) NSInteger fileSize; // The total size in bytes of the completed file transfer jens@0: @property (readonly) NSInteger fileProgress; // The number of bytes that have been transferred jens@0: @property (readonly) iChatTransferStatus transferStatus; // The current status of this file transfer jens@0: @property (copy, readonly) NSDate *started; // The date that this file transfer started jens@0: jens@0: - (void) accept; // Accepts an incoming text, audio, or video chat invitation, or file transfer jens@0: - (void) decline; // Declines an incoming text, audio, or video chat invitation, or file transfer jens@0: jens@0: @end jens@0: