IMServicePlugInMessage Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/IMServicePlugin.framework
Availability
Available in OS X v10.7 and later.
Declared in
IMServicePlugInMessage.h
IMServicePlugInTypes.h

Overview

Instances of the IMServicePlugInMessage class represent instant messages.

Tasks

Creating Messages

Working with Messages

Properties

content

The content of the message.

@property(nonatomic, copy) NSAttributedString *content
Discussion

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

Availability
  • Available in OS X v10.7 and later.
Declared In
IMServicePlugInMessage.h

date

The message’s date stamp.

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

Availability
  • Available in OS X v10.8 and later.
Declared In
IMServicePlugInMessage.h

guid

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

@property(readonly) NSString *guid
Availability
  • Available in OS X v10.7 and later.
Declared In
IMServicePlugInMessage.h

Class Methods

servicePlugInMessageWithContent:

Creates and returns a message with the specified content.

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

Availability
  • Available in OS X v10.7 and later.
Declared In
IMServicePlugInMessage.h

servicePlugInMessageWithContent:date:

Creates and returns a message with the specified content.

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

Availability
  • Available in OS X v10.8 and later.
Declared In
IMServicePlugInMessage.h

Instance Methods

initWithContent:

Initializes a newly created message with the specified content.

- (id)initWithContent:(NSAttributedString *)content
Parameters
content

The message’s content.

Return Value

The newly initialized message.

Availability
  • Available in OS X v10.7 and later.
Declared In
IMServicePlugInMessage.h

initWithContent:date:

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

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

Availability
  • Available in OS X v10.8 and later.
Declared In
IMServicePlugInMessage.h

Constants

Rich-Text Message Attributes

Text attributes for rich-text messages.

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)

Available in OS X v10.7 and later.

Declared in IMServicePlugInTypes.h.

IMAttributeFontSize

The font size. (NSNumber)

Available in OS X v10.7 and later.

Declared in IMServicePlugInTypes.h.

IMAttributeItalic

Italic style. (Boolean value as an NSNumber)

Available in OS X v10.7 and later.

Declared in IMServicePlugInTypes.h.

IMAttributeBold

Bold style. (Boolean value as an NSNumber)

Available in OS X v10.7 and later.

Declared in IMServicePlugInTypes.h.

IMAttributeUnderline

Underlined style. (Boolean value as an NSNumber)

Available in OS X v10.7 and later.

Declared in IMServicePlugInTypes.h.

IMAttributeStrikethrough

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

Available in OS X v10.7 and later.

Declared in IMServicePlugInTypes.h.

IMAttributeLink

The URL to link to. (NSURL)

Available in OS X v10.7 and later.

Declared in IMServicePlugInTypes.h.

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.

Declared in IMServicePlugInTypes.h.

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.

Declared in IMServicePlugInTypes.h.

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.

Declared in IMServicePlugInTypes.h.

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.

Declared in IMServicePlugInTypes.h.

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.

Declared in IMServicePlugInTypes.h.

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.