(informal protocol)
| Framework | /System/Library/Frameworks/AddressBook.framework |
| Availability | Available in Mac OS X v10.3 and later. |
| Companion guide | |
| Declared in | ABActions.h |
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.
Sent to the delegate to request the property the action applies to.
- (NSString *)actionProperty
The property that the action applies to.
See “Constants” in ABPerson Class Reference for the properties for person records, and “Constants” in ABGroup Class Reference for the properties for group records.
ABActions.hSent to the delegate to perform the action.
- (void)performActionForPerson:(ABPerson *)person identifier:(NSString *)identifier
The person on which the action will be taken.
The unique identifier of the selected value.
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.
ABActions.hSent to the delegate to determine whether the action should be enabled.
- (BOOL)shouldEnableActionForPerson:(ABPerson *)person identifier:(NSString *)identifier
The person on which the action will be taken.
The unique identifier of the selected value.
YES if the action is applicable; otherwise, NO.
If the property returned by actionProperty is a multivalue property, identifier contains the unique identifier of the value selected.
ABActions.hSent to the delegate to request the title of the menu item for the action.
- (NSString *)titleForPerson:(ABPerson *)person identifier:(NSString *)identifier
The person on which the action will be taken.
The unique identifier of the value for which the menu item will be displayed.
The title of the menu item for the action.
If the property returned by actionProperty is a multivalue property, identifier contains the unique identifier of the value selected.
ABActions.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-11-17)