Back to index

lightning-sunbird  0.9+nobinonly
nsIImapProtocol.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 #include "nsIStreamListener.idl"
00040 
00041 interface nsIUrlListener;
00042 interface nsIURI;
00043 interface nsIImapUrl;
00044 interface nsIEventQueue;
00045 interface nsIImapProtocol;
00046 interface nsIImapIncomingServer;
00047 interface nsISupportsArray;
00048 interface nsIMsgFolder;
00049 interface nsIImapHostSessionList;
00050 interface nsIMsgWindow;
00051 
00052 [scriptable, uuid(0f660d51-e3f1-4f80-86b5-66fa31732f2b)]
00053 interface nsIImapProtocol : nsISupports {
00055        /* LoadUrl should really be pushed into a generic protocol interface
00056        // I think. Imap happens to be the only case where we need to push back
00057        // a thread safe object to our test app. 
00059        void LoadImapUrl(in nsIURI aUrl, in nsISupports aConsumer);
00060 
00062        // IsBusy returns true if the connection is currently processing a url
00063        // and false otherwise.
00065        void IsBusy(out boolean aIsConnectionBusy, 
00066                       out boolean isInboxConnection);
00067 
00068        // Protocol instance examines the url, looking at the host name,
00069        // user name and folder the action would be on in order to figure out
00070        // if it can process this url. I decided to push the semantics about
00071        // whether a connection can handle a url down into the connection level
00072        // instead of in the connection cache.
00073        void CanHandleUrl(in nsIImapUrl aImapUrl, out boolean aCanRunUrl,
00074                             out boolean hasToWait);
00075 
00077        // Right now, initialize requires the event queue of the UI thread, 
00078        // or more importantly the event queue of the consumer of the imap
00079        // protocol data. The protocol also needs a host session list.
00081        void Initialize(in nsIImapHostSessionList aHostSessionList, in nsIImapIncomingServer aServer, 
00082                   in nsIEventQueue aSinkEventQueue) ;
00083 
00084        void NotifyHdrsToDownload(out unsigned long keys, in unsigned long keyCount);
00085        void NotifyBodysToDownload(out unsigned long keys, in unsigned long count);
00086        // methods to get data from the imap parser flag state.
00087        void GetFlagsForUID(in unsigned long uid, out boolean foundIt, out unsigned short flags, out string customFlags);
00088        void GetSupportedUserFlags(out unsigned short flags);
00089 
00090        void GetRunningImapURL(out nsIImapUrl aImapUrl);
00091 
00092   void GetRunningUrl(out nsIURI aUrl);
00093 
00094   // Tell thread to die
00095   void TellThreadToDie(in boolean isSafeToDie);
00096   // Get last active time stamp
00097   void GetLastActiveTimeStamp(out PRTime aTimeStamp);
00098 
00099        void pseudoInterruptMsgLoad(in nsIMsgFolder imapFolder, in nsIMsgWindow aMsgWindow, out boolean interrupted);
00100   void GetSelectedMailboxName(out string folderName);
00101   // Reset folder connection to authenticated state
00102   void ResetToAuthenticatedState();
00103 
00104        void OverrideConnectionInfo(in wstring pHost, in unsigned short pPort, in string pCookieData);
00105 };
00106