|  |  |  | Camel Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
struct CamelStoreInfo; enum CamelStoreInfoFlags; struct CamelStoreSummary; #define CAMEL_STORE_INFO_FOLDER_UNKNOWN enum CamelStoreSummaryFlags; CamelStoreSummary * camel_store_summary_new (void); void camel_store_summary_set_filename (CamelStoreSummary *summary,const gchar *filename); void camel_store_summary_set_uri_base (CamelStoreSummary *summary,CamelURL *base); gint camel_store_summary_load (CamelStoreSummary *summary); gint camel_store_summary_save (CamelStoreSummary *summary); gint camel_store_summary_header_load (CamelStoreSummary *summary); void camel_store_summary_touch (CamelStoreSummary *summary); void camel_store_summary_add (CamelStoreSummary *summary,CamelStoreInfo *info); CamelStoreInfo * camel_store_summary_add_from_path (CamelStoreSummary *summary,const gchar *path); CamelStoreInfo * camel_store_summary_info_new (CamelStoreSummary *summary); CamelStoreInfo * camel_store_summary_info_new_from_path (CamelStoreSummary *summary,const gchar *path); void camel_store_summary_info_ref (CamelStoreSummary *summary,CamelStoreInfo *info); void camel_store_summary_info_free (CamelStoreSummary *summary,CamelStoreInfo *info); void camel_store_summary_remove (CamelStoreSummary *summary,CamelStoreInfo *info); void camel_store_summary_remove_path (CamelStoreSummary *summary,const gchar *path); void camel_store_summary_remove_index (CamelStoreSummary *summary,gint index); void camel_store_summary_clear (CamelStoreSummary *summary); gint camel_store_summary_count (CamelStoreSummary *summary); CamelStoreInfo * camel_store_summary_index (CamelStoreSummary *summary,gint index); CamelStoreInfo * camel_store_summary_path (CamelStoreSummary *summary,const gchar *path); GPtrArray * camel_store_summary_array (CamelStoreSummary *summary); void camel_store_summary_array_free (CamelStoreSummary *summary,GPtrArray *array); const gchar * camel_store_info_string (CamelStoreSummary *summary,const CamelStoreInfo *info,gint type); void camel_store_info_set_string (CamelStoreSummary *summary,CamelStoreInfo *info,gint type,const gchar *value); #define camel_store_info_path (s, i) #define camel_store_info_uri (s, i) #define camel_store_info_name (s, i) enum CamelStoreSummaryLock; void camel_store_summary_lock (CamelStoreSummary *summary,CamelStoreSummaryLock lock); void camel_store_summary_unlock (CamelStoreSummary *summary,CamelStoreSummaryLock lock);
struct CamelStoreInfo {
	guint32 refcount;
	gchar *uri;
	gchar *path;
	guint32 flags;
	guint32 unread;
	guint32 total;
};
typedef enum _CamelStoreInfoFlags {
	CAMEL_STORE_INFO_FOLDER_NOSELECT = 1 << 0,
	CAMEL_STORE_INFO_FOLDER_NOINFERIORS = 1 << 1,
	CAMEL_STORE_INFO_FOLDER_CHILDREN = 1 << 2,
	CAMEL_STORE_INFO_FOLDER_NOCHILDREN = 1 << 3,
	CAMEL_STORE_INFO_FOLDER_SUBSCRIBED = 1 << 4,
	CAMEL_STORE_INFO_FOLDER_VIRTUAL = 1 << 5,
	CAMEL_STORE_INFO_FOLDER_SYSTEM = 1 << 6,
	CAMEL_STORE_INFO_FOLDER_VTRASH = 1 << 7,
	CAMEL_STORE_INFO_FOLDER_SHARED_BY_ME = 1 << 8,
	CAMEL_STORE_INFO_FOLDER_SHARED_TO_ME = 1 << 9,
	/* not in camle-store.h yet */
	CAMEL_STORE_INFO_FOLDER_READONLY = 1 << 13,
	CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW = 1 << 14,
	CAMEL_STORE_INFO_FOLDER_FLAGGED = 1 << 31
} CamelStoreInfoFlags;
typedef enum _CamelStoreSummaryFlags {
	CAMEL_STORE_SUMMARY_DIRTY = 1 << 0,
	CAMEL_STORE_SUMMARY_FRAGMENT = 1 << 1 /* path name is stored in fragment rather than path */
} CamelStoreSummaryFlags;
CamelStoreSummary * camel_store_summary_new             (void);
Create a new CamelStoreSummary object.
| Returns : | a new CamelStoreSummary object | 
void camel_store_summary_set_filename (CamelStoreSummary *summary,const gchar *filename);
Set the filename where the summary will be loaded to/saved from.
| 
 | a CamelStoreSummary | 
| 
 | a filename | 
void camel_store_summary_set_uri_base (CamelStoreSummary *summary,CamelURL *base);
Sets the base URI for the summary.
| 
 | a CamelStoreSummary object | 
| 
 | a CamelURL | 
gint                camel_store_summary_load            (CamelStoreSummary *summary);
Load the summary off disk.
| 
 | a CamelStoreSummary object | 
| Returns : | 0on success or-1on fail | 
gint                camel_store_summary_save            (CamelStoreSummary *summary);
Writes the summary to disk. The summary is only written if changes have occured.
| 
 | a CamelStoreSummary object | 
| Returns : | 0on succes or-1on fail | 
gint                camel_store_summary_header_load     (CamelStoreSummary *summary);
Only load the header information from the summary, keep the rest on disk. This should only be done on a fresh summary object.
| 
 | a CamelStoreSummary object | 
| Returns : | 0on success or-1on fail | 
void                camel_store_summary_touch           (CamelStoreSummary *summary);
Mark the summary as changed, so that a save will force it to be written back to disk.
| 
 | a CamelStoreSummary object | 
