Mac Developer Library

Developer

AddressBook Framework Reference ABActionDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

ABActionDelegate

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:. More...

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


import AddressBook @import AddressBook;

Availability


Available in OS X v10.3 and later.
  • Sent to the delegate to perform the action.

    Declaration

    Swift

    func performActionForPerson(_ person: ABPerson!, identifier identifier: String!)

    Objective-C

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

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

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

    Declaration

    Swift

    func actionProperty() -> String!

    Objective-C

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

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

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

    Declaration

    Swift

    func shouldEnableActionForPerson(_ person: ABPerson!, identifier identifier: String!) -> Bool

    Objective-C

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

    YEStrue if the action is applicable; otherwise, NOfalse.

    Discussion

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

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

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

    Declaration

    Swift

    func titleForPerson(_ person: ABPerson!, identifier identifier: String!) -> String!

    Objective-C

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

    Import Statement

    import AddressBook

    Availability

    Available in OS X v10.3 and later.