CamelStoreSummary

CamelStoreSummary

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── CamelObject
        ╰── CamelStoreSummary

Description

Functions

CAMEL_STORE_INFO_FOLDER_UNKNOWN

#define CAMEL_STORE_INFO_FOLDER_UNKNOWN (~0)

camel_store_summary_new ()

CamelStoreSummary *
camel_store_summary_new (void);

Create a new CamelStoreSummary object.

Returns

a new CamelStoreSummary object


camel_store_summary_set_filename ()

void
camel_store_summary_set_filename (CamelStoreSummary *summary,
                                  const gchar *filename);

Set the filename where the summary will be loaded to/saved from.

Parameters

summary

a CamelStoreSummary

 

filename

a filename

 

camel_store_summary_load ()

gint
camel_store_summary_load (CamelStoreSummary *summary);

Load the summary off disk.

Parameters

summary

a CamelStoreSummary object

 

Returns

0 on success or -1 on fail


camel_store_summary_save ()

gint
camel_store_summary_save (CamelStoreSummary *summary);

Writes the summary to disk. The summary is only written if changes have occured.

Parameters

summary

a CamelStoreSummary object

 

Returns

0 on succes or -1 on fail


camel_store_summary_header_load ()

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.

Parameters

summary

a CamelStoreSummary object

 

Returns

0 on success or -1 on fail


camel_store_summary_touch ()

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.

Parameters

summary

a CamelStoreSummary object

 

camel_store_summary_add ()

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.

Parameters

summary

a CamelStoreSummary object

 

info

a CamelStoreInfo

 

camel_store_summary_add_from_path ()

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.

Parameters

summary

a CamelStoreSummary object

 

path

item path

 

Returns

the newly added record


camel_store_summary_info_new ()

CamelStoreInfo *
camel_store_summary_info_new (CamelStoreSummary *summary);

Allocate a new CamelStoreInfo, suitable for adding to this summary.

Parameters

summary

a CamelStoreSummary object

 

Returns

the newly allocated CamelStoreInfo


camel_store_summary_info_new_from_path ()

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.

Parameters

summary

a CamelStoreSummary object

 

path

item path

 

Returns

the CamelStoreInfo associated with path


camel_store_summary_info_ref ()

void
camel_store_summary_info_ref (CamelStoreSummary *summary,
                              CamelStoreInfo *info);

Add an extra reference to info .

Parameters

summary

a CamelStoreSummary object

 

info

a CamelStoreInfo

 

camel_store_summary_info_free ()

void
camel_store_summary_info_free (CamelStoreSummary *summary,
                               CamelStoreInfo *info);

Unref and potentially free info , and all associated memory.

Parameters

summary

a CamelStoreSummary object

 

info

a CamelStoreInfo

 

camel_store_summary_remove ()

void
camel_store_summary_remove (CamelStoreSummary *summary,
                            CamelStoreInfo *info);

Remove a specific info record from the summary.

Parameters

summary

a CamelStoreSummary object

 

info

a CamelStoreInfo

 

camel_store_summary_remove_path ()

void
camel_store_summary_remove_path (CamelStoreSummary *summary,
                                 const gchar *path);

Remove a specific info record from the summary, by path .

Parameters

summary

a CamelStoreSummary object

 

path

item path

 

camel_store_summary_remove_index ()

void
camel_store_summary_remove_index (CamelStoreSummary *summary,
                                  gint index);

Remove a specific info record from the summary, by index.

Parameters

summary

a CamelStoreSummary object

 

index

item index

 

camel_store_summary_clear ()

void
camel_store_summary_clear (CamelStoreSummary *summary);

Empty the summary contents.

Parameters

summary

a CamelStoreSummary object

 

camel_store_summary_count ()

gint
camel_store_summary_count (CamelStoreSummary *summary);

Get the number of summary items stored in this summary.

Parameters

summary

a CamelStoreSummary object

 

Returns

the number of items gint he summary.


camel_store_summary_index ()

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().

Parameters

summary

a CamelStoreSummary object

 

index

record index

 

Returns

the summary item, or NULL if index is out of range


camel_store_summary_path ()

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().

Parameters

summary

