Camel.FolderSummary
Description: Reference for Camel.FolderSummary

### Class

# CamelFolderSummary

#### Description [src]

    class Camel.FolderSummary : GObject.Object
    {
      CamelFolderSummaryPrivate* priv
    }

Manages cached message metadata for a folder.

`CamelFolderSummary` manages lists of lightweight `CamelMessageInfo` structures that cache metadata about each message in a folder (flags, UID, subject, from, date, size, etc.). This avoids the need to re-parse messages from storage every time a folder is opened or displayed.

The summary is designed to be persisted to disk so that expensive metadata computation only needs to happen once. It uses a versioned binary file format that supports subclassing: backend-specific implementations can add their own fields to each record.

The base class provides almost all required functionality. Backends typically only need to subclass it to store additional per-message information specific to their storage format.

If a `CamelIndex` is set via camel_folder_summary_set_index(), the summariser will also generate full-text index entries (for text/… parts) when building the summary from message content.

#### Hierarchy

#### Ancestors

- GObject

#### Descendants

- CamelVeeSummary

#### Constructors

###### camel_folder_summary_new

Create a new `CamelFolderSummary` object.

#### Instance methods

###### camel_folder_summary_add

Adds a new `info` record to the summary. If the `force_keep_uid` is `FALSE`, then a new uid is automatically re-assigned by calling camel_folder_summary_next_uid_string(). It’s an error to use `force_keep_uid` when the `info` has none set.

###### camel_folder_summary_check_uid

Check if the uid is valid. This isn’t very efficient, so it shouldn’t be called iteratively.

since: 2.24

###### camel_folder_summary_clear

Empty the summary contents.

###### camel_folder_summary_count

Get the number of summary items stored in this summary.

###### camel_folder_summary_dup_changed

Returns an array of changed UID-s. A UID is considered changed when its corresponding CamelMesageInfo is ‘dirty’ or when it has set the #CAMEL_MESSAGE_FOLDER_FLAGGED flag.

since: 3.58

###### camel_folder_summary_dup_uids

Obtain a copy of the stored messag einfor in the `summary` as a `GPtrArray` with the mesag einfo UID-s.

since: 3.58

###### camel_folder_summary_get

Retrieve a summary item by uid.

since: 3.4

###### camel_folder_summary_get_deleted_count

No description available.

since: 3.4

###### camel_folder_summary_get_flags

No description available.

since: 3.24

###### camel_folder_summary_get_folder

No description available.

since: 3.4

###### camel_folder_summary_get_hash

Returns hash of current stored ‘uids’ in summary, where key is ‘uid’ from the string pool, and value is 1. The returned pointer should be freed with g_hash_table_destroy().

since: 3.6

###### camel_folder_summary_get_index

No description available.

since: 3.4

###### camel_folder_summary_get_info_flags

Retrieve CamelMessageInfo::flags for a message info with UID `uid`. This is much quicker than camel_folder_summary_get(), because it doesn’t require reading the message info from a disk.

since: 3.12

###### camel_folder_summary_get_junk_count

No description available.

since: 3.4

###### camel_folder_summary_get_junk_not_deleted_count

No description available.

since: 3.4

###### camel_folder_summary_get_next_uid

No description available.

since: 3.4

###### camel_folder_summary_get_saved_count

No description available.

since: 3.4

###### camel_folder_summary_get_timestamp

No description available.

since: 3.24

###### camel_folder_summary_get_unread_count

No description available.

since: 3.4

###### camel_folder_summary_get_version

No description available.

since: 3.24

###### camel_folder_summary_get_visible_count

No description available.

since: 3.4

###### camel_folder_summary_header_load

Loads a summary header for the `summary`, which corresponds to `folder_name` provided by `store`.

since: 3.24

###### camel_folder_summary_header_save

Saves summary header information into the disk. The function does nothing, if the summary doesn’t support save to disk.

since: 3.24

###### camel_folder_summary_info_new_from_headers

Create a new info record from a header.

since: 3.24

###### camel_folder_summary_info_new_from_message

Create a summary item from a message.

###### camel_folder_summary_info_new_from_parser

Create a new info record from a parser. If the parser cannot determine a uid, then none will be assigned.

###### camel_folder_summary_load

Loads the summary from the disk. It also saves any pending changes first.

since: 3.24

###### camel_folder_summary_lock

Locks `summary`. Unlock it with camel_folder_summary_unlock().

since: 2.32

###### camel_folder_summary_next_uid

Generate a new unique uid value as an integer. This may be used to create a unique sequence of numbers.

###### camel_folder_summary_next_uid_string

Retrieve the next uid, but as a formatted string.

###### camel_folder_summary_peek_loaded

No description available.

since: 2.26

###### camel_folder_summary_prepare_fetch_all

Loads all infos into memory, if they are not yet and ensures they will not be freed in next couple minutes. Call this function before any mass operation or when all message infos will be needed, for better performance.

since: 2.32

###### camel_folder_summary_remove

Remove a specific `info` record from the summary.

###### camel_folder_summary_remove_uid

Remove a specific info record from the summary, by `uid`.

###### camel_folder_summary_remove_uids

Remove a specific info record from the summary, by `uid`.

since: 3.6

###### camel_folder_summary_replace_flags

Updates internal counts based on the `new_flags` for the message info `uid`.

since: 3.58

###### camel_folder_summary_save

Saves the content of the `summary` to disk. It does nothing, when the summary is not changed or when it doesn’t support permanent save.

