FolderSummary
Object Hierarchy:
Description:
[
CCode ( type_id =
"camel_folder_summary_get_type ()" ) ]
public class FolderSummary :
Object
Manages cached message metadata for a folder.
FolderSummary manages lists of lightweight MessageInfo
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 Index is set via set_index
, the summariser will also generate full-text index entries (for text/... parts) when building the summary from message content.
Content:
Properties:
Creation methods:
Methods:
- public virtual MessageInfo? @get (string uid)
Retrieve a summary item by uid.
- public void @lock ()
Locks this.
- public void @unlock ()
Unlocks this, previously locked with
@lock.
- public void add (MessageInfo info, bool force_keep_uid)
Adds a new info record to the summary.
- public bool check_uid (string uid)
Check if the uid is valid.
- public bool clear () throws Error
Empty the summary contents.
- public uint count ()
Get the number of summary items stored in this summary.
- public GenericArray<unowned string> dup_changed ()
Returns an array of changed UID-s.
- public GenericArray<unowned string> dup_uids ()
Obtain a copy of the stored messag einfor in the
this as a GenericArray with the mesag
einfo UID-s.
- public uint32 get_deleted_count ()
- public uint32 get_flags ()
- public unowned Folder get_folder ()
- public HashTable<unowned string,int> get_hash ()
Returns hash of current stored 'uids' in summary, where key is 'uid'
from the string pool, and value is 1.
- public unowned Index? get_index ()
- public uint32 get_info_flags (string uid)
Retrieve CamelMessageInfo:CamelFolderSummary:flagss for a
message info with UID uid.
- public uint32 get_junk_count ()
- public uint32 get_junk_not_deleted_count ()
- public uint32 get_next_uid ()
- public uint32 get_saved_count ()
- public int64 get_timestamp ()
- public uint32 get_unread_count ()
- public uint32 get_version ()
- public uint32 get_visible_count ()
- public bool header_load (Store store, string folder_name) throws Error
Loads a summary header for the this,
which corresponds to folder_name provided by store.
- public virtual bool header_load_impl (StoreDBFolderRecord record)
- public bool header_save () throws Error
Saves summary header information into the disk.
- public virtual MessageInfo info_new_from_headers (NameValueArray headers)
Create a new info record from a header.
- public virtual MessageInfo info_new_from_message (MimeMessage message)
Create a summary item from a message.
- public virtual MessageInfo info_new_from_parser (MimeParser parser)
Create a new info record from a parser.
- public bool load () throws Error
Loads the summary from the disk.
- public uint32 next_uid ()
Generate a new unique uid value as an integer.
- public virtual string next_uid_string ()
Retrieve the next uid, but as a formatted string.
- public MessageInfo? peek_loaded (string uid)
- public virtual bool prepare_fetch_all () throws Error
Loads all infos into memory, if they are not yet and ensures they will
not be freed in next couple minutes.
- public bool remove (MessageInfo info)
Remove a specific info record from the summary.
- public bool remove_uid (string uid)
Remove a specific info record from the summary, by uid.
- public bool remove_uids (GenericArray<string> uids)
Remove a specific info record from the summary, by uid.
- public bool replace_flags (string uid, uint32 new_flags)
Updates internal counts based on the new_flags for the
message info uid.
- public bool save () throws Error
Saves the content of the this to
disk.
- public void set_flags (uint32 flags)
- public void set_index (Index? index)
Set the index used to index body content.
- public void set_next_uid (uint32 uid)
Set the next minimum uid available.
- public void set_timestamp (int64 timestamp)
Sets timestamp of the this, provided
by the descendants.
- public void set_version (uint32 version)
Sets version of the this.
- public virtual bool summary_header_save (StoreDBFolderRecord inout_record) throws Error
- public void touch ()
Mark the summary as changed, so that a save will force it to be
written back to disk.
Signals:
Inherited Members:
All known members inherited from class GLib.Object