Revision control

Copy as Markdown

Other Tools

/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
[scriptable, uuid(360848be-f694-40db-80ef-793a2c43ddcb)]
interface nsIImapFlagAndUidState : nsISupports
{
readonly attribute long numberOfMessages;
readonly attribute long numberOfRecentMessages;
/**
* If a full update, the total number of deleted messages
* in the folder; if a partial update, the number of deleted
* messages in the partial update
**/
readonly attribute long numberOfDeletedMessages;
/**
* If this is true, instead of fetching 1:* (FLAGS), and putting all
* UIDs and flags in the array, we only fetched the uids and flags
* that changed since the last time we were selected on this folder.
* This means we have a sparse array, and should not assume missing
* UIDs have been deleted.
**/
readonly attribute boolean partialUIDFetch;
/**
* Set of flags the server supports storing per message. See nsImapCore.h
* for the set of flags.
*/
readonly attribute unsigned short supportedUserFlags;
/**
* Check if a UID is in the state.
* @param uid - The message UID.
* @returns True if UID is in the state.
*/
boolean hasMessage(in unsigned long uid);
/**
* OR's the passed in flags with the previous flags because we want to
* accumulate the FLAGS and PERMANENTFLAGS response.
*
* @param aFlags - flags to OR with current flags.
*/
void orSupportedUserFlags(in unsigned short aFlags);
unsigned long getUidOfMessage(in long zeroBasedIndex);
unsigned short getMessageFlags(in long zeroBasedIndex);
void setMessageFlags(in long zeroBasedIndex, in unsigned short flags);
void expungeByIndex(in unsigned long zeroBasedIndex);
void addUidFlagPair(in unsigned long uid, in unsigned short flags, in unsigned long zeroBasedIndex);
void addUidCustomFlagPair(in unsigned long uid, in string customFlag);
/**
* Get the message flags by the message UID.
* @param uid - The message UID.
* @returns The message flags.
*/
unsigned short getMessageFlagsByUid(in unsigned long uid);
string getCustomFlags(in unsigned long uid); // returns space-separated keywords
void reset();
void clearCustomFlags(in unsigned long uid);
/**
* Adds custom attributes to a hash table for the purpose of storing them
* them.
* @param aUid UID of the associated msg
* @param aCustomAttributeName Name of the custom attribute value
* @param aCustomAttributeValue Value of the attribute,
*/
void setCustomAttribute(in unsigned long aUid,
in ACString aCustomAttributeName,
in ACString aCustomAttributeValue);
/**
* Gets the custom attributes from the hash table where they were stored earlier
* them.
* @param aUid UID of the associated msg
* @param aCustomAttributeName Name of the custom attribute value
* @param aCustomAttributeValue Value of the attribute,
*/
ACString getCustomAttribute(in unsigned long aUid,
in ACString aCustomAttributeName);
};