void camel_store_summary_add (CamelStoreSummary *summary,CamelStoreInfo *info);
Adds a new info record to the summary.  If info->uid is NULL,
then a new uid is automatically re-assigned by calling
camel_store_summary_next_uid_string.
The info record should have been generated by calling one of the
info_new_*() functions, as it will be free'd based on the summary
class.  And MUST NOT be allocated directly using malloc.
| 
 | a CamelStoreSummary object | 
| 
 | a CamelStoreInfo | 
CamelStoreInfo * camel_store_summary_add_from_path (CamelStoreSummary *summary,const gchar *path);
Build a new info record based on the name, and add it to the summary.
| 
 | a CamelStoreSummary object | 
| 
 | item path | 
| Returns : | the newly added record | 
CamelStoreInfo *    camel_store_summary_info_new        (CamelStoreSummary *summary);
Allocate a new CamelStoreInfo, suitable for adding to this summary.
| 
 | a CamelStoreSummary object | 
| Returns : | the newly allocated CamelStoreInfo | 
CamelStoreInfo * camel_store_summary_info_new_from_path (CamelStoreSummary *summary,const gchar *path);
Create a new info record from a name.
This info record MUST be freed using camel_store_summary_info_free, camel_store_info_free will not work.
| 
 | a CamelStoreSummary object | 
| 
 | item path | 
| Returns : | the CamelStoreInfo associated with path | 
void camel_store_summary_info_ref (CamelStoreSummary *summary,CamelStoreInfo *info);
Add an extra reference to info.
| 
 | a CamelStoreSummary object | 
| 
 | a CamelStoreInfo | 
void camel_store_summary_info_free (CamelStoreSummary *summary,CamelStoreInfo *info);
Unref and potentially free info, and all associated memory.
| 
 | a CamelStoreSummary object | 
| 
 | a CamelStoreInfo | 
void camel_store_summary_remove (CamelStoreSummary *summary,CamelStoreInfo *info);
Remove a specific info record from the summary.
| 
 | a CamelStoreSummary object | 
| 
 | a CamelStoreInfo | 
void camel_store_summary_remove_path (CamelStoreSummary *summary,const gchar *path);
Remove a specific info record from the summary, by path.
| 
 | a CamelStoreSummary object | 
| 
 | item path | 
void camel_store_summary_remove_index (CamelStoreSummary *summary,gint index);
Remove a specific info record from the summary, by index.
| 
 | a CamelStoreSummary object | 
| 
 | item index | 
void                camel_store_summary_clear           (CamelStoreSummary *summary);
Empty the summary contents.
| 
 | a CamelStoreSummary object | 
gint                camel_store_summary_count           (CamelStoreSummary *summary);
Get the number of summary items stored in this summary.
| 
 | a CamelStoreSummary object | 
| Returns : | the number of items gint he summary. | 
CamelStoreInfo * camel_store_summary_index (CamelStoreSummary *summary,gint index);
Retrieve a summary item by index number.
A referenced to the summary item is returned, which may be ref'd or free'd as appropriate.
It must be freed using camel_store_summary_info_free.
| 
 | a CamelStoreSummary object | 
| 
 | record index | 
| Returns : | the summary item, or NULLifindexis out of range | 
CamelStoreInfo * camel_store_summary_path (CamelStoreSummary *summary,const gchar *path);
Retrieve a summary item by path name.
A referenced to the summary item is returned, which may be ref'd or free'd as appropriate.
It must be freed using camel_store_summary_info_free.
| 
 | a CamelStoreSummary object | 
| 
 | path to the item | 
| Returns : | the summary item, or NULLif thepathname is not
available | 
GPtrArray *         camel_store_summary_array           (CamelStoreSummary *summary);
Obtain a copy of the summary array. This is done atomically, so cannot contain empty entries.
It must be freed using camel_store_summary_array_free.
| 
 | a CamelStoreSummary object | 
| Returns : | the summary array | 
void camel_store_summary_array_free (CamelStoreSummary *summary,GPtrArray *array);
Free the folder summary array.
| 
 | a CamelStoreSummary object | 
| 
 | the summary array as gotten from camel_store_summary_array | 
const gchar * camel_store_info_string (CamelStoreSummary *summary,const CamelStoreInfo *info,gint type);
Get a specific string from the info.
| 
 | a CamelStoreSummary object | 
| 
 | a CamelStoreInfo | 
| 
 | specific string being requested | 
| Returns : | the string value | 
void camel_store_info_set_string (CamelStoreSummary *summary,CamelStoreInfo *info,gint type,const gchar *value);
Set a specific string on the info.
| 
 | a CamelStoreSummary object | 
| 
 | a CamelStoreInfo | 
| 
 | specific string being set | 
| 
 | string value to set | 
#define camel_store_info_path(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_PATH))
#define camel_store_info_uri(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_URI))
#define camel_store_info_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_NAME))
typedef enum {
	CAMEL_STORE_SUMMARY_SUMMARY_LOCK,
	CAMEL_STORE_SUMMARY_IO_LOCK,
	CAMEL_STORE_SUMMARY_REF_LOCK
} CamelStoreSummaryLock;
Since 2.32
void camel_store_summary_lock (CamelStoreSummary *summary,CamelStoreSummaryLock lock);
Locks summary's lock. Unlock it with camel_store_summary_unlock().
| 
 | a CamelStoreSummary | 
| 
 | lock type to lock | 
Since 2.32
void camel_store_summary_unlock (CamelStoreSummary *summary,CamelStoreSummaryLock lock);
Unlocks summary's lock, previously locked with camel_store_summary_lock().
| 
 | a CamelStoreSummary | 
| 
 | lock type to unlock | 
Since 2.32