a CamelStoreSummary object

 

path

path to the item

 

Returns

the summary item, or NULL if the path name is not available


camel_store_summary_array ()

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().

Parameters

summary

a CamelStoreSummary object

 

Returns

the summary array


camel_store_summary_array_free ()

void
camel_store_summary_array_free (CamelStoreSummary *summary,
                                GPtrArray *array);

Free the folder summary array.

Parameters

summary

a CamelStoreSummary object

 

array

the summary array as gotten from camel_store_summary_array()

 

camel_store_info_string ()

const gchar *
camel_store_info_string (CamelStoreSummary *summary,
                         const CamelStoreInfo *info,
                         gint type);

Get a specific string from the info .

Parameters

summary

a CamelStoreSummary object

 

info

a CamelStoreInfo

 

type

specific string being requested

 

Returns

the string value


camel_store_info_set_string ()

void
camel_store_info_set_string (CamelStoreSummary *summary,
                             CamelStoreInfo *info,
                             gint type,
                             const gchar *value);

Set a specific string on the info .

Parameters

summary

a CamelStoreSummary object

 

info

a CamelStoreInfo

 

type

specific string being set

 

value

string value to set

 

camel_store_info_path()

#define camel_store_info_path(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_PATH))

camel_store_info_name()

#define camel_store_info_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_STORE_INFO_NAME))

camel_store_summary_lock ()

void
camel_store_summary_lock (CamelStoreSummary *summary,
                          CamelStoreSummaryLock lock);

Locks summary 's lock . Unlock it with camel_store_summary_unlock().

Parameters

summary

a CamelStoreSummary

 

lock

lock type to lock

 

Since 2.32


camel_store_summary_unlock ()

void
camel_store_summary_unlock (CamelStoreSummary *summary,
                            CamelStoreSummaryLock lock);

Unlocks summary 's lock , previously locked with camel_store_summary_lock().

Parameters

summary

a CamelStoreSummary

 

lock

lock type to unlock

 

Since 2.32


camel_store_summary_connect_folder_summary ()

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.

Parameters

summary

a CamelStoreSummary object

 

path

used path for folder_summary

 

folder_summary

a CamelFolderSummary object

 

Returns

Whether successfully connect callbacks for count change notifications.

Since 3.4


camel_store_summary_disconnect_folder_summary ()

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().

Parameters

summary

a CamelStoreSummary object

 

folder_summary

a CamelFolderSummary object

 

Returns

Whether such connection existed and whether was successfully removed.

Since 3.4

Types and Values

struct CamelStoreInfo

struct CamelStoreInfo {
	guint32 refcount;
	gchar *path;
	guint32 flags;
	guint32 unread;
	guint32 total;
};

enum CamelStoreInfoFlags

Members

CAMEL_STORE_INFO_FOLDER_NOSELECT

   

CAMEL_STORE_INFO_FOLDER_NOINFERIORS

   

CAMEL_STORE_INFO_FOLDER_CHILDREN

   

CAMEL_STORE_INFO_FOLDER_NOCHILDREN

   

CAMEL_STORE_INFO_FOLDER_SUBSCRIBED

   

CAMEL_STORE_INFO_FOLDER_VIRTUAL

   

CAMEL_STORE_INFO_FOLDER_SYSTEM

   

CAMEL_STORE_INFO_FOLDER_VTRASH

   

CAMEL_STORE_INFO_FOLDER_SHARED_TO_ME

   

CAMEL_STORE_INFO_FOLDER_SHARED_BY_ME

   

CAMEL_STORE_INFO_FOLDER_READONLY

   

CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW

   

CAMEL_STORE_INFO_FOLDER_FLAGGED

   

CAMEL_STORE_INFO_FOLDER_LAST

   

struct CamelStoreSummary

struct CamelStoreSummary;

enum CamelStoreSummaryFlags

Members

CAMEL_STORE_SUMMARY_DIRTY

   

enum CamelStoreSummaryLock

Members

CAMEL_STORE_SUMMARY_SUMMARY_LOCK

   

CAMEL_STORE_SUMMARY_IO_LOCK

   

CAMEL_STORE_SUMMARY_REF_LOCK

   

Since 2.32