Account
[Protocol Common Services]


Detailed Description

Common Account APIs.


POSTAL ACCOUNT RULE ACTIVATION STATUS

Defines the account rule activation status.
Note:
This constants represent masks, you can combine any of these activation status.


#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_ALL_MASK
 Recipients mask.
#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_BLOCK_LIST   ((alp_postal_account_rule_activation_status_t)1<<0)
 The block list is activated.
#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_GRANT_LIST   ((alp_postal_account_rule_activation_status_t)1<<1)
 The grant list is activated.
#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_MOVE_TO_LIST   ((alp_postal_account_rule_activation_status_t)1<<2)
 The move to list is activated.
#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_NONE   ((alp_postal_account_rule_activation_status_t)0)
 No rule is activated.
#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_NONE_MASK   ((alp_postal_account_rule_activation_status_t)0)
 None mask.

ALP POSTAL ACCOUNT STATUS

Defines the account status provided by the ALP_POSTAL_NOTIFICATION_ACCOUNT_STATUS_CHANGE notification callback.

#define ALP_POSTAL_ACCOUNT_STATUS_CREATED   ((alp_postal_account_status_t)0)
 The account has been created.
#define ALP_POSTAL_ACCOUNT_STATUS_DELETED   ((alp_postal_account_status_t)2)
 The account has been deleted.
#define ALP_POSTAL_ACCOUNT_STATUS_UPDATED   ((alp_postal_account_status_t)1)
 The account has been updated (e.g: a property value of the account has been changed).

POSTAL ACCOUNT NOTIFICATIONS

Defines account notifications.

#define ALP_POSTAL_NOTIFICATION_ACCOUNT_STATUS_CHANGE   ALP_POSTAL_NOTIFICATION(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, 1)
 Account state change.

POSTAL ACCOUNT PROPERTIES

Defines account properties.

#define ALP_POSTAL_PROPERTY_ACCOUNT_ID   ALP_POSTAL_PROPERTY_READ_ONLY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, ALP_POSTAL_PROPERTY_TYPE_INT, 4)
 The account storage identifer.
#define ALP_POSTAL_PROPERTY_ACCOUNT_MAX_ENVELOPE_STORAGE_COUNT   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, ALP_POSTAL_PROPERTY_TYPE_INT, 3)
 The maximum count of envelope that can be stored, unprotected Envelopes will be deleted (FIFO) if this count is reach.
#define ALP_POSTAL_PROPERTY_ACCOUNT_MAX_ENVELOPE_STORAGE_SIZE   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, ALP_POSTAL_PROPERTY_TYPE_INT, 2)
 The maximum storage size allowed to store envelopes, unprotected Envelopes will be deleted (FIFO) if this size is reach.
#define ALP_POSTAL_PROPERTY_ACCOUNT_NAME   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, ALP_POSTAL_PROPERTY_TYPE_C_STRING, 1)
 The name of the account.
#define ALP_POSTAL_PROPERTY_ACCOUNT_RULE_ACTIVATION_STATUS   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, ALP_POSTAL_PROPERTY_TYPE_INT, 5)
 The account rule activation status.

Defines

#define ALP_POSTAL_ACCOUNT_INVALID_ID   ((alp_postal_account_id_t)ALP_POSTAL_INVALID_OBJECT_ID)
 Invalid Account ID definition.

Typedefs

typedef uint8_t alp_postal_account_rule_activation_status_t
 Account restriction list applying rules.
typedef uint8_t alp_postal_account_status_t
 Account status type.
typedef _AlpPostalPropertyList AlpPostalAccount
 Defines a Postal Account.
typedef void(* AlpPostalNotificationAccountStatusChangedCallback )(alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, alp_postal_account_status_t iAccountStatus)
 Postal Account Status change Notification Callback.

Functions

alp_status_t alp_postal_account_address_rule_get_id (alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, alp_postal_rule_action_t iAction, AlpPostalAddress *iAddressP, alp_postal_rule_id_t *oRuleIdP)
 Retrieve the rule id corresponding to the given address.
alp_status_t alp_postal_account_delete (alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId)
 Delete the given account Id.
alp_status_t alp_postal_account_free (AlpPostalAccount *iAccountP)
 Free an account.
alp_status_t alp_postal_account_get (alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, AlpPostalAccount *oAccountP)
 Get the account properties list of a stored Postal Account.
