Mac Developer Library

Developer

Address Book C Framework Reference for Mac ABPicker C Reference

Options
Deployment Target:

On This Page

ABPicker C Reference

The ABPicker opaque type allows you create and manipulate people-picker windows in an application’s user interface.

Use ABPickerCreate to create a people-picker window and ABPickerSetVisibility to make it visible. Use ABPickerAddProperty to add properties to the record list. Users can specify which property to display by clicking the property column in the record list and choosing the desired property.

Functions

Data Types

  • A reference to an ABPicker object.

    Declaration

    typedef struct OpaqueABPicker *ABPickerRef;

    Import Statement

    @import AddressBook;

    Availability

    Available in OS X v10.3 and later.

  • A bitfield used to specify the selection behavior for the values of multi-value properties.

    Declaration

    typedef OptionBits ABPickerAttributes;

    Discussion

    Use the constants listed in People-Picker Selection Behavior.

    When multiple behaviors are selected, the most restrictive behavior is used. The default behavior is single-value selection (kABPickerSingleValueSelection).

    Import Statement

    @import AddressBook;

    Availability

    Available in OS X v10.3 and later.

Constants

  • This is the People Picker event class.

    Declaration

    enum { kEventClassABPeoplePicker = 'abpp' };

    Constants

    • kEventClassABPeoplePicker

      The class of people-picker events.

      Available in OS X v10.3 and later.

    Availability

    Available in OS X v10.3 and later.

  • Constants used by ABPickerAttributes to specify People Picker event types.

    Declaration

    enum { kEventABPeoplePickerGroupSelectionChanged = 1, kEventABPeoplePickerNameSelectionChanged = 2, kEventABPeoplePickerValueSelectionChanged = 3, kEventABPeoplePickerDisplayedPropertyChanged = 4, kEventABPeoplePickerGroupDoubleClicked = 5, kEventABPeoplePickerNameDoubleClicked = 6, };

    Constants

    • kEventABPeoplePickerGroupSelectionChanged

      The selection in the group list changed.

      Available in OS X v10.3 and later.

    • kEventABPeoplePickerNameSelectionChanged

      The selection in the name list changed.

      Available in OS X v10.3 and later.

    • kEventABPeoplePickerValueSelectionChanged

      The selection in a multi-value property changed.

      Available in OS X v10.3 and later.

    • kEventABPeoplePickerDisplayedPropertyChanged

      The displayed property in the record list changed.

      Available in OS X v10.3 and later.

    • kEventABPeoplePickerGroupDoubleClicked

      A group in the group list was double-clicked.

      Available in OS X v10.3 and later.

    • kEventABPeoplePickerNameDoubleClicked

      A record in the record list was double-clicked.

      Available in OS X v10.3 and later.

    Discussion

    A people-picker window delegate is notified when the events defined earlier occur. People Picker events contain an event parameter, which contains the ABPicker object. Use the following code to obtain the ABPicker object:

    1. GetEventParameter ( inEvent, kEventParamABPickerRef,
    2. typeCFTypeRef, NULL, sizeof(ABPickerRef),
    3. NULL, &outPickerRef );

    Availability

    Available in OS X v10.3 and later.

  • Use this constant to obtain the ABPicker object from a People Picker event.

    Declaration

    enum { kEventParamABPickerRef = 'abpp' };

    Constants

    • kEventParamABPickerRef

      The parameter name of people-picker events.

      Available in OS X v10.3 and later.

    Availability

    Available in OS X v10.3 and later.

  • Constants to specify the selection behavior for the values of multi-value properties.

    Declaration

    enum { kABPickerSingleValueSelection = 1 << 0, kABPickerMultipleValueSelection = 1 << 1, kABPickerAllowGroupSelection = 1 << 2, kABPickerAllowMultipleSelection = 1 << 3 };

    Constants

    • kABPickerSingleValueSelection

      Allows the user to select a single value. This is the default behavior.

      Available in OS X v10.3 and later.

    • kABPickerMultipleValueSelection

      Allows the user to select multiple values.

      Available in OS X v10.3 and later.

    • kABPickerAllowGroupSelection

      Allows the user to select entire groups in the groups list. Otherwise at least one record in the group is selected when the user selects a group. The default is not to allow group selection.

      Available in OS X v10.3 and later.

    • kABPickerAllowMultipleSelection

      Allows the user to select more than one group or record at a time. The default is to allow multiple selection.

      Available in OS X v10.3 and later.