Convenience functions. More...
Functions | |
_PUBLIC_ enum MAPISTATUS | AddUserPermission (mapi_object_t *obj_folder, const char *username, enum ACLRIGHTS role) |
_PUBLIC_ enum MAPISTATUS | GetBestBody (mapi_object_t *obj_message, uint8_t *format) |
_PUBLIC_ enum MAPISTATUS | GetDefaultFolder (mapi_object_t *obj_store, uint64_t *folder, const uint32_t id) |
_PUBLIC_ enum MAPISTATUS | GetDefaultPublicFolder (mapi_object_t *obj_store, uint64_t *folder, const uint32_t id) |
_PUBLIC_ enum MAPISTATUS | GetFolderItemsCount (mapi_object_t *obj_folder, uint32_t *unread, uint32_t *total) |
_PUBLIC_ bool | IsMailboxFolder (mapi_object_t *obj_store, uint64_t fid, uint32_t *olFolder) |
_PUBLIC_ enum MAPISTATUS | ModifyUserPermission (mapi_object_t *obj_folder, const char *username, enum ACLRIGHTS role) |
_PUBLIC_ enum MAPISTATUS | RemoveUserPermission (mapi_object_t *obj_folder, const char *username) |
Convenience functions.
_PUBLIC_ enum MAPISTATUS AddUserPermission | ( | mapi_object_t * | obj_folder, |
const char * | username, | ||
enum ACLRIGHTS | role | ||
) |
Adds permissions for a user on a given folder
obj_folder | the folder we add permission for |
username | the Exchange username we add permissions for |
role | the permission mask value |
The following permissions and rights are supported:
References get_PropertyValue_data(), mapi_object_get_session(), MAPI_RESOLVED, MAPIFreeBuffer(), ModifyPermissions(), OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_ENTRYID, PR_MEMBER_RIGHTS, ResolveNames(), set_mapi_SPropValue(), and set_SPropTagArray().
_PUBLIC_ enum MAPISTATUS GetBestBody | ( | mapi_object_t * | obj_message, |
uint8_t * | format | ||
) |
Implement the BestBody algorithm and return the best body content type for a given message.
obj_message | the message we find the best body for |
format | the format - see below. |
References find_SPropValue_data(), GetProps(), mapi_session::mapi_ctx, mapi_object_get_session(), MAPIFreeBuffer(), mapi_context::mem_ctx, olEditorHTML, olEditorRTF, olEditorText, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, PR_BODY_ERROR, PR_BODY_HTML_ERROR, PR_BODY_UNICODE, PR_HTML, PR_RTF_COMPRESSED, PR_RTF_COMPRESSED_ERROR, PR_RTF_IN_SYNC, and set_SPropTagArray().
_PUBLIC_ enum MAPISTATUS GetDefaultFolder | ( | mapi_object_t * | obj_store, |
uint64_t * | folder, | ||
const uint32_t | id | ||
) |
Retrieves the folder id for the specified default folder in a mailbox store
obj_store | the store to search |
id | the type of folder to search for |
folder | the resulting folder reference |
The following types of folders are supported:
Note that this function will cache FID values for common accessed folders such as calendar, contact, journal, note, task and drafts until the store object got released.
References mapi_obj_store::fid_calendar, mapi_obj_store::fid_common_views, mapi_obj_store::fid_contact, mapi_obj_store::fid_deleted_items, mapi_obj_store::fid_drafts, mapi_obj_store::fid_inbox, mapi_obj_store::fid_journal, mapi_obj_store::fid_mailbox_root, mapi_obj_store::fid_note, mapi_obj_store::fid_outbox, mapi_obj_store::fid_search, mapi_obj_store::fid_sent_items, mapi_obj_store::fid_task, mapi_obj_store::fid_top_information_store, olFolderCalendar, olFolderCommonView, olFolderContacts, olFolderDeletedItems, olFolderDrafts, olFolderFinder, olFolderInbox, olFolderJournal, olFolderMailboxRoot, olFolderNotes, olFolderOutbox, olFolderSentMail, olFolderTasks, olFolderTopInformationStore, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, mapi_object::private_data, PrivateFolderWithoutCachedFids, and mapi_obj_store::store_type.
_PUBLIC_ enum MAPISTATUS GetDefaultPublicFolder | ( | mapi_object_t * | obj_store, |
uint64_t * | folder, | ||
const uint32_t | id | ||
) |
Retrieve the folder id for the specified default folder in a public folder store
obj_store | the store to search |
id | the type of folder to search for |
folder | the resulting folder reference |
The following types of folders are supported:
References olFolderPublicEFormsRegistry, olFolderPublicEFormsRoot, olFolderPublicFreeBusyRoot, olFolderPublicIPMSubtree, olFolderPublicLocalFreeBusy, olFolderPublicLocalOfflineAB, olFolderPublicNNTPArticle, olFolderPublicNonIPMSubtree, olFolderPublicOfflineAB, olFolderPublicRoot, OPENCHANGE_RETVAL_ERR, OPENCHANGE_RETVAL_IF, and mapi_object::private_data.
Referenced by GetUserFreeBusyData().
_PUBLIC_ enum MAPISTATUS GetFolderItemsCount | ( | mapi_object_t * | obj_folder, |
uint32_t * | unread, | ||
uint32_t * | total | ||
) |
Retrieves the total and unread number of items for a specified folder.
obj_folder | the folder to get item counts for |
unread | the number of items in the folder (result) |
total | the number of items in the folder, including unread items (result) |
References GetProps(), mapi_object_get_session(), MAPIFreeBuffer(), OPENCHANGE_RETVAL_IF, PR_CONTENT_COUNT, PR_CONTENT_UNREAD, and set_SPropTagArray().
_PUBLIC_ bool IsMailboxFolder | ( | mapi_object_t * | obj_store, |
uint64_t | fid, | ||
uint32_t * | olFolder | ||
) |
Check if a given folder identifier matches with a system/default one and optionally returns the olFolder type
obj_store | pointer to the store object |
fid | reference to the folder identifier to check |
olFolder | pointer to the returned olFolder |
References mapi_obj_store::fid_calendar, mapi_obj_store::fid_common_views, mapi_obj_store::fid_contact, mapi_obj_store::fid_deleted_items, mapi_obj_store::fid_drafts, mapi_obj_store::fid_inbox, mapi_obj_store::fid_journal, mapi_obj_store::fid_note, mapi_obj_store::fid_outbox, mapi_obj_store::fid_pf_EFormsRegistry, mapi_obj_store::fid_pf_EFormsRegistryRoot, mapi_obj_store::fid_pf_FreeBusyRoot, mapi_obj_store::fid_pf_ipm_subtree, mapi_obj_store::fid_pf_LocalSiteFreeBusy, mapi_obj_store::fid_pf_LocalSiteOfflineAB, mapi_obj_store::fid_pf_NNTPArticle, mapi_obj_store::fid_pf_non_ipm_subtree, mapi_obj_store::fid_pf_OfflineAB, mapi_obj_store::fid_pf_public_root, mapi_obj_store::fid_search, mapi_obj_store::fid_sent_items, mapi_obj_store::fid_task, mapi_obj_store::fid_top_information_store, olFolderCalendar, olFolderCommonView, olFolderContacts, olFolderDeletedItems, olFolderDrafts, olFolderFinder, olFolderInbox, olFolderJournal, olFolderNotes, olFolderOutbox, olFolderPublicEFormsRegistry, olFolderPublicEFormsRoot, olFolderPublicFreeBusyRoot, olFolderPublicIPMSubtree, olFolderPublicLocalFreeBusy, olFolderPublicLocalOfflineAB, olFolderPublicNNTPArticle, olFolderPublicNonIPMSubtree, olFolderPublicOfflineAB, olFolderPublicRoot, olFolderSentMail, olFolderTasks, olFolderTopInformationStore, mapi_object::private_data, PrivateFolderWithoutCachedFids, and mapi_obj_store::store_type.
_PUBLIC_ enum MAPISTATUS ModifyUserPermission | ( | mapi_object_t * | obj_folder, |
const char * | username, | ||
enum ACLRIGHTS | role | ||
) |
Modify permissions for a user on a given folder
obj_folder | the folder to modify permissions for |
username | the Exchange username to modify permissions for |
role | the permission mask value (see AddUserPermission) |
References find_PropertyValue_data(), get_SPropValue_SRow(), GetPermissionsTable(), mapi_object_get_session(), mapi_object_init(), mapi_object_release(), MAPI_RESOLVED, MAPIFreeBuffer(), ModifyPermissions(), OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_ENTRYID, PR_MEMBER_ID, PR_MEMBER_NAME, PR_MEMBER_RIGHTS, QueryPosition(), QueryRows(), ResolveNames(), set_SPropTagArray(), and SetColumns().
_PUBLIC_ enum MAPISTATUS RemoveUserPermission | ( | mapi_object_t * | obj_folder, |
const char * | username | ||
) |
Remove permissions for a user on a given folder
obj_folder | the folder to remove permission from |
username | the Exchange username to remove permissions for |
References find_PropertyValue_data(), get_SPropValue_SRow(), GetPermissionsTable(), mapi_object_get_session(), mapi_object_init(), mapi_object_release(), MAPI_RESOLVED, MAPIFreeBuffer(), ModifyPermissions(), OPENCHANGE_RETVAL_IF, PR_DISPLAY_NAME, PR_ENTRYID, PR_MEMBER_ID, PR_MEMBER_NAME, PR_MEMBER_RIGHTS, QueryPosition(), QueryRows(), ResolveNames(), set_SPropTagArray(), and SetColumns().
![]() ![]() ![]() |
This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/ |