alp_status_t alp_postal_account_get_id (AlpPostalAccount *iAccountP, alp_postal_account_id_t *oAccountIdP)
 Get the id of an account structure provided by the server, otherwise id won't exist.
alp_status_t alp_postal_account_get_next_rule (AlpPostalEnumerator *iEnumeratorP, AlpPostalRule *oRuleP)
 Return the next rule in enumerator.
alp_status_t alp_postal_account_get_property (AlpPostalAccount *iAccountP, alp_postal_property_id_t iPropertyId, AlpPostalProperty **oAccountPropertyP)
 Retrieve a property from a Postal Account.
alp_status_t alp_postal_account_get_root_folder (alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, alp_postal_folder_id_t *oFolderIdP)
 Get the root folder Id of the given account Id.
alp_status_t alp_postal_account_get_rule_enumerator (alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, alp_postal_rule_action_t iAction, AlpPostalEnumerator *ioEnumeratorP)
 Get an enumerator of the rule list.
alp_status_t alp_postal_account_get_session_id (alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, alp_postal_session_id_t *oSessionIdP)
 Return the unique session id associated with the given account id.
alp_status_t alp_postal_account_get_special_folder (alp_postal_service_id_t iServiceId, alp_postal_session_id_t iAccountId, alp_postal_folder_type_t iFolderType, alp_postal_folder_id_t *oFolderIdP)
 Get a special folder id of an account.
alp_status_t alp_postal_account_init (AlpPostalAccount *iAccountP)
 Initialize an account. MUST be called before use.
alp_status_t alp_postal_account_rule_apply (alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, alp_postal_folder_id_t iFolderId, alp_postal_rule_id_t iRuleId)
 Apply a rule to the given envelope.
alp_status_t alp_postal_account_rule_search_id (alp_postal_account_id_t iAccountId, AlpPostalRule *iRuleP, alp_postal_rule_id_t *oRuleIdP)
 Search the rule id matching the rule template into the given account.
alp_status_t alp_postal_account_rule_update (alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, alp_postal_rule_id_t iRuleId, AlpPostalRule *iRuleP)
 Update a rule.
alp_status_t alp_postal_account_save_rule (alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, AlpPostalRule *iRuleP, alp_postal_rule_id_t *oRuleIdP)
 Add an entry to the rule list for the account id.
alp_status_t alp_postal_account_set_property (AlpPostalAccount *ioAccountP, alp_postal_property_id_t iAccountPropertyId, alp_postal_property_const_value_t iAccountPropertyDataP, uint16_t iAccountPropertyDataSize)
 Set a property to a Postal Account.
alp_status_t alp_postal_account_update (alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, AlpPostalAccount *iAccountP)
 Update the stored account specified by its unique Id. .


Define Documentation

#define ALP_POSTAL_ACCOUNT_INVALID_ID   ((alp_postal_account_id_t)ALP_POSTAL_INVALID_OBJECT_ID)
 

Invalid Account ID definition.

#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_ALL_MASK
 

Value:

Recipients mask.

#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_BLOCK_LIST   ((alp_postal_account_rule_activation_status_t)1<<0)
 

The block list is activated.

#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_GRANT_LIST   ((alp_postal_account_rule_activation_status_t)1<<1)
 

The grant list is activated.

#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_MOVE_TO_LIST   ((alp_postal_account_rule_activation_status_t)1<<2)
 

The move to list is activated.

#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_NONE   ((alp_postal_account_rule_activation_status_t)0)
 

No rule is activated.

#define ALP_POSTAL_ACCOUNT_RULE_ACTIVATION_STATUS_NONE_MASK   ((alp_postal_account_rule_activation_status_t)0)
 

None mask.

#define ALP_POSTAL_ACCOUNT_STATUS_CREATED   ((alp_postal_account_status_t)0)
 

The account has been created.

#define ALP_POSTAL_ACCOUNT_STATUS_DELETED   ((alp_postal_account_status_t)2)
 

The account has been deleted.

#define ALP_POSTAL_ACCOUNT_STATUS_UPDATED   ((alp_postal_account_status_t)1)
 

The account has been updated (e.g: a property value of the account has been changed).

#define ALP_POSTAL_NOTIFICATION_ACCOUNT_STATUS_CHANGE   ALP_POSTAL_NOTIFICATION(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, 1)
 

Account state change.

#define ALP_POSTAL_PROPERTY_ACCOUNT_ID   ALP_POSTAL_PROPERTY_READ_ONLY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, ALP_POSTAL_PROPERTY_TYPE_INT, 4)
 

