Class Flag.

Inherits EventHandler

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

Flag::Flag()

Constructs a Flag cache. The new object will listen for new flags continuously.

Reimplements EventHandler::EventHandler().

static void Flag::addWatcher( Session * s )

Records that s should be called whenever a new flag is recorded.

static EStringList Flag::allFlags()

Returns a list of all current known flags (except "\recent" of course), sorted by the lowercase version of their names.

void Flag::execute()

Updates the RAM cache from the database table.

Reimplements EventHandler::execute().

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

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

static bool Flag::isDeleted( uint f )

Returns true if f is the "\Deleted" flag and false otherwise.

static bool Flag::isSeen( uint f )

Returns true if f is the "\Seen" flag and false otherwise.

static uint Flag::largestId()

Returns the largest ID currently used by a flag.

static EString 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::removeWatcher( Session * s )

Forgets s.

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 The Archiveopteryx Developers. All rights reserved.