1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38 #include "nsISupports.idl"
39 #include "nsISupportsArray.idl"
40 interface nsIMsgWindow;
41 interface nsIUrlListener;
42 interface nsIMsgDatabase;
43 interface nsIMsgDBHdr;
44 interface nsIMsgFolder;
45 interface nsIMsgCopyServiceListener;
46
47 [ptr] native nsLocalFolderScanState(nsLocalFolderScanState);
48
49 %{C++
50 /* flags for markMsgsOnPop3Server */
51 #define POP3_NONE 0
52 #define POP3_DELETE 1
53 #define POP3_FETCH_BODY 2
54 #define POP3_FORCE_DEL 3
55
56 struct nsLocalFolderScanState;
57 %}
58
59 [scriptable, uuid(260398bd-9152-4b10-af4e-3126dcd37837)]
60 interface nsIMsgLocalMailFolder : nsISupports {
61 /**
62 * set the default flags on the subfolders of this folder, such as
63 * Drafts, Templates, etc
64 * you should bitwise OR all the flags all mailboxes you want to flag,
65 * this function will be smart and find the right names.
66 * like MSG_FOLDER_FLAG_INBOX | MSG_FOLDER_FLAG_DRAFTS | etc
67 */
68 void setFlagsOnDefaultMailboxes(in unsigned long flags);
69
70 /*
71 * This will return null if the db is out of date
72 */
73 nsIMsgDatabase getDatabaseWOReparse();
74
75 /*
76 * This will kick off a url to reparse the db if it's out of date.
77 * If aReparseUrlListener isn ull, folder will use itself as the listener
78 */
79 nsIMsgDatabase getDatabaseWithReparse(in nsIUrlListener aReparseUrlListener, in nsIMsgWindow aMsgWindow);
80 void parseFolder(in nsIMsgWindow aMsgWindow, in nsIUrlListener listener);
81 void copyFolderLocal(in nsIMsgFolder srcFolder, in boolean isMove, in nsIMsgWindow msgWindow, in nsIMsgCopyServiceListener listener );
82 void copyAllSubFolders(in nsIMsgFolder srcFolder, in nsIMsgWindow msgWindow, in nsIMsgCopyServiceListener listener );
83 void onCopyCompleted(in nsISupports aSrcSupport, in boolean aMoveCopySucceeded);
84 attribute boolean checkForNewMessagesAfterParsing;
85 [noscript] void markMsgsOnPop3Server(in nsISupportsArray aMessages, in PRInt32 aMark);
86 void refreshSizeOnDisk(); // file size on disk has possibly changed - update and notify
87
88 // this adds a message to the end of the folder, parsing it as it goes, and
89 // applying filters, if applicable.
90 void addMessage(in string aMessage);
91 /**
92 * functions for updating the UI while running DownloadMessagesForOffline:
93 * delete the old message before adding its newly downloaded body, and
94 * select the new message after it has replaced the old one
95 */
96 void deleteDownloadMsg(in nsIMsgDBHdr aMsgHdr, out boolean aDoSelect);
97 void selectDownloadMsg();
98 void notifyDelete();
99
100 /**
101 * functions for grubbing thru a folder to find the Uidl for a
102 * given msgDBHdr
103 */
104 [noscript] void getFolderScanState(in nsLocalFolderScanState aState);
105 [noscript] void getUidlFromFolder(in nsLocalFolderScanState aState, in nsIMsgDBHdr aMsgHdr);
106
107 boolean warnIfLocalFileTooBig(in nsIMsgWindow aWindow);
108 };