ABActionDelegate Protocol Reference

(informal protocol)

Framework
/System/Library/Frameworks/AddressBook.framework
Availability
Available in OS X v10.3 and later.
Companion guide
Declared in
ABActions.h

Overview

The ABActionDelegate informal protocol allows you to populate the rollover menus of Address Book with custom items. You do this by implementing an Address Book action plug-in. The plug-in’s NSBundle must implement actionProperty:, titleForPerson:identifier: and performActionForPerson:identifier:.

Each action plug-in can implement only one action. Actions can only apply to items with labels. An action can display a simple window inside the Address Book application; if your action actions needs to do anything else, it should launch your own application to perform the action.

Use Xcode to create Address Book action plug-ins. Place action plug-ins in ~/Library/Address Book Plug-Ins or /Library/Address Book Plug-Ins, depending on the scope you want for the action.

Tasks

Performing Actions

Querying

Instance Methods

actionProperty

Sent to the delegate to request the property the action applies to.

- (NSString *)actionProperty
Return Value

The property that the action applies to.

Discussion

See “The documentation for property-list constants” in Address Book Programming Guide for Mac for the properties for person and group records.

Availability
  • Available in OS X v10.3 and later.
Declared In
ABActions.h

performActionForPerson:identifier:

Sent to the delegate to perform the action.

- (void)performActionForPerson:(ABPerson *)person identifier:(NSString *)identifier
Parameters
person

The person on which the action will be taken.

identifier

The unique identifier of the selected value.

Discussion

If the property returned by actionProperty is a multivalue property, identifier contains the unique identifier of the value selected. The person being displayed in the Address Book application’s card view when the rollover menu is accesses is passed as person.

Availability
  • Available in OS X v10.3 and later.
Declared In
ABActions.h

shouldEnableActionForPerson:identifier:

Sent to the delegate to determine whether the action should be enabled.

- (BOOL)shouldEnableActionForPerson:(ABPerson *)person identifier:(NSString *)identifier
Parameters
person

The person on which the action will be taken.

identifier

The unique identifier of the selected value.

Return Value

YES if the action is applicable; otherwise, NO.

Discussion

If the property returned by actionProperty is a multivalue property, identifier contains the unique identifier of the value selected.

Availability
  • Available in OS X v10.3 and later.
Declared In
ABActions.h

titleForPerson:identifier:

Sent to the delegate to request the title of the menu item for the action.

- (NSString *)titleForPerson:(ABPerson *)person identifier:(NSString *)identifier
Parameters
person

The person on which the action will be taken.

identifier

The unique identifier of the value for which the menu item will be displayed.

Return Value

The title of the menu item for the action.

Discussion

If the property returned by actionProperty is a multivalue property, identifier contains the unique identifier of the value selected.

Availability
  • Available in OS X v10.3 and later.
Declared In
ABActions.h