Mac Developer Library

Developer

AddressBook Framework Reference 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

    Objective-C

    typedef struct OpaqueABPicker *ABPickerRef;

    Import Statement

    Objective-C

    @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

    Objective-C

    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

    Objective-C

    @import AddressBook;

    Availability

    Available in OS X v10.3 and later.

Constants

  • This is the People Picker event class.

    Declaration

    Objective-C

    enum { kEventClassABPeoplePicker = 'abpp' };

    Constants

    • kEventClassABPeoplePicker

      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

    Objective-C

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

    Constants

    • kEventABPeoplePickerGroupSelectionChanged

      kEventABPeoplePickerGroupSelectionChanged

      The selection in the group list changed.

      Available in OS X v10.3 and later.

    • kEventABPeoplePickerNameSelectionChanged

      kEventABPeoplePickerNameSelectionChanged

      The selection in the name list changed.

      Available in OS X v10.3 and later.

    • kEventABPeoplePickerValueSelectionChanged

      kEventABPeoplePickerValueSelectionChanged

      The selection in a multi-value property changed.

      Available in OS X v10.3 and later.

    • kEventABPeoplePickerDisplayedPropertyChanged

      kEventABPeoplePickerDisplayedPropertyChanged

      The displayed property in the record list changed.

      Available in OS X v10.3 and later.

    • kEventABPeoplePickerGroupDoubleClicked

      kEventABPeoplePickerGroupDoubleClicked

      A group in the group list was double-clicked.

      Available in OS X v10.3 and later.

    • kEventABPeoplePickerNameDoubleClicked

      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:

    • GetEventParameter ( inEvent, kEventParamABPickerRef,
    • typeCFTypeRef, NULL, sizeof(ABPickerRef),
    • 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

    Objective-C

    enum { kEventParamABPickerRef = 'abpp' };

    Constants

    • kEventParamABPickerRef

      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

    Objective-C

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

    Constants

    • kABPickerSingleValueSelection

      kABPickerSingleValueSelection

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

      Available in OS X v10.3 and later.

    • kABPickerMultipleValueSelection

      kABPickerMultipleValueSelection

      Allows the user to select multiple values.

      Available in OS X v10.3 and later.

    • kABPickerAllowGroupSelection

      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

      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.