|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.pim.PIM
net.rim.blackberry.api.pdap.BlackBerryPIM
public abstract class BlackBerryPIM
Class for accessing the PIM databases on a BlackBerry device.
Contains static methods for performing operations on lists.
For more information about the personal information management (PIM) API, refer to The PDA Profile specification (JSR-000075) for the J2ME(TM) Platform.
PIM
,
PIMItem
,
PIMList
Field Summary | ||
---|---|---|
|
static int |
MEMO_LIST
Represents the Memo List type. |
|
static int |
REMOVE_NON_EMPTY_LIST
Constant indicating that a non-empty PIM list can be removed. |
Fields inherited from class javax.microedition.pim.PIM |
---|
CONTACT_LIST, EVENT_LIST, READ_ONLY, READ_WRITE, TODO_LIST, WRITE_ONLY |
Constructor Summary | ||
---|---|---|
|
protected |
BlackBerryPIM()
BlackBerryPIM objects should be created using the getInstance() method. |
Method Summary | ||
---|---|---|
|
void |
addListChangeListener(ListChangeListener listener)
Adds a ListChangeListener to be notified of list change
events. |
|
abstract long |
createPIMList(int type,
String name)
Creates a PIMList. |
|
abstract boolean |
isCreatePIMListSupported(int type)
Returns whether or not creating a PIMList of a specified type is supported. |
|
abstract boolean |
isRemovePIMListSupported(int type)
Returns whether or not removing a PIMList of a specified type is supported. |
|
abstract PIMList |
openPIMList(int pimListType,
int mode,
long uid)
Opens a PIMList by its UID. |
|
BlackBerryPIMList |
openUnifiedPIMList(int pimListType,
int mode)
Opens a "unified" PIMList of all available PIMLists of the requested type. |
|
abstract BlackBerryPIMList |
openUnifiedPIMList(int pimListType,
int mode,
String[] names)
Opens a "unified" PIMList of the lists with the provided names. |
|
abstract BlackBerryPIMList |
openUnifiedPIMList(int pimListType,
int mode,
long[] uids)
Opens a "unified" PIMList of the lists with the provided UIDs. |
|
void |
removeListChangeListener(ListChangeListener listener)
Removes a ListChangeListener from being notified of list
change events. |
|
abstract void |
removePIMList(int type,
String name)
Removes an empty PIMList. |
|
abstract void |
removePIMList(int type,
String name,
int flags)
Removes a PIMList. |
|
abstract void |
removePIMList(int type,
long uid)
Removes an empty PIMList. |
|
abstract void |
removePIMList(int type,
long uid,
int flags)
Removes a PIMList. |
Methods inherited from class javax.microedition.pim.PIM |
---|
fromSerialFormat, getInstance, listPIMLists, openPIMList, openPIMList, supportedSerialFormats, toSerialFormat |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MEMO_LIST
public static final int REMOVE_NON_EMPTY_LIST
Constructor Detail |
---|
protected BlackBerryPIM()
BlackBerryPIM
objects should be created using the getInstance()
method.
Method Detail |
---|
public void addListChangeListener(ListChangeListener listener)
ListChangeListener
to be notified of list change
events.
If the specified listener is already present in the list of listeners then it will NOT be added again and this method will return as if successful.
The invocations of the methods of the specified listener will occur on
the event thread of the calling application. Therefore, if the event
thread of the application is no longer alive or is stalled for some other
reason then the events will not be delivered. Also, at the time this
method is invoked it is required that there be an Application
instance returned from Application.getApplication()
.
listener
- the listener to add.
NullPointerException
- if listener
is null.
IllegalStateException
- if Application.getApplication()
returns
null
or throws an exception, indicating
that the current application is not set.BlackBerryPIM.removeListChangeListener(ListChangeListener)
public void removeListChangeListener(ListChangeListener listener)
ListChangeListener
from being notified of list
change events.
If the specified listener is null
or is not in the list of
listeners then this method does nothing and will return as if successful.
listener
- the listener to remove.BlackBerryPIM.addListChangeListener(ListChangeListener)
public abstract PIMList openPIMList(int pimListType, int mode, long uid) throws PIMException
pimListType
- the PIM list type to open; valid values include PIM.CONTACT_LIST
,
PIM.EVENT_LIST
, PIM.TODO_LIST
, and BlackBerryPIM.MEMO_LIST
.mode
- the mode in which the List is opened; must be one of PIM.READ_ONLY
,
PIM.READ_WRITE
, or PIM.WRITE_ONLY
.uid
- the UID of the list to open.
PIMException
- If the list is not available, the operation is unsupported or an error
occurs.
SecurityException
- if the application is not given permissions that match the
requested mode.
IllegalArgumentException
- If an invalid mode
is provided as a parameter
or if pimListType
is not a valid PIM list type.PIM.openPIMList(int, int)
,
PIM.openPIMList(int, int, String)
,
PIMList UIDspublic BlackBerryPIMList openUnifiedPIMList(int pimListType, int mode) throws PIMException
BlackBerryPIM.openUnifiedPIMList(int, int, String[])
with the specified parameters and the
list of names returned from PIM.listPIMLists(int)
.
pimListType
- the PIM list type to open; valid values include PIM.CONTACT_LIST
,
PIM.EVENT_LIST
, PIM.TODO_LIST
, and BlackBerryPIM.MEMO_LIST
.mode
- the mode in which the List is opened; must be one of PIM.READ_ONLY
,
PIM.READ_WRITE
, or PIM.WRITE_ONLY
.
PIMException
- If at least one of the lists in the unification is not available, the
operation is unsupported or an error occurs.
SecurityException
- if the application is not given permissions that match the
requested mode.
IllegalArgumentException
- If an invalid mode
is provided as a parameter,
or if pimListType
is not a valid PIM list type.public abstract BlackBerryPIMList openUnifiedPIMList(int pimListType, int mode, String[] names) throws PIMException
PIM.openPIMList(int, int, String)
with the specified parameters and the String at index
0 of the array. If a name occurs twice in the array then it will be treated as if it were
only present once.
pimListType
- the PIM list type to open; valid values include PIM.CONTACT_LIST
,
PIM.EVENT_LIST
, PIM.TODO_LIST
, and BlackBerryPIM.MEMO_LIST
.mode
- the mode in which the List is opened; must be one of PIM.READ_ONLY
,
PIM.READ_WRITE
, or PIM.WRITE_ONLY
.names
- the names of the lists to include in the returned unified PIMList; each value of
this array must be equal to one of the strings returned from PIM.listPIMLists(int)
when
specified the same pimListType; if the array has zero length then a PIMList with zero items
will be returned.
PIMException
- If at least one of the named lists is not available, the operation is
unsupported or an error occurs.
SecurityException
- if the application is not given permissions that match the
requested mode.
IllegalArgumentException
- If an invalid mode
is provided as a parameter,
or if pimListType
is not a valid PIM list type.
NullPointerException
- if names==null or any element of names is null.public abstract BlackBerryPIMList openUnifiedPIMList(int pimListType, int mode, long[] uids) throws PIMException
BlackBerryPIM.openPIMList(int, int, long)
with the specified parameters and the UID at index 0 of
the array. If a UID occurs twice in the array then it will be treated as if it were only
present once.
pimListType
- the PIM list type to open; valid values include PIM.CONTACT_LIST
,
PIM.EVENT_LIST
, PIM.TODO_LIST
, and BlackBerryPIM.MEMO_LIST
.mode
- the mode in which the List is opened; must be one of PIM.READ_ONLY
,
PIM.READ_WRITE
, or PIM.WRITE_ONLY
.uids
- the UIDs of the lists to include in the returned unified PIMList; each value of
this array must be equal to the UID of one of the PIMLists whose names are returned from
PIM.listPIMLists(int)
when specified the same pimListType; if the array has zero length
then a PIMList with zero items will be returned.
PIMException
- If at least one of the UIDs does not map to a PIMList or the PIMList is
not available, the operation is unsupported or an error occurs.
SecurityException
- if the application is not given permissions that match the
requested mode.
IllegalArgumentException
- If an invalid mode
is provided as a parameter,
or if pimListType
is not a valid PIM list type.
NullPointerException
- if uids==null.public abstract long createPIMList(int type, String name) throws PIMException
PIM.CONTACT_LIST
).
If a PIMList with the given name of the given type already exists, the new PIMList is created,
but the name is modified to be unique for its type.
Therefore, after invoking this method, you should use the PIMList's UID to access the PIMList.
type
- The PIMList type. Currently, must be PIM.CONTACT_LIST
.name
- The name of the PIMList to create.
PIMException
- if there is an error in creating the PIMList.
IllegalArgumentException
- if the name is null or empty.
UnsupportedOperationException
- if the PIMList creation is not supported.
SecurityException
- if callers are not allowed to access the PIM API.public abstract boolean isCreatePIMListSupported(int type)
type
- The PIMList type.
true
if creating a PIMList of the specified type is supported, false
otherwise.
Currently, returns true
only for PIM.CONTACT_LIST
.public abstract boolean isRemovePIMListSupported(int type)
type
- The PIMList type.
true
if removing a PIMList of the specified type is supported, false
otherwise.
Currently, returns true
only for PIM.CONTACT_LIST
.public abstract void removePIMList(int type, long uid, int flags) throws BlackBerryPIMRemovalException
PIM.CONTACT_LIST
).
type
- The PIMList type. Currently, must be PIM.CONTACT_LIST
.uid
- The UID of the PIMList to remove.flags
- A bitwise combination of flags to alter the behavior of the removal;
for example, you must specify BlackBerryPIM.REMOVE_NON_EMPTY_LIST
to allow the removal of a non-empty PIMList.
BlackBerryPIMRemovalException
- if the PIMList removal fails; a reason code is given.
SecurityException
- if callers are not allowed to access the PIM API.public abstract void removePIMList(int type, String name) throws BlackBerryPIMRemovalException
PIM.CONTACT_LIST
).
type
- The PIMList type. Currently, must be PIM.CONTACT_LIST
.name
- The name of the PIMList to remove.
BlackBerryPIMRemovalException
- if the PIMList removal fails; a reason code is given.
SecurityException
- if callers are not allowed to access the PIM API.public abstract void removePIMList(int type, long uid) throws BlackBerryPIMRemovalException
PIM.CONTACT_LIST
).
type
- The PIMList type. Currently, must be PIM.CONTACT_LIST
.uid
- The UID of the PIMList to remove.
BlackBerryPIMRemovalException
- if the PIMList removal fails; a reason code is given.
SecurityException
- if callers are not allowed to access the PIM API.public abstract void removePIMList(int type, String name, int flags) throws BlackBerryPIMRemovalException
PIM.CONTACT_LIST
).
type
- The PIMList type. Currently, must be PIM.CONTACT_LIST
.name
- The name of the PIMList to remove.flags
- A bitwise combination of flags to alter the behavior of the removal;
for example, you must specify BlackBerryPIM.REMOVE_NON_EMPTY_LIST
to allow the removal of a non-empty PIMList.
BlackBerryPIMRemovalException
- if the PIMList removal fails; a reason code is given.
SecurityException
- if callers are not allowed to access the PIM API.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal