Back to index

lightning-sunbird  0.9+nobinonly
nsIImapUrl.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 2000
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #include "nsISupports.idl"
00039 
00040 interface nsIImapMailFolderSink;
00041 interface nsIImapMessageSink;
00042 interface nsIImapServerSink;
00043 interface nsIImapMockChannel;
00044 interface nsIFileSpec;
00045 interface nsIMsgFolder;
00046 
00047 typedef long nsImapAction;
00048 typedef long nsImapState;
00049 
00050 typedef unsigned short imapMessageFlagsType;
00051 
00052 typedef long nsImapContentModifiedType;
00053 
00054 [scriptable, uuid(2e91901e-ff6c-11d3-b9fa-00108335942a)]
00055 interface nsImapContentModifiedTypes
00056 {
00057        const long IMAP_CONTENT_NOT_MODIFIED = 0;
00058        const long IMAP_CONTENT_MODIFIED_VIEW_INLINE = 1;
00059        const long IMAP_CONTENT_MODIFIED_VIEW_AS_LINKS = 2;
00060        const long IMAP_CONTENT_FORCE_CONTENT_NOT_MODIFIED = 3;
00061 } ;
00062 
00063 [scriptable, uuid(76497ba8-2a58-4d59-8347-0cf6c6a50586)]
00064 interface nsIImapUrl : nsISupports
00065 {
00066        // Initialization method used to initialize the url...
00067   void Initialize();
00068   void initializeURIforMockChannel();
00069 
00071        // Getters and Setters for the imap specific event sinks to bind to to your url
00073   attribute nsIImapMailFolderSink imapMailFolderSink;
00074   attribute nsIImapMessageSink imapMessageSink;
00075   attribute nsIImapServerSink imapServerSink;
00077        // Getters and Setters for the imap url state
00079   attribute nsImapAction imapAction; 
00080   readonly attribute nsImapState requiredImapState;
00081   readonly attribute string imapPartToFetch;
00082   readonly attribute string customAttributeToFetch;
00083   attribute string customAttributeResult;
00084   readonly attribute string command;
00085   attribute string customCommandResult;
00086   readonly attribute string customAddFlags;
00087   readonly attribute string customSubtractFlags;
00088   void allocateCanonicalPath(in string aServerPath, in char aOnlineDelimiter, out string aAllocatedPath);
00089   void allocateServerPath(in string aCanonicalPath, in char aOnlineDelimiter, out string aAllocatedPath);
00090   string createServerSourceFolderPathString();
00091   string createCanonicalSourceFolderPathString();
00092   string createServerDestinationFolderPathString();
00093   
00094   string addOnlineDirectoryIfNecessary(in string onlineMailboxName);
00095   void createSearchCriteriaString (out string aResult);
00096   void createListOfMessageIdsString (out string aResult);
00097   
00098   boolean messageIdsAreUids();
00099   readonly attribute imapMessageFlagsType msgFlags; // kAddMsgFlags or kSubtractMsgFlags only
00100 
00101   readonly attribute long numBytesToFetch;
00102   attribute char onlineSubDirSeparator;
00103   attribute boolean allowContentChange;
00104   attribute boolean mimePartSelectorDetected;
00105   attribute nsImapContentModifiedType contentModified;
00106   attribute boolean fetchPartsOnDemand;   // set to true if we're fetching a msg for display and want to not download parts
00107   attribute boolean msgLoadingFromCache; // true if this msg load is coming from a cache, so we can know to mark it read
00108   attribute boolean externalLinkUrl; // true if we ran this url because the user clicked on a link.
00109   attribute boolean validUrl; // false if we couldn't parse url for whatever reason.
00110   attribute nsISupports copyState;
00111   attribute nsIFileSpec msgFileSpec;
00112   attribute nsIImapMockChannel mockChannel;
00113   attribute boolean shouldStoreMsgOffline; // set to true if we should store the msg for offline use if we can,
00114                                            // i.e., we're not doing mime parts on demand.
00115   attribute boolean rerunningUrl; // server disconnected first time so we're retrying
00116   void addChannelToLoadGroup();
00117   void removeChannel(in nsresult aStatus);
00118   
00120   // Enumerated types specific to imap urls...
00122 
00123   // the following are nsImapState enums.
00124   // we have a basic set of imap url actions. These actions are nsImapActions.
00125   // Certain actions require us to be in the authenticated state and others require us to
00126   // be in the selected state. nsImapState is used to store the state the url needs to
00127   // be in. You'll later see us refer to the imap url state in the imap protocol when we
00128   // are processing the current url. Don't confuse nsImapState with the generic url state
00129   // used to keep track of whether the url is running or not...
00130   const long nsImapAuthenticatedState = 0;
00131   const long nsImapSelectedState = 1;
00132 
00133   const long nsImapActionSendText = 0;      // a state used for testing purposes to send raw url text straight to the server....
00134        // nsImapAuthenticatedStateUrl urls
00135        // since the following url actions require us to be in the authenticated
00136        // state, the high bit is left blank....
00137   const long nsImapTest     = 0x00000001;
00138   const long nsImapCreateFolder    = 0x00000005;
00139   const long nsImapDeleteFolder    = 0x00000006;
00140   const long nsImapRenameFolder    = 0x00000007;
00141   const long nsImapMoveFolderHierarchy = 0x00000008;
00142   const long nsImapLsubFolders     = 0x00000009;
00143   const long nsImapGetMailAccountUrl = 0x0000000A;
00144   const long nsImapDiscoverChildrenUrl = 0x0000000B;
00145   const long nsImapDiscoverAllBoxesUrl = 0x0000000D;
00146   const long nsImapDiscoverAllAndSubscribedBoxesUrl     = 0x0000000E;
00147   const long nsImapAppendMsgFromFile = 0x0000000F;
00148   const long nsImapSubscribe = 0x00000010;
00149   const long nsImapUnsubscribe = 0x00000011;
00150   const long nsImapRefreshACL      = 0x00000012;
00151   const long nsImapRefreshAllACLs  = 0x00000013;
00152   const long nsImapListFolder      = 0x00000014;
00153   const long nsImapUpgradeToSubscription = 0x00000015;
00154   const long nsImapFolderStatus    = 0x00000016;
00155   const long nsImapRefreshFolderUrls = 0x00000017;
00156   const long nsImapEnsureExistsFolder = 0x00000018;
00157   const long nsImapOfflineToOnlineCopy = 0x00000019;
00158   const long nsImapOfflineToOnlineMove = 0x0000001A;
00159   // it's okay to add more imap actions that require us to 
00160   // be in the authenticated state here without renumbering
00161   // the imap selected state url actions. just make sure you don't
00162   // set the high bit...
00163     
00164   // nsImapSelectedState urls. Note, the high bit is always set for
00165   // imap actions which require us to be in the selected state
00166   const long nsImapSelectFolder    = 0x10000002;
00167   const long nsImapLiteSelectFolder = 0x10000003;
00168   const long nsImapExpungeFolder = 0x10000004;
00169   const long nsImapMsgFetch = 0x10000018;
00170   const long nsImapMsgHeader = 0x10000019;
00171   const long nsImapSearch   = 0x1000001A;
00172   const long nsImapDeleteMsg = 0x1000001B;
00173   const long nsImapDeleteAllMsgs = 0x1000001C;
00174   const long nsImapAddMsgFlags = 0x1000001D;
00175   const long nsImapSubtractMsgFlags       = 0x1000001E;
00176   const long nsImapSetMsgFlags = 0x1000001F;
00177   const long nsImapOnlineCopy      = 0x10000020;
00178   const long nsImapOnlineMove      = 0x10000021;
00179   const long nsImapOnlineToOfflineCopy = 0x10000022;
00180   const long nsImapOnlineToOfflineMove = 0x10000023;
00181   const long nsImapMsgPreview = 0x10000024;
00182   const long nsImapBiff     = 0x10000026;
00183   const long nsImapSelectNoopFolder       = 0x10000027;
00184   const long nsImapAppendDraftFromFile = 0x10000028;
00185   const long nsImapUidExpunge = 0x10000029;
00186   const long nsImapSaveMessageToDisk = 0x10000030;
00187   const long nsImapOpenMimePart = 0x10000031;
00188   const long nsImapMsgDownloadForOffline  = 0x10000032;
00189   const long nsImapDeleteFolderAndMsgs = 0x10000033;
00190   const long nsImapUserDefinedMsgCommand = 0x10000034;
00191   const long nsImapUserDefinedFetchAttribute = 0x10000035;
00192   const long nsImapMsgFetchPeek = 0x10000036;
00193   const long nsImapMsgStoreCustomKeywords = 0x10000037;
00194 };
00195 
00196 %{C++
00197 #define IMAP_PORT 143
00198 #define SECURE_IMAP_PORT 993
00199 %}