The account storage identifer.

#define ALP_POSTAL_PROPERTY_ACCOUNT_MAX_ENVELOPE_STORAGE_COUNT   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, ALP_POSTAL_PROPERTY_TYPE_INT, 3)
 

The maximum count of envelope that can be stored, unprotected Envelopes will be deleted (FIFO) if this count is reach.

#define ALP_POSTAL_PROPERTY_ACCOUNT_MAX_ENVELOPE_STORAGE_SIZE   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, ALP_POSTAL_PROPERTY_TYPE_INT, 2)
 

The maximum storage size allowed to store envelopes, unprotected Envelopes will be deleted (FIFO) if this size is reach.

#define ALP_POSTAL_PROPERTY_ACCOUNT_NAME   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, ALP_POSTAL_PROPERTY_TYPE_C_STRING, 1)
 

The name of the account.

#define ALP_POSTAL_PROPERTY_ACCOUNT_RULE_ACTIVATION_STATUS   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_ACCOUNT, ALP_POSTAL_PROPERTY_TYPE_INT, 5)
 

The account rule activation status.


Typedef Documentation

typedef uint8_t alp_postal_account_rule_activation_status_t
 

Account restriction list applying rules.

typedef uint8_t alp_postal_account_status_t
 

Account status type.

typedef struct _AlpPostalPropertyList AlpPostalAccount
 

Defines a Postal Account.

typedef void(* AlpPostalNotificationAccountStatusChangedCallback)(alp_postal_service_id_t iServiceId, alp_postal_account_id_t iAccountId, alp_postal_account_status_t iAccountStatus)
 

Postal Account Status change Notification Callback.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The Postal Account id, which the status changed.
[in] iAccountStatus The last status of the account.
See also:
ALP_POSTAL_ACCOUNT_STATUS for the possible values.

ALP_POSTAL_ACCOUNT_STATUS for the possible values.


Function Documentation

alp_status_t alp_postal_account_address_rule_get_id alp_postal_service_id_t  iServiceId,
alp_postal_account_id_t  iAccountId,
alp_postal_rule_action_t  iAction,
AlpPostalAddress iAddressP,
alp_postal_rule_id_t oRuleIdP
 

Retrieve the rule id corresponding to the given address.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The account Id to work on.
[in] iAction The rule related action
[in] iAddressP The given address
[out] oRuleIdP The retrieved ruleId.
Returns:
Returns an error code.

alp_status_t alp_postal_account_delete alp_postal_service_id_t  iServiceId,
alp_postal_account_id_t  iAccountId
 

Delete the given account Id.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The account Id to be deleted.
Returns:
Returns an error code.

alp_status_t alp_postal_account_free AlpPostalAccount iAccountP  ) 
 

Free an account.

Parameters:
[in] iAccountP An account structure.
Returns:
Returns an error code.

alp_status_t alp_postal_account_get alp_postal_service_id_t  iServiceId,
alp_postal_account_id_t  iAccountId,
AlpPostalAccount oAccountP
 

Get the account properties list of a stored Postal Account.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The account Id of the stored account.
[out] oAccountP The result account property list Ptr.
Returns:
Returns an error code.

alp_status_t alp_postal_account_get_id AlpPostalAccount iAccountP,
alp_postal_account_id_t oAccountIdP
 

Get the id of an account structure provided by the server, otherwise id won't exist.

Parameters:
[in] iAccountP An Account structure Ptr.
[out] oAccountIdP the unique id of the account, 0 if it not exist.
Returns:
alp_postal_account_id_t the unique id of the account, or .

alp_status_t alp_postal_account_get_next_rule AlpPostalEnumerator iEnumeratorP,
AlpPostalRule oRuleP
 

Return the next rule in enumerator.

Parameters:
[in] iEnumeratorP the rule enumerator.
[out] oRuleP the next rule property list.
Returns:
Returns an error code.

alp_status_t alp_postal_account_get_property AlpPostalAccount iAccountP,
alp_postal_property_id_t  iPropertyId,
AlpPostalProperty **  oAccountPropertyP
 

Retrieve a property from a Postal Account.

Parameters:
[in] iAccountP The Postal Account in which a property must be retrieved.
[in] iPropertyId an account property Id.
[out] oAccountPropertyP The Postal Account property to be retrieved.
Returns:
Returns an error code.

alp_status_t alp_postal_account_get_root_folder alp_postal_service_id_t  iServiceId,
alp_postal_account_id_t  iAccountId,
alp_postal_folder_id_t oFolderIdP
 

