Class Flag.

Maps IMAP flag names to ids using the flag_names table.

An IMAP flag is just a string, like "\Deleted" or "spam". RFC 3501 defines "\Seen", "\Flagged", "\Answered", "\Draft", "\Deleted", and "\Recent", and clients may create other flags.

The flag_names table contains an (id,name) map for all known flags, and the flags table refers to it by id. This class provides lookup functions by id and name.

("\Recent" is special; it is not stored in the flag_names table.)

static void Flag::add( const String & name, uint id )

Records that a flag with the given name and id exists. After this call, id( name ) returns id, and name( id ) returns name.

static StringList Flag::allFlags()

Returns a list of all current known flags (except "\recent" of course), sorted by id().

static uint Flag::id( const String & name )

Returns the id of the flag with the given name, or 0 if the flag is not known.

static String Flag::name( uint id )

Returns the name of the flag with the given id, or an empty string if the flag is not known.

static void Flag::reload( EventHandler * owner )

This function reloads the flag_names table and notifies the owner when that is finished.

static void Flag::rollback()

Discards any flags that have been created by calling add() rather than being loaded from the database.

static void Flag::setup()

This function must be called once from main() to set up and load the flag_names table.

This web page based on source code belonging to Oryx Mail Systems GmbH. All rights reserved.