Mac Developer Library

Developer

IMServicePlugIn Framework Reference IMServicePlugInMessage Class Reference

Options
Deployment Target:

On This Page
Language:

IMServicePlugInMessage

Instances of the IMServicePlugInMessage class represent instant messages.

Inheritance


Conforms To


Import Statement


Swift

import IMServicePlugIn

Objective-C

@import IMServicePlugIn;

Availability


Available in OS X v10.7 and later.
  • Initializes a newly created message with the specified content.

    Declaration

    Swift

    init!(content content: NSAttributedString!)

    Objective-C

    - (id)initWithContent:(NSAttributedString *)content

    Parameters

    content

    The message’s content.

    Return Value

    The newly initialized message.

    Import Statement

    Objective-C

    @import IMServicePlugIn;

    Swift

    import IMServicePlugIn

    Availability

    Available in OS X v10.7 and later.

  • Initializes a newly created message with the specified content and date.

    Declaration

    Swift

    init!(content content: NSAttributedString!, date date: NSDate!)

    Objective-C

    - (id)initWithContent:(NSAttributedString *)content date:(NSDate *)date

    Parameters

    content

    The message’s content.

    date

    The message’s date stamp.

    Return Value

    The newly initialized message.

    Discussion

    For the text attributes that can be used in the message content, see Rich-Text Message Attributes.

    The date stamp is displayed to the user in the transcript—this is typically the date that the message was sent.

    Import Statement

    Objective-C

    @import IMServicePlugIn;

    Swift

    import IMServicePlugIn

    Availability

    Available in OS X v10.8 and later.

  • Creates and returns a message with the specified content.

    Declaration

    Swift

    class func servicePlugInMessageWithContent(_ content: NSAttributedString!) -> AnyObject!

    Objective-C

    + (id)servicePlugInMessageWithContent:(NSAttributedString *)content

    Parameters

    content

    The message’s content.

    Return Value

    An IMServicePlugInMessage object with the specified content.

    Discussion

    For the text attributes that can be used in the message content, see Rich-Text Message Attributes.

    Import Statement

    Objective-C

    @import IMServicePlugIn;

    Swift

    import IMServicePlugIn

    Availability

    Available in OS X v10.7 and later.

  • Creates and returns a message with the specified content.

    Declaration

    Swift

    class func servicePlugInMessageWithContent(_ content: NSAttributedString!, date date: NSDate!) -> AnyObject!

    Objective-C

    + (id)servicePlugInMessageWithContent:(NSAttributedString *)content date:(NSDate *)date

    Parameters

    content

    The message’s content.

    date

    The message’s date stamp.

    Return Value

    An IMServicePlugInMessage object with the specified content and date.

    Discussion

    For the text attributes that can be used in the message content, see Rich-Text Message Attributes.

    The date stamp is displayed to the user in the transcript—this is typically the date that the message was sent.

    Import Statement

    Objective-C

    @import IMServicePlugIn;

    Swift

    import IMServicePlugIn

    Availability

    Available in OS X v10.8 and later.

  • content content Property

    The content of the message.

    Declaration

    Swift

    @NSCopying var content: NSAttributedString!

    Objective-C

    @property(nonatomic, copy) NSAttributedString *content

    Discussion

    For the text attributes that can be used in the message content, see Rich-Text Message Attributes.

    Import Statement

    Objective-C

    @import IMServicePlugIn;

    Swift

    import IMServicePlugIn

    Availability

    Available in OS X v10.7 and later.

  • date date Property

    The message’s date stamp.

    Declaration

    Swift

    @NSCopying var date: NSDate!

    Objective-C

    @property(nonatomic, copy) NSDate *date

    Discussion

    The date stamp is displayed to the user in the transcript—this is typically the date that the message was sent.

    Import Statement

    Objective-C

    @import IMServicePlugIn;

    Swift

    import IMServicePlugIn

    Availability

    Available in OS X v10.8 and later.

  • guid guid Property

    The unique identifier of the message. (read-only)

    Declaration

    Swift

    var guid: String! { get }

    Objective-C

    @property(readonly) NSString *guid

    Import Statement

    Objective-C

    @import IMServicePlugIn;

    Swift

    import IMServicePlugIn

    Availability

    Available in OS X v10.7 and later.

  • Text attributes for rich-text messages.

    Declaration

    Swift

    let IMAttributeFontFamily: NSString! let IMAttributeFontSize: NSString! let IMAttributeItalic: NSString! let IMAttributeBold: NSString! let IMAttributeUnderline: NSString! let IMAttributeStrikethrough: NSString! let IMAttributeLink: NSString! let IMAttributePreformatted: NSString! let IMAttributeBaseWritingDirection: NSString! let IMAttributeForegroundColor: NSString! let IMAttributeBackgroundColor: NSString! let IMAttributeMessageBackgroundColor: NSString!

    Objective-C

    NSString * const IMAttributeFontFamily; NSString * const IMAttributeFontSize; NSString * const IMAttributeItalic; NSString * const IMAttributeBold; NSString * const IMAttributeUnderline; NSString * const IMAttributeStrikethrough; NSString * const IMAttributeLink; NSString * const IMAttributePreformatted; NSString * const IMAttributeBaseWritingDirection; NSString * const IMAttributeForegroundColor; NSString * const IMAttributeBackgroundColor; NSString * const IMAttributeMessageBackgroundColor;

    Constants

    • IMAttributeFontFamily

      IMAttributeFontFamily

      The font family. (NSString)

      Available in OS X v10.7 and later.

    • IMAttributeFontSize

      IMAttributeFontSize

      The font size. (NSNumber)

      Available in OS X v10.7 and later.

    • IMAttributeItalic

      IMAttributeItalic

      Italic style. (Boolean value as an NSNumber)

      Available in OS X v10.7 and later.

    • IMAttributeBold

      IMAttributeBold

      Bold style. (Boolean value as an NSNumber)

      Available in OS X v10.7 and later.

    • IMAttributeUnderline

      IMAttributeUnderline

      Underlined style. (Boolean value as an NSNumber)

      Available in OS X v10.7 and later.

    • IMAttributeStrikethrough

      IMAttributeStrikethrough

      Struck-through style. (Boolean value as an NSNumber)

      Available in OS X v10.7 and later.

    • IMAttributeLink

      IMAttributeLink

      The URL to link to. (NSURL)

      Available in OS X v10.7 and later.

    • IMAttributePreformatted

      IMAttributePreformatted

      Preformatted text. (Boolean value as an NSNumber)

      If the text is already formatted, the instant messaging agent does not take any action for text that appears to be an emoticon or a URL, or perform any other data detection.

      Available in OS X v10.7 and later.

    • IMAttributeBaseWritingDirection

      IMAttributeBaseWritingDirection

      The base writing direction. (NSNumber)

      Use 1 to indicate right-to-left text and 0 to indicate left-to-right text.

      Available in OS X v10.7 and later.

    • IMAttributeForegroundColor

      IMAttributeForegroundColor

      The foreground color of the text. (Hexadecimal color description as an NSString)

      For example, #FF0033, #555, and #78a9bc are valid values.

      Available in OS X v10.7 and later.

    • IMAttributeBackgroundColor

      IMAttributeBackgroundColor

      The background color behind the text. (Hexadecimal color description as an NSString)

      For example, #FF0033, #555, and #78a9bc are valid values.

      Available in OS X v10.7 and later.

    • IMAttributeMessageBackgroundColor

      IMAttributeMessageBackgroundColor

      The background color of the box or bubble containing the text. (Hexadecimal color description as an NSString)

      For example, #FF0033, #555, and #78a9bc are valid values.

      Available in OS X v10.7 and later.

    Discussion

    These attributes for the message’s content are equivalent to text attributes provided by the AppKit framework for NSAttributedString objects. They are provided by this framework so that instant messaging plug-ins don’t have to link against the entire AppKit framework just to get the attributed string constants.