Get the root folder Id of the given account Id.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The account Id to work on.
[out] oFolderIdP The id of the root folder.
Returns:
Returns an error code.

alp_status_t alp_postal_account_get_rule_enumerator alp_postal_service_id_t  iServiceId,
alp_postal_account_id_t  iAccountId,
alp_postal_rule_action_t  iAction,
AlpPostalEnumerator ioEnumeratorP
 

Get an enumerator of the rule list.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The account Id to work on.
[in] iAction the rule list action
[out] ioEnumeratorP A reseted enumerator on the result.
Returns:
Returns an error code.

alp_status_t alp_postal_account_get_session_id alp_postal_service_id_t  iServiceId,
alp_postal_account_id_t  iAccountId,
alp_postal_session_id_t oSessionIdP
 

Return the unique session id associated with the given account id.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The account Id to work on.
[out] oSessionIdP The session id associated.
Returns:
Returns an error code.

alp_status_t alp_postal_account_get_special_folder alp_postal_service_id_t  iServiceId,
alp_postal_session_id_t  iAccountId,
alp_postal_folder_type_t  iFolderType,
alp_postal_folder_id_t oFolderIdP
 

Get a special folder id of an account.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The session Id to work on.
[in] iFolderType (INBOX, OUTBOX, etc.. see special id value in folder.h)
[out] oFolderIdP the id of the resuested folder.
Returns:
Returns an error code.

alp_status_t alp_postal_account_init AlpPostalAccount iAccountP  ) 
 

Initialize an account. MUST be called before use.

Parameters:
[in] iAccountP The Postal Account to be initialized.

alp_status_t alp_postal_account_rule_apply alp_postal_service_id_t  iServiceId,
alp_postal_account_id_t  iAccountId,
alp_postal_folder_id_t  iFolderId,
alp_postal_rule_id_t  iRuleId
 

Apply a rule to the given envelope.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The account Id to work on.
[in] iFolderId The folder Id to work on.
[in] iRuleId The rule to apply
Returns:
Returns an error code.

alp_status_t alp_postal_account_rule_search_id alp_postal_account_id_t  iAccountId,
AlpPostalRule iRuleP,
alp_postal_rule_id_t oRuleIdP
 

Search the rule id matching the rule template into the given account.

Parameters:
[in] iAccountId The account Id to work on.
[in] iRuleP The rule, you want the id from.
[out] oRuleIdP The retrieved ruleId.
Returns:
Returns an error code.

alp_status_t alp_postal_account_rule_update alp_postal_service_id_t  iServiceId,
alp_postal_account_id_t  iAccountId,
alp_postal_rule_id_t  iRuleId,
AlpPostalRule iRuleP
 

Update a rule.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The account Id to work on.
[in] iRuleId The rule Id to work on.
[in] iRuleP The new updated rule.
Returns:
Returns an error code.

alp_status_t alp_postal_account_save_rule alp_postal_service_id_t  iServiceId,
alp_postal_account_id_t  iAccountId,
AlpPostalRule iRuleP,
alp_postal_rule_id_t oRuleIdP
 

Add an entry to the rule list for the account id.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The account to add the list to.
[in] iRuleP A Rule to be added.
[out] oRuleIdP the returned added rule unique identifier.
Returns:
Returns an error code.

alp_status_t alp_postal_account_set_property AlpPostalAccount ioAccountP,
alp_postal_property_id_t  iAccountPropertyId,
alp_postal_property_const_value_t  iAccountPropertyDataP,
uint16_t  iAccountPropertyDataSize
 

Set a property to a Postal Account.

Parameters:
[in,out] ioAccountP The Postal Account in which a property must be set.
[in] iAccountPropertyId The Id of the property to be created.
[in] iAccountPropertyDataP The value of the property to be created.
[in] iAccountPropertyDataSize the size of the data, strlen+1 if it's a string
Returns:
Returns an error code.

alp_status_t alp_postal_account_update alp_postal_service_id_t  iServiceId,
alp_postal_account_id_t  iAccountId,
AlpPostalAccount iAccountP
 

Update the stored account specified by its unique Id. .

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iAccountId The account Id to be updated.
[in] iAccountP A list of account properties to update.
Returns:
Returns an error code, POSTAL_STATUS_ACCOUNT_NAME_ALREADY_EXISTS.


Generated on Wed Jul 30 07:06:43 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.