Mac Developer Library

Developer

Instant Message Service Plug-in Framework Reference IMServicePlugInMessage Class Reference

Options
Deployment Target:

On This Page

IMServicePlugInMessage

Instances of the IMServicePlugInMessage class represent instant messages.

  • Initializes a newly created message with the specified content.

    Declaration

    - (id)initWithContent:(NSAttributedString *)content

    Parameters

    content

    The message’s content.

    Return Value

    The newly initialized message.

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

    Declaration

    - (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.

  • Creates and returns a message with the specified content.

    Declaration

    + (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.

  • Creates and returns a message with the specified content.

    Declaration

    + (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.

  • The content of the message.

    Declaration

    @property(nonatomic, copy) NSAttributedString *content

    Discussion

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

  • The message’s date stamp.

    Declaration

    @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.

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

    Declaration

    @property(readonly) NSString *guid

  • Text attributes for rich-text messages.

    Declaration

    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

      The font family. (NSString)

    • IMAttributeFontSize

      The font size. (NSNumber)

    • IMAttributeItalic

      Italic style. (Boolean value as an NSNumber)

    • IMAttributeBold

      Bold style. (Boolean value as an NSNumber)

    • IMAttributeUnderline

      Underlined style. (Boolean value as an NSNumber)

    • IMAttributeStrikethrough

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

    • IMAttributeLink

      The URL to link to. (NSURL)

    • IMAttributePreformatted

      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.

    • IMAttributeBaseWritingDirection

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

    • IMAttributeForegroundColor

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

    • IMAttributeBackgroundColor

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

    • IMAttributeMessageBackgroundColor

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

    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.