Add notion of a required imap state: authenticated or selected for the imap actions. Add an accessor for the required state. Setup the imap action enum such that the high bit is set for all actions which require us to be in the selected state.

This commit is contained in:
mscott%netscape.com 1999-04-15 03:33:57 +00:00
Родитель b4b8105ad7
Коммит 740cf24c61
1 изменённых файлов: 61 добавлений и 40 удалений

Просмотреть файл

@ -57,49 +57,68 @@ public:
return iid; return iid;
} }
// mscott - we have a basic set of imap url actions. These actions are nsImapActions.
// Certain actions require us to be in the authenticated state and others require us to
// be in the selected state. nsImapState is used to store the state the url needs to
// be in. You'll later see us refer to the imap url state in the imap protocol when we
// are processing the current url. Don't confuse nsImapState with the generic url state
// used to keep track of whether the url is running or not...
typedef enum {
nsImapAuthenticatedState = 0,
nsImapSelectedState
} nsImapState;
typedef enum { typedef enum {
nsImapActionSendText = 0, // a state used for testing purposes to send raw url text straight to the server.... nsImapActionSendText = 0, // a state used for testing purposes to send raw url text straight to the server....
// kAuthenticatedStateURL urls // nsImapAuthenticatedStateUrl urls
nsImapTest, // since the following url actions require us to be in the authenticated
nsImapSelectFolder, // state, the high bit is left blank....
nsImapLiteSelectFolder, nsImapTest = 0x00000001,
nsImapExpungeFolder, nsImapSelectFolder = 0x00000002,
nsImapCreateFolder, nsImapLiteSelectFolder = 0x00000003,
nsImapDeleteFolder, nsImapExpungeFolder = 0x00000004,
nsImapRenameFolder, nsImapCreateFolder = 0x00000005,
nsImapMoveFolderHierarchy, nsImapDeleteFolder = 0x00000006,
nsImapLsubFolders, nsImapRenameFolder = 0x00000007,
nsImapGetMailAccountUrl, nsImapMoveFolderHierarchy = 0x00000008,
nsImapDiscoverChildrenUrl, nsImapLsubFolders = 0x00000009,
nsImapDiscoverLevelChildrenUrl, nsImapGetMailAccountUrl = 0x0000000A,
nsImapDiscoverAllBoxesUrl, nsImapDiscoverChildrenUrl = 0x0000000B,
nsImapDiscoverAllAndSubscribedBoxesUrl, nsImapDiscoverLevelChildrenUrl = 0x0000000C,
nsImapAppendMsgFromFile, nsImapDiscoverAllBoxesUrl = 0x0000000D,
nsImapSubscribe, nsImapDiscoverAllAndSubscribedBoxesUrl = 0x0000000E,
nsImapUnsubscribe, nsImapAppendMsgFromFile = 0x0000000F,
nsImapRefreshACL, nsImapSubscribe = 0x00000010,
nsImapRefreshAllACLs, nsImapUnsubscribe = 0x00000011,
nsImapListFolder, nsImapRefreshACL = 0x00000012,
nsImapUpgradeToSubscription, nsImapRefreshAllACLs = 0x00000013,
nsImapFolderStatus, nsImapListFolder = 0x00000014,
nsImapRefreshFolderUrls, nsImapUpgradeToSubscription = 0x00000015,
nsImapFolderStatus = 0x00000016,
nsImapRefreshFolderUrls = 0x00000017,
// it's okay to add more imap actions that require us to
// be in the authenticated state here without renumbering
// the imap selected state url actions. just make sure you don't
// set the high bit...
// kSelectedStateURL urls // nsImapSelectedState urls. Note, the high bit is always set for
nsImapMsgFetch, // imap actions which require us to be in the selected state
nsImapMsgHeader, nsImapMsgFetch = 0x10000018,
nsImapSearch, nsImapMsgHeader = 0x10000019,
nsImapDeleteMsg, nsImapSearch = 0x1000001A,
nsImapDeleteAllMsgs, nsImapDeleteMsg = 0x1000001B,
nsImapAddMsgFlags, nsImapDeleteAllMsgs = 0x1000001C,
nsImapSubtractMsgFlags, nsImapAddMsgFlags = 0x1000001D,
nsImapSetMsgFlags, nsImapSubtractMsgFlags = 0x1000001E,
nsImapOnlineCopy, nsImapSetMsgFlags = 0x1000001F,
nsImapOnlineMove, nsImapOnlineCopy = 0x10000020,
nsImapOnlineToOfflineCopy, nsImapOnlineMove = 0x10000021,
nsImapOnlineToOfflineMove, nsImapOnlineToOfflineCopy = 0x10000022,
nsImapOfflineToOnlineMove, nsImapOnlineToOfflineMove = 0x10000023,
nsImapBiff, nsImapOfflineToOnlineMove = 0x10000024,
nsImapSelectNoopFolder nsImapBiff = 0x10000025,
nsImapSelectNoopFolder = 0x10000026
} nsImapAction; } nsImapAction;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -131,6 +150,8 @@ public:
NS_IMETHOD GetImapAction(nsImapAction * aImapAction) = 0; NS_IMETHOD GetImapAction(nsImapAction * aImapAction) = 0;
NS_IMETHOD SetImapAction(nsImapAction aImapAction) = 0; NS_IMETHOD SetImapAction(nsImapAction aImapAction) = 0;
NS_IMETHOD GetRequiredImapState(nsImapState * aImapUrlState) = 0;
NS_IMETHOD GetImapPartToFetch(char **resultPart) = 0; NS_IMETHOD GetImapPartToFetch(char **resultPart) = 0;
NS_IMETHOD AllocateCanonicalPath(const char *serverPath, char onlineDelimiter, char **allocatedPath ) = 0; NS_IMETHOD AllocateCanonicalPath(const char *serverPath, char onlineDelimiter, char **allocatedPath ) = 0;
NS_IMETHOD CreateServerSourceFolderPathString(char **result) = 0; NS_IMETHOD CreateServerSourceFolderPathString(char **result) = 0;