since: 3.24

###### camel_folder_summary_set_flags

Sets flags of the `summary`, a bit-or of `CamelFolderSummaryFlags`.

since: 3.24

###### camel_folder_summary_set_index

Set the index used to index body content. If the index is `NULL`, or not set (the default), no indexing of body content will take place.

###### camel_folder_summary_set_next_uid

Set the next minimum uid available. This can be used to ensure new uid’s do not clash with existing uid’s.

###### camel_folder_summary_set_timestamp

Sets timestamp of the `summary`, provided by the descendants. This doesn’t change the ‘dirty’ flag of the `summary`.

since: 3.24

###### camel_folder_summary_set_version

Sets version of the `summary`.

since: 3.24

###### camel_folder_summary_touch

Mark the summary as changed, so that a save will force it to be written back to disk.

###### camel_folder_summary_unlock

Unlocks `summary`, previously locked with camel_folder_summary_lock().

since: 2.32

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Camel.FolderSummary:deleted-count

How many deleted infos is saved in a summary.

###### Camel.FolderSummary:folder

The `CamelFolder` to which the folder summary belongs.

###### Camel.FolderSummary:junk-count

How many junk infos is saved in a summary.

###### Camel.FolderSummary:junk-not-deleted-count

How many junk and not deleted infos is saved in a summary.

###### Camel.FolderSummary:saved-count

How many infos is saved in a summary.

###### Camel.FolderSummary:unread-count

How many unread infos is saved in a summary.

###### Camel.FolderSummary:visible-count

How many visible (not deleted and not junk) infos is saved in a summary.

#### Signals

###### Camel.FolderSummary::info-flags-changed

Emitted on call to camel_folder_summary_replace_flags(), when the flags changed.

since: 3.58

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct CamelFolderSummaryClass {
      GObjectClass parent_class;
      GType message_info_type;
      const gchar* collate;
      const gchar* sort_by;
      gboolean (* summary_header_load) (
        CamelFolderSummary* summary,
        CamelStoreDBFolderRecord* record
      );
      gboolean (* summary_header_save) (
        CamelFolderSummary* summary,
        CamelStoreDBFolderRecord* inout_record,
        GError** error
      );
      CamelMessageInfo* (* message_info_new_from_headers) (
        CamelFolderSummary* summary,
        const CamelNameValueArray* headers
      );
      CamelMessageInfo* (* message_info_new_from_parser) (
        CamelFolderSummary* summary,
        CamelMimeParser* parser
      );
      CamelMessageInfo* (* message_info_new_from_message) (
        CamelFolderSummary* summary,
        CamelMimeMessage* message
      );
      CamelMessageInfo* (* message_info_from_uid) (
        CamelFolderSummary* summary,
        const gchar* uid
      );
      gchar* (* next_uid_string) (
        CamelFolderSummary* summary
      );
      gboolean (* prepare_fetch_all) (
        CamelFolderSummary* summary,
        GError** error
      );
      gpointer reserved;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`message_info_type: GType`

  No description available.

`collate: const gchar*`

  No description available.

`sort_by: const gchar*`

  No description available.

`summary_header_load: gboolean (* summary_header_load) ( CamelFolderSummary* summary, CamelStoreDBFolderRecord* record )`

  No description available.

`summary_header_save: gboolean (* summary_header_save) ( CamelFolderSummary* summary, CamelStoreDBFolderRecord* inout_record, GError** error )`

  No description available.

`message_info_new_from_headers: CamelMessageInfo* (* message_info_new_from_headers) ( CamelFolderSummary* summary, const CamelNameValueArray* headers )`

  No description available.

`message_info_new_from_parser: CamelMessageInfo* (* message_info_new_from_parser) ( CamelFolderSummary* summary, CamelMimeParser* parser )`

  No description available.

`message_info_new_from_message: CamelMessageInfo* (* message_info_new_from_message) ( CamelFolderSummary* summary, CamelMimeMessage* message )`

  No description available.

`message_info_from_uid: CamelMessageInfo* (* message_info_from_uid) ( CamelFolderSummary* summary, const gchar* uid )`

  No description available.

`next_uid_string: gchar* (* next_uid_string) ( CamelFolderSummary* summary )`

  No description available.

`prepare_fetch_all: gboolean (* prepare_fetch_all) ( CamelFolderSummary* summary, GError** error )`

  No description available.

`reserved: gpointer`

  No description available.

#### Virtual methods

###### Camel.FolderSummaryClass.message_info_from_uid

Retrieve a summary item by uid.

since: 3.4

###### Camel.FolderSummaryClass.message_info_new_from_headers

Create a new info record from a header.

since: 3.24

###### Camel.FolderSummaryClass.message_info_new_from_message

Create a summary item from a message.

###### Camel.FolderSummaryClass.message_info_new_from_parser

Create a new info record from a parser. If the parser cannot determine a uid, then none will be assigned.

###### Camel.FolderSummaryClass.next_uid_string

Retrieve the next uid, but as a formatted string.

###### Camel.FolderSummaryClass.prepare_fetch_all

Loads all infos into memory, if they are not yet and ensures they will not be freed in next couple minutes. Call this function before any mass operation or when all message infos will be needed, for better performance.

since: 2.32

###### Camel.FolderSummaryClass.summary_header_load

No description available.

###### Camel.FolderSummaryClass.summary_header_save

No description available.