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 * Lorenzo Colitti <lorenzo@colitti.com>
24 *
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
36 *
37 * ***** END LICENSE BLOCK ***** */
38
39 #include "nsISupports.idl"
40 #include "nsIMsgFolder.idl"
41
42 interface nsIMsgWindow;
43 interface nsIImapIncomingServer;
44 interface nsIMsgParseMailMsgState;
45
46 // this is a simple interface which allows the imap folder to update some values
47 // that the folder props js code will use to update the sharing and quota tabs in the folder props.
48
49 [scriptable, uuid(09D99F2C-3E23-4f8c-A536-5C277BAA9585)]
50 interface nsIMsgImapFolderProps : nsISupports {
51
52 void setFolderType(in AString folderType);
53 void setFolderTypeDescription(in AString folderTypeDescription);
54 void setFolderPermissions(in AString permissions);
55 void serverDoesntSupportACL();
56
57 /**
58 * Toggles the display of quota information in the Quota tab of the folder properties.
59 * If on, the quota root, usage, and percentage used are displayed.
60 * If off, a status message is displayed. The status message can be set with setQuotaStatus().
61 * @param showData If true, display the quota root, usage information and usage percentage bar.
62 * If false, display the status message.
63 */
64 void showQuotaData(in boolean showData);
65
66 /**
67 * Sets the status string displayed in the Quota tab of the folder properties if quota
68 * information is not visible.
69 */
70 void setQuotaStatus(in AString folderQuotaStatus);
71
72 /**
73 * Updates the quota data displayed in the Quota tab.
74 */
75 void setQuotaData(in ACString quotaroot, in unsigned long usedKB, in unsigned long maxKB);
76 };
77
78 [scriptable, uuid(D84129DF-02BA-4268-9927-BCE0008083D9)]
79 interface nsIMsgImapMailFolder : nsISupports {
80 void removeSubFolder(in nsIMsgFolder folder);
81 void createClientSubfolderInfo(in ACString folderName, in wchar hierarchyDelimiter, in long flags, in boolean suppressNotification);
82 void list();
83 void renameLocal(in ACString newname, in nsIMsgFolder parent);
84 void prepareToRename();
85 void performExpand(in nsIMsgWindow aMsgWindow);
86 void recursiveCloseActiveConnections(in nsIImapIncomingServer aImapServer);
87 void renameClient(in nsIMsgWindow msgWindow, in nsIMsgFolder msgFolder, in ACString oldName, in ACString newName);
88
89 // these are used for offline synchronization
90 void storeImapFlags(in long aFlags, in boolean aAddFlags, [array, size_is (aNumKeys)]
91 in nsMsgKey aKeysToFlag, in unsigned long aNumKeys, in nsIUrlListener aUrlListener);
92 nsIURI setImapFlags(in string uids, in long flags);
93 void replayOfflineMoveCopy([array, size_is (numKeys)] in nsMsgKey keys, in unsigned long numKeys, in boolean isMove, in nsIMsgFolder aDstFolder,
94 in nsIUrlListener aUrlListener, in nsIMsgWindow aWindow);
95 nsIURI playbackOfflineFolderCreate(in AString folderName, in nsIMsgWindow aWindow);
96 void liteSelect(in nsIUrlListener aUrlListener);
97 void fillInFolderProps(in nsIMsgImapFolderProps aFolderProps);
98 void resetNamespaceReferences();
99 void folderPrivileges(in nsIMsgWindow aWindow);
100 nsIMsgImapMailFolder findOnlineSubFolder(in ACString onlineName);
101 void addFolderRights(in ACString userName, in ACString rights);
102 void refreshFolderRights();
103
104 void updateStatus(in nsIUrlListener aListener, in nsIMsgWindow aMsgWindow);
105 void updateFolder(in nsIMsgWindow aWindow, in nsIUrlListener aListener);
106 // this is used to issue an arbitrary imap command on the passed in msgs.
107 // It assumes the command needs to be run in the selected state.
108 nsIURI issueCommandOnMsgs(in ACString command, in string uids, in nsIMsgWindow aWindow);
109 nsIURI fetchCustomMsgAttribute(in ACString msgAttribute, in string uids, in nsIMsgWindow aWindow);
110 nsIURI storeCustomKeywords(in nsIMsgWindow aMsgWindow,
111 in ACString aFlagsToAdd,
112 in ACString aFlagsToSubtract,
113 [array, size_is (aNumKeys)] in nsMsgKey aKeysToStore,
114 in unsigned long aNumKeys);
115
116 void notifyIfNewMail();
117
118 attribute boolean verifiedAsOnlineFolder;
119 attribute boolean explicitlyVerify;
120 attribute wchar hierarchyDelimiter;
121 attribute long boxFlags;
122 attribute ACString onlineName;
123 attribute boolean isNamespace;
124 readonly attribute boolean canOpenFolder;
125 attribute ACString adminUrl;
126 readonly attribute boolean hasAdminUrl;
127 attribute boolean performingBiff;
128 readonly attribute nsIMsgParseMailMsgState hdrParser;
129
130 /**
131 * Quota
132 * |valid| indicates whether the server has provided quota information on
133 * this folder. This can be false
134 * - if the server does not supports quotas,
135 * - if there are no storage quotas on this folder, or
136 * - if the folder has never been opened.
137 * If it is true and maxKB > 0, the folder has a storage quota and
138 * the usedKB and maxKB attributes are set to the values provided by
139 * the server (in kilobytes), for this quota root.
140 * Lotus Notes sends us maxKB = 0, usedKB > 0 for unlimited quota.
141 */
142 void getQuota(out boolean valid, out unsigned long usedKB, out unsigned long maxKB);
143 };