Mac Developer Library

Developer

AddressBook Framework Reference Address Book Actions Reference

Options
Deployment Target:

On This Page

Address Book Actions Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import AddressBook;

The Address Book action callbacks allow you to populate the rollover menus of the Address Book application with custom items. You do this by writing an Address Book action plug-in that implements a function named ABActionRegisterCallbacks. This function registers a set of callback functions that are invoked by Address Book. The plug-in’s CFBundle must also implement the callback functions.

This is an example implementation of the ABActionRegisterCallbacks function:

  • ABActionCallbacks* ABActionRegisterCallbacks(void)
  • {
  • ABActionCallbacks *callbacks;
  • callbacks = malloc(sizeof(ABActionCallbacks));
  • if (callbacks == NULL)
  • return NULL;
  • callbacks->version = 0;
  • callbacks->property = actionProperty;
  • callbacks->title = actionTitle;
  • callbacks->enabled = actionEnabled;
  • callbacks->selected = actionSelected;
  • return callbacks;
  • }

Each action plug-in can implement only one action. Actions can only apply to items with labels.

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.

Callbacks

Data Types