| Camel Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
struct CamelStoreInfo; enum CamelStoreInfoFlags; struct CamelStoreSummary; #define CAMEL_STORE_INFO_FOLDER_UNKNOWN CamelStoreSummary * camel_store_summary_new (void); void camel_store_summary_set_filename (CamelStoreSummary *summary,const gchar *filename); gint camel_store_summary_load (CamelStoreSummary *summary); gint camel_store_summary_save (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_ref (CamelStoreSummary *summary,CamelStoreInfo *info); void camel_store_summary_info_unref (CamelStoreSummary *summary,CamelStoreInfo *info); #define camel_store_summary_info_free void camel_store_summary_remove (CamelStoreSummary *summary,CamelStoreInfo *info); void camel_store_summary_remove_path (CamelStoreSummary *summary,const gchar *path); gint camel_store_summary_count (CamelStoreSummary *summary); 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); void camel_store_info_set_string (CamelStoreSummary *summary,CamelStoreInfo *info,gint type,const gchar *value); const gchar * camel_store_info_path (CamelStoreSummary *summary,CamelStoreInfo *info); const gchar * camel_store_info_name (CamelStoreSummary *summary,CamelStoreInfo *info); gboolean camel_store_summary_connect_folder_summary (CamelStoreSummary *summary,const gchar *path,struct _CamelFolderSummary *folder_summary); gboolean camel_store_summary_disconnect_folder_summary (CamelStoreSummary *summary,struct _CamelFolderSummary *folder_summary);
struct CamelStoreInfo {
volatile gint refcount;
gchar *path;
guint32 flags;
guint32 unread;
guint32 total;
};
typedef enum {
/*< flags >*/
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_TO_ME = 1 << 8,
CAMEL_STORE_INFO_FOLDER_SHARED_BY_ME = 1 << 9,
CAMEL_STORE_INFO_FOLDER_READONLY = 1 << 16,
/* empty gap from unused flag removal */
CAMEL_STORE_INFO_FOLDER_FLAGGED = 1 << 18,
CAMEL_STORE_INFO_FOLDER_LAST = 1 << 24 /*< skip >*/
} CamelStoreInfoFlags;
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 |
gint camel_store_summary_load (CamelStoreSummary *summary);
Load the summary off disk.
|
a CamelStoreSummary object |
Returns : |
0 on success or -1 on fail |
gint camel_store_summary_save (CamelStoreSummary *summary);
Writes the summary to disk. The summary is only written if changes have occurred.
|
a CamelStoreSummary object |
Returns : |
0 on succes or -1 on 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_ref (CamelStoreSummary *summary,CamelStoreInfo *info);
Add an extra reference to info.
|
a CamelStoreSummary object |
|
a CamelStoreInfo |
Returns : |
the info argument |
void camel_store_summary_info_unref (CamelStoreSummary *summary,CamelStoreInfo *info);
Unref and potentially free info, and all associated memory.
|
a CamelStoreSummary object |
|
a CamelStoreInfo |
#define camel_store_summary_info_free camel_store_summary_info_unref
camel_store_summary_info_free is deprecated and should not be used in newly-written code.
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 |
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_path (CamelStoreSummary *summary,const gchar *path);
Retrieve a summary item by path name.
The returned CamelStoreInfo is referenced for thread-safety and should be
unreferenced with camel_store_summary_info_unref() when finished with it.
|
a CamelStoreSummary object |
|
path to the item |
Returns : |
the summary item, or NULL if the path name 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()
|
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 |
const gchar * camel_store_info_path (CamelStoreSummary *summary,CamelStoreInfo *info);
Returns the path string from info.
|
a CamelStoreSummary |
|
a CamelStoreInfo |
Returns : |
the path string from info
|
const gchar * camel_store_info_name (CamelStoreSummary *summary,CamelStoreInfo *info);
Returns the last segment of the path string from info.
|
a CamelStoreSummary |
|
a CamelStoreInfo |
Returns : |
the last segment of the path string from info
|
gboolean camel_store_summary_connect_folder_summary (CamelStoreSummary *summary,const gchar *path,struct _CamelFolderSummary *folder_summary);
Connects listeners for count changes on folder_summary to keep
CamelStoreInfo.total and CamelStoreInfo.unread in sync transparently.
The folder_summary is stored in summary as path. Use
camel_store_summary_disconnect_folder_summary() to disconnect from
listening.
|
a CamelStoreSummary object |
|
used path for folder_summary
|
|
a CamelFolderSummary object |
Returns : |
Whether successfully connect callbacks for count change notifications. |
Since 3.4
gboolean camel_store_summary_disconnect_folder_summary (CamelStoreSummary *summary,struct _CamelFolderSummary *folder_summary);
Diconnects count change listeners previously connected
by camel_store_summary_connect_folder_summary().
|
a CamelStoreSummary object |
|
a CamelFolderSummary object |
Returns : |
Whether such connection existed and whether was successfully removed. |
Since 3.4