|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.blackberry.api.pdap.contactlinking.LinkedContactUtilities
public final class LinkedContactUtilities
Provides utility methods for manipulating the contact list from other applications.
Method Summary | ||
---|---|---|
|
static String |
getContactIdFromLinkedContact(BlackBerryContact contact,
long applicationId)
Returns the contact ID for the LinkableContact whose BlackBerryContact is supplied. |
|
static BlackBerryContact |
getContactLinkCandidate(LinkableContact userData)
Returns the BlackBerryContact that is the best candidate to link
the supplied LinkableContact with. |
|
static BlackBerryContact |
getLinkedContact(LinkableContact userData)
Returns the BlackBerryContact that is linked with the supplied
LinkableContact . |
|
static boolean |
isContactLinked(BlackBerryContact contact,
long applicationId)
Checks if the supplied BlackBerryContact has a link for the supplied application. |
|
static BlackBerryContact |
linkContact(BlackBerryContact contact,
LinkableContact userData)
Creates a link between a BlackBerryContact and a LinkableContact . |
|
static void |
registerAddressBookFieldFactory(AddressBookFieldFactory factory,
long applicationId)
Deprecated. use LinkedContactUtilities.registerLinkedContactInfoProvider(LinkedContactInfoProvider, long, int) . |
|
static void |
registerLinkedContactInfoProvider(LinkedContactInfoProvider provider,
long applicationId,
int appGroupId)
Registers a LinkedContactInfoProvider for providing information about a linked contact. |
|
static void |
registerMenuItems(ApplicationMenuItem[] items,
long applicationId,
int appGroupId,
ApplicationDescriptor app)
Takes an array of menu items that you want to display in the menu when a linked contact is viewed in the Contacts application. |
|
static BlackBerryContact |
unlinkContact(BlackBerryContact contact,
long applicationId)
Removes the link between the supplied BlackBerryContact and an application. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void registerMenuItems(ApplicationMenuItem[] items, long applicationId, int appGroupId, ApplicationDescriptor app)
items
is null or an empty array, the menu items for the specified
application ID will be deleted.
items
- An array of ApplicationMenuItems to display.applicationId
- Your application ID.appGroupId
- The group ID of your application. Should be one of
COMPOSE_IM_MENU_GROUP
,
COMPOSE_SN_MENU_GROUP
or
COMPOSE_OTHER_MENU_GROUP
.app
- An ApplicationDescriptor
that describes your application.
IllegalArgumentException
- if appGroupId
is not one of
COMPOSE_IM_MENU_GROUP
,
COMPOSE_SN_MENU_GROUP
or
COMPOSE_OTHER_MENU_GROUP
.
SecurityException
- if app
is not the descriptor of the
application that called this method or if the calling application is not
allowed to access the PIM capabilities on the device.
NullPointerException
- if items
is null.public static void registerAddressBookFieldFactory(AddressBookFieldFactory factory, long applicationId)
LinkedContactUtilities.registerLinkedContactInfoProvider(LinkedContactInfoProvider, long, int)
.
factory
- The factory used to create the field.applicationId
- Your application ID.
NullPointerException
- if factory
is null.
SecurityException
- if the calling application is not allowed to access the
PIM capabilities on the device.public static void registerLinkedContactInfoProvider(LinkedContactInfoProvider provider, long applicationId, int appGroupId)
provider
- The LinkedContactInfoProvider to provide linked contact information.applicationId
- Your application ID.appGroupId
- The group ID of your application. Should be one of
COMPOSE_IM_MENU_GROUP
,
COMPOSE_SN_MENU_GROUP
or
COMPOSE_OTHER_MENU_GROUP
.
SecurityException
IllegalArgumentException
- if appGroupId
is not one of
COMPOSE_IM_MENU_GROUP
,
COMPOSE_SN_MENU_GROUP
or
COMPOSE_OTHER_MENU_GROUP
.public static BlackBerryContact getContactLinkCandidate(LinkableContact userData)
BlackBerryContact
that is the best candidate to link
the supplied LinkableContact
with. This method first
matches by the contact's email address, then by a phone number.
If no match is found, this method returns null.
userData
- The data to look for in the contact list.
BlackBerryContact
, or null if no
match is found. If multiple contacts have the same email
address or phone number, the link candidate may not be the one the
user wants to link to. It is recommended that you confirm the
candidate with the user before linking.
IllegalStateException
- if registerLinkedContactInfoProvider() has not been called
before calling this method.
SecurityException
- if the calling application is not allowed to access the
PIM capabilities on the device.LinkedContactUtilities.registerLinkedContactInfoProvider(LinkedContactInfoProvider, long, int)
public static BlackBerryContact getLinkedContact(LinkableContact userData)
BlackBerryContact
that is linked with the supplied
LinkableContact
. If the LinkableContact
is not
linked, this method returns null.
userData
- The LinkableContact
whose linked
BlackBerryContact
you want to see.
BlackBerryContact
, or null if there is no link.
SecurityException
- if the calling application is not allowed to access the
PIM capabilities on the device.public static String getContactIdFromLinkedContact(BlackBerryContact contact, long applicationId)
LinkableContact
whose BlackBerryContact
is supplied.
contact
- The contact to retrieve the user ID from.applicationId
- The application to get the contact ID for.
IllegalArgumentException
- if contact
is not linked.
NullPointerException
- if contact
is null.
SecurityException
- if the calling application is not allowed to access the
PIM capabilities on the device.public static boolean isContactLinked(BlackBerryContact contact, long applicationId)
BlackBerryContact
has a link for the supplied application.
contact
- The contact to check.applicationId
- The unique ID of the application.
SecurityException
- if the calling application is not allowed to access the
PIM capabilities on the device.public static BlackBerryContact linkContact(BlackBerryContact contact, LinkableContact userData)
BlackBerryContact
and a LinkableContact
.
contact
- The BlackBerryContact
to link with.userData
- The LinkableContact
to link.
BlackBerryContact
, including the linked data.
IllegalArgumentException
- if contact
is already linked for userData
's application
or if userData
's contact ID is null
or if userData
is already linked to another BlackBerryContact
.
IllegalStateException
- if registerLinkedContactInfoProvider() has not been called
before calling this method.
NullPointerException
- if this method is invoked with null arguments.
SecurityException
- if the calling application is not allowed to access the
PIM capabilities on the device.LinkedContactUtilities.registerLinkedContactInfoProvider(LinkedContactInfoProvider, long, int)
public static BlackBerryContact unlinkContact(BlackBerryContact contact, long applicationId)
BlackBerryContact
and an application.
contact
- The BlackBerryContact
to unlink.applicationId
- The unique ID of the application to remove the link for.
BlackBerryContact
with the link data removed.
IllegalArgumentException
- if contact
is not linked for applicationId
or if contact
is null.
SecurityException
- if the calling application is not allowed to access the
PIM capabilities on the device.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.