The nsIMsgFolder
interface is used to interact with folders in Thunderbird. This page is out of date. Check https://dxr.mozilla.org/mozilla/source/mailnews/base/public/nsIMsgFolder.idl for the newer methods (esp. isSpecialFolder and such).
Inherits from: nsISupports
void startFolderLoading(); |
void endFolderLoading(); |
void updateFolder(in nsIMsgWindow aWindow); |
nsIMsgFilterList getFilterList(in nsIMsgWindow msgWindow); |
void setFilterList(in nsIMsgFilterList filterList); |
void ForceDBClosed(); |
void Delete(); |
void deleteSubFolders(in nsISupportsArray folders, in nsIMsgWindow msgWindow); |
void propagateDelete(in nsIMsgFolder folder, in boolean deleteStorage,in nsIMsgWindow msgWindow); |
void recursiveDelete(in boolean deleteStorage, in nsIMsgWindow msgWindow); |
void createSubfolder(in AString folderName, in nsIMsgWindow msgWindow); |
nsIMsgFolder addSubfolder(in AString folderName); |
void createStorageIfMissing(in nsIUrlListener urlListener); |
void compact(in nsIUrlListener aListener, in nsIMsgWindow aMsgWindow); |
void compactAll(in nsIUrlListener aListener, innsIMsgWindow aMsgWindow,in nsISupportsArray aFolderArray, in boolean aCompactOfflineAlso,in nsISupportsArray aOfflineFolderArray); |
void compactAllOfflineStores(in nsIMsgWindow aMsgWindow,in nsISupportsArray aOfflineFolderArray); |
void emptyTrash(in nsIMsgWindow aMsgWindow, in nsIUrlListener aListener); |
void rename(in AString name, in nsIMsgWindow msgWindow); |
void renameSubFolders( in nsIMsgWindow msgWindow, in nsIMsgFolder oldFolder); |
AString generateUniqueSubfolderName(in AString prefix,in nsIMsgFolder otherFolder); |
void updateSummaryTotals(in boolean force); |
void summaryChanged(); |
long getNumUnread(in boolean deep); |
long getTotalMessages(in boolean deep); |
void clearNewMessages(); |
void clearRequiresCleanup(); |
void setFlag(in unsigned long flag); |
void clearFlag(in unsigned long flag); |
boolean getFlag(in unsigned long flag); |
void toggleFlag(in unsigned long flag); |
void onFlagChange(in unsigned long flag); |
void setPrefFlag(); |
nsIMsgFolder getFoldersWithFlag(in unsigned long flags, in unsigned long resultsize, out unsigned long numFolders); |
nsISupportsArray getAllFoldersWithFlag(in unsigned long aFlag); |
void getExpansionArray(in nsISupportsArray expansionArray); |
ACString getUriForMsg(in nsIMsgDBHdr msgHdr); |
void deleteMessages(in nsISupportsArray messages,in nsIMsgWindow msgWindow, in boolean deleteStorage, in boolean isMove, in nsIMsgCopyServiceListener listener, in boolean allowUndo); |
void copyMessages(in nsIMsgFolder srcFolder, in nsISupportsArray messages,in boolean isMove, in nsIMsgWindow msgWindow,in nsIMsgCopyServiceListener listener, in boolean isFolder, in boolean allowUndo); |
void copyFolder(in nsIMsgFolder srcFolder, in boolean isMoveFolder,in nsIMsgWindow msgWindow, in nsIMsgCopyServiceListener listener ); |
void copyFileMessage(in nsIFile file, in nsIMsgDBHdr msgToReplace,in boolean isDraft, in unsigned long newMsgFlags,in nsIMsgWindow msgWindow,in nsIMsgCopyServiceListener listener); |
void acquireSemaphore(in nsISupports semHolder); |
void releaseSemaphore(in nsISupports semHolder); |
boolean testSemaphore(in nsISupports semHolder); |
void getNewMessages(in nsIMsgWindow aWindow, in nsIUrlListener aListener); |
void writeToFolderCache(in nsIMsgFolderCache folderCache, in boolean deep); |
long getNumNewMessages(in boolean deep); |
void setNumNewMessages(in long numNewMessages); |
ACString generateMessageURI(in nsMsgKey msgKey); |
void addMessageDispositionState(in nsIMsgDBHdr aMessage,in nsMsgDispositionState aDispositionFlag); |
void markMessagesRead(in nsISupportsArray messages, in boolean markRead); |
void markAllMessagesRead(); |
void markMessagesFlagged(in nsISupportsArray messages, in boolean markFlagged); |
void markThreadRead(in nsIMsgThread thread); |
void setLabelForMessages(in nsISupportsArray messages, in nsMsgLabelValue label); |
nsIMsgDatabase getMsgDatabase(in nsIMsgWindow msgWindow); |
void setMsgDatabase(in nsIMsgDatabase msgDatabase); |
nsIMsgDatabase getDBFolderInfoAndDB(out nsIDBFolderInfo folderInfo); |
nsIMsgDBHdr GetMessageHeader(in nsMsgKey msgKey); |
boolean shouldStoreMsgOffline(in nsMsgKey msgKey); |
boolean hasMsgOffline(in nsMsgKey msgKey); |
nsIInputStream getOfflineFileStream(in nsMsgKey msgKey, out PRUint32 offset, out PRUint32 size); |
void DownloadMessagesForOffline(in nsISupportsArray messages, in nsIMsgWindow window); |
nsIMsgFolder getChildWithURI(in ACString uri, in boolean deep, in boolean caseInsensitive); |
void downloadAllForOffline(in nsIUrlListener listener, in nsIMsgWindow window); |
void enableNotifications(in long notificationType, in boolean enable, in boolean dbBatching); |
boolean isCommandEnabled(in ACString command); |
boolean matchOrChangeFilterDestination(in nsIMsgFolder folder,in boolean caseInsensitive); |
boolean confirmFolderDeletionForFilter(in nsIMsgWindow msgWindow); |
void alertFilterChanged(in nsIMsgWindow msgWindow); |
void throwAlertMsg(in string msgName, in nsIMsgWindow msgWindow); |
AString getStringWithFolderNameFromBundle(in string msgName); |
void notifyCompactCompleted(); |
long compareSortKeys(in nsIMsgFolder msgFolder); |
[noscript] void getSortKey(out octet_ptr key, out unsigned long length); |
boolean callFilterPlugins(in nsIMsgWindow aMsgWindow); |
ACString getStringProperty(in string propertyName); |
void setStringProperty(in string propertyName, in ACString propertyValue); |
boolean isAncestorOf(in nsIMsgFolder folder); |
boolean containsChildNamed(in AString name); |
nsIMsgFolder getChildNamed(in AString aName); |
nsIMsgFolder findSubFolder(in ACString escapedSubFolderName); |
void AddFolderListener(in nsIFolderListener listener); |
void RemoveFolderListener(in nsIFolderListener listener); |
void NotifyPropertyChanged(in nsIAtom property, in ACString oldValue, in ACString newValue); |
void NotifyIntPropertyChanged(in nsIAtom property, in long oldValue, in long newValue); |
void NotifyBoolPropertyChanged(in nsIAtom property, in boolean oldValue, in boolean newValue); |
void NotifyPropertyFlagChanged(in nsIMsgDBHdr item, in nsIAtom property, in unsigned long oldValue, in unsigned long newValue); |
void NotifyUnicharPropertyChanged(in nsIAtom property, in AString oldValue, in AString newValue); |
void NotifyItemAdded(in nsISupports item); |
void NotifyItemRemoved(in nsISupports item); |
void NotifyFolderEvent(in nsIAtom event); |
void ListDescendents(in nsISupportsArray descendents); |
void Shutdown(in boolean shutdownChildren); |
void setInVFEditSearchScope(in boolean aSearchThisFolder, in boolean aSetOnSubFolders); |
void copyDataToOutputStreamForAppend(in nsIInputStream aIStream, in long aLength, in nsIOutputStream outputStream); |
void copyDataDone(); |
void setJunkScoreForMessages(in nsISupportsArray aMessages, in ACString aJunkScore); |
void applyRetentionSettings(); |
boolean fetchMsgPreviewText([array, size_is (aNumKeys)] in nsMsgKey aKeysToFetch, in unsigned long aNumKeys, in boolean aLocalOnly, in nsIUrlListener aUrlListener); |
void addKeywordsToMessages(in nsISupportsArray aMessages, in ACString aKeywords); |
void removeKeywordsFromMessages(in nsISupportsArray aMessages, in ACString aKeywords); |
AUTF8String getMsgTextFromStream(in nsIMsgDBHdr aMsgHdr, in nsIInputStream aStream, in long aBytesToRead, in long aMaxOutputLen, in boolean aCompressQuotes); |
Attribute | Type | Description |
supportsOffline |
boolean |
readonly |
offlineStoreOutputStream |
nsIOutputStream |
readonly |
offlineStoreInputStream |
nsIInputStream |
readonly |
retentionSettings |
nsIMsgRetentionSettings |
|
downloadSettings |
nsIMsgDownloadSettings |
|
sortOrder |
long |
Used for order in the folder pane, folder pickers, etc. |
lastMessageLoaded |
nsMsgKey |
Unique ID to the folder, it is not a globally unique identifier. Will return Note: Does not persist across sessions.
|
URI |
ACString |
Readonly: Old nsIFolder properties and methods. |
name |
AString |
Old nsIFolder properties and methods. |
prettyName |
AString |
Old nsIFolder properties and methods. |
abbreviatedName |
AString |
Readonly: Old nsIFolder properties and methods. |
parent |
nsIMsgFolder | Old nsIFolder properties and methods. |
parentMsgFolder |
nsIMsgFolder | Readonly: Handy accessor when we want a msg folder. |
dBTransferInfo |
nsIDBFolderInfo |
|
subFolders |
nsISimpleEnumerator |
Readonly: Returns an enumerator containing a list of nsIMsgFolder items that are subfolders of the instance this is called on. |
hasSubFolders |
boolean |
Readonly: Returns true if this folder has sub folders. |
messages | nsISimpleEnumerator |
Readonly: Returns a list of Components.interfaces.nsIMsgDBHdr. |
numSubFolders |
unsigned long |
Readonly: Returns the number of sub folders that this folder has. |
inVFEditSearchScope |
boolean |
readonly |
customIdentity |
nsIMsgIdentity |
Readonly: This allows a folder to have a special identity. E.g., you might want to associate an identity with a particular newsgroup, or for IMAP shared folders in the other users namespace, you might want to create a delegated identity. |
gettingNewMessages |
boolean |
Are we running a url as a result of the user clicking get msg. |
filePath |
nsILocalFile |
Local path of this folder. |
baseMessageURI |
ACString |
readonly |
charset |
ACString |
The charset of this folder. |
charsetOverride |
boolean |
|
biffState |
unsigned long |
|
locked |
boolean |
readonly |
flags |
unsigned long |
Direct access to the set/get all the flags at once. |
knowsSearchNntpExtension |
boolean |
readonly |
allowsPosting |
boolean |
readonly |
relativePathName |
ACString |
readonly |
sizeOnDisk |
unsigned long |
Size of this folder on disk (not including .msf file) for IMAP, it's the sum of the size of the messages. |
username |
ACString |
readonly |
hostname |
ACString |
readonly |
expungedBytes |
unsigned long |
readonly |
deletable |
boolean |
Readonly: Can this folder be deleted. For example, special folders cannot be deleted. |
displayRecipients |
boolean |
Readonly: Should we be displaying recipients instead of the sender. For example, in the Sent folder, recipients are more relevant than the sender. |
manyHeadersToDownload |
boolean |
Readonly: Used to determine if it will take a long time to download all the headers in this folder - so that we can do folder notifications synchronously instead of asynchronously. |
requiresCleanup |
boolean |
readonly |
hasNewMessages |
boolean |
Does this folder have new messages. |
firstNewMessage |
nsIMsgDBHdr |
Readonly: The first new message in the folder. |
prettiestName |
AString |
readonly |
folderURL |
ACString |
Readonly: URL for this folder. |
showDeletedMessages |
boolean |
readonly |
server |
nsIMsgIncomingServer |
Readonly: This folder's parent server. |
isServer |
boolean |
Readonly: Is this folder the "phantom" server folder? |
canSubscribe |
boolean |
readonly |
canFileMessages |
boolean |
readonly |
noSelect |
boolean |
readonly: this is an imap no select folder |
imapShared |
boolean |
readonly: this is an imap shared folder |
canDeleteMessages |
boolean |
readonly: can't delete from imap read-only |
canCreateSubfolders |
boolean |
Readonly: Does this folder allow subfolders. For example, newsgroups cannot have subfolders, and the INBOX on some IMAP servers cannot have subfolders. |
canRename |
boolean |
Readonly: Can you change the name of this folder. For example, newsgroups and some special folders can't be renamed. |
canCompact |
boolean |
readonly: |
rootFolder |
nsIMsgFolder |
Readonly: The phantom server folder. |
Constant | Value | Description |
nsMsgBiffState_NewMail |
0 | User has new mail waiting. |
nsMsgBiffState_NoMail |
1 | No new mail is waiting. |
nsMsgBiffState_Unknown |
2 | We dunno whether there is new mail. |
nsMsgDispositionState_None |
-1 | |
nsMsgDispositionState_Replied |
0 | |
nsMsgDispositionState_Forwarded |
1 | |
allMessageCountNotifications |
0 | Turn notifications on/off for various notification types. Currently only supporting allMessageCountNotifications which refers to both total and unread message counts. |
void startFolderLoading();
void endFolderLoading();
Get new headers for the database.
void updateFolder(nsIMsgWindow aWindow);
Get the filter list on folder's server (or in the case of news, the filter list for this newsgroup).
nsIMsgFilterList getFilterList(nsIMsgWindow msgWindow);
void setFilterList(in nsIMsgFilterList filterList);
void ForceDBClosed();
void Delete();
void deleteSubFolders(in nsISupportsArray folders, in nsIMsgWindow msgWindow);
void propagateDelete(in nsIMsgFolder folder, in boolean deleteStorage, in nsIMsgWindow msgWindow);
void recursiveDelete(in boolean deleteStorage, in nsIMsgWindow msgWindow);
void createSubfolder(in AString folderName, in nsIMsgWindow msgWindow);
nsIMsgFolder addSubfolder(in AString folderName);
This method ensures the storage for the folder exists. For local folders, it creates the Berkeley mailbox if missing. For IMAP folders, it subscribes to the folder if it exists, or creates it if it doesn't exist.
void createStorageIfMissing(in nsIUrlListener urlListener);
void compact(in nsIUrlListener aListener, in nsIMsgWindow aMsgWindow);
void compactAll(in nsIUrlListener aListener, in nsIMsgWindow aMsgWindow, in nsISupportsArray aFolderArray, in boolean aCompactOfflineAlso, in nsISupportsArray aOfflineFolderArray);
void compactAllOfflineStores(in nsIMsgWindow aMsgWindow, in nsISupportsArray aOfflineFolderArray);
void emptyTrash(in nsIMsgWindow aMsgWindow, in nsIUrlListener aListener);
Change the name of the folder
void rename(in AString name, in nsIMsgWindow msgWindow);
void renameSubFolders(in nsIMsgWindow msgWindow, in nsIMsgFolder oldFolder);
AString generateUniqueSubfolderName(in AString prefix, in nsIMsgFolder otherFolder);
void updateSummaryTotals(in boolean force);
void summaryChanged();
Get the total number of unread messages in this folder, or in all subfolders.
long getNumUnread(in boolean deep);
Get the total number of messages in this folder, or in all subfolders.
long getTotalMessages(in boolean deep);
Clear new status flag of all of the new messages.
void clearNewMessages();
void clearRequiresCleanup();
Sets a flag on the folder. The known flags are defined in nsMsgFolderFlags.h.
void setFlag(in unsigned long flag);
Clears a flag on the folder. The known flags are defined in nsMsgFolderFlags.h.
void clearFlag(in unsigned long flag);
Determines if a flag is set on the folder or not. The known flags are defined in nsMsgFolderFlags.h.
boolean getFlag(in unsigned long flag);
Toggles a flag on the folder. The known flags are defined in nsMsgFolderFlags.h.
void toggleFlag(in unsigned long flag);
Called to notify the database and/or listeners of a change of flag.
void onFlagChange(in unsigned long flag);
Gets the number of folders and folders that have the specified flag set.
void setPrefFlag();
nsIMsgFolder getFoldersWithFlag(in unsigned long flags, in unsigned long resultsize, out unsigned long numFolders);
nsISupportsArray getAllFoldersWithFlag(in unsigned long aFlag);
void getExpansionArray(in nsISupportsArray expansionArray);
ACString getUriForMsg()(in nsIMsgDBHdr msgHdr);
void deleteMessages(in nsISupportsArray messages, in nsIMsgWindow msgWindow, in boolean deleteStorage, in boolean isMove, in nsIMsgCopyServiceListener listener, in boolean allowUndo);
void copyMessages(in nsIMsgFolder srcFolder, in nsISupportsArray messages, in boolean isMove, in nsIMsgWindow msgWindow, in nsIMsgCopyServiceListener listener, in boolean isFolder, in boolean allowUndo);
void copyFolder(in nsIMsgFolder srcFolder, in boolean isMoveFolder, in nsIMsgWindow msgWindow, in nsIMsgCopyServiceListener listener);
void copyFileMessage(in nsIFile file, in nsIMsgDBHdr msgToReplace, in boolean isDraft, in unsigned long newMsgFlags, in nsIMsgWindow msgWindow, in nsIMsgCopyServiceListener listener);
void acquireSemaphore(in nsISupports semHolder);
void releaseSemaphore(in nsISupports semHolder);
boolean testSemaphore(in nsISupports semHolder);
void getNewMessages(in nsIMsgWindow aWindow, in nsIUrlListener aListener);
Write out summary data for this folder to the given folder cache (i.e. panacea.dat)
void writeToFolderCache(in nsIMsgFolderCache folderCache, in boolean deep);
The number of new messages since this folder was last visited
long getNumNewMessages(in boolean deep);
void setNumNewMessages(in long numNewMessages);
ACString generateMessageURI(in nsMsgKey msgKey);
void addMessageDispositionState(in nsIMsgDBHdr aMessage, in nsMsgDispositionState aDispositionFlag);
void markMessagesRead(in nsISupportsArray messages, in boolean markRead);
void markAllMessagesRead();
void markMessagesFlagged(in nsISupportsArray messages, in boolean markFlagged);
void markThreadRead(in nsIMsgThread thread);
void setLabelForMessages(in nsISupportsArray messages, in nsMsgLabelValue label);
nsIMsgDatabase getMsgDatabase(in nsIMsgWindow msgWindow);
void setMsgDatabase(in nsIMsgDatabase msgDatabase);
nsIMsgDatabase getDBFolderInfoAndDB(out nsIDBFolderInfo folderInfo);
nsIMsgDBHdr GetMessageHeader(in nsMsgKey msgKey);
boolean shouldStoreMsgOffline(in nsMsgKey msgKey);
boolean hasMsgOffline(in nsMsgKey msgKey);
nsIInputStream getOfflineFileStream(in nsMsgKey msgKey, out PRUint32 offset, out PRUint32 size);
void DownloadMessagesForOffline(in nsISupportsArray messages, in nsIMsgWindow window);
nsIMsgFolder getChildWithURI(in ACString uri, in boolean deep, in boolean caseInsensitive);
void downloadAllForOffline(in nsIUrlListener listener, in nsIMsgWindow window);
void enableNotifications(in long notificationType, in boolean enable, in boolean dbBatching);
boolean isCommandEnabled(in ACString command);
boolean matchOrChangeFilterDestination(in nsIMsgFolder folder, in boolean caseInsensitive);
boolean confirmFolderDeletionForFilter(in nsIMsgWindow msgWindow);
void alertFilterChanged(in nsIMsgWindow msgWindow);
void throwAlertMsg(in string msgName, in nsIMsgWindow msgWindow);
AString getStringWithFolderNameFromBundle(in string msgName);
void notifyCompactCompleted();
long compareSortKeys(in nsIMsgFolder msgFolder);
[noscript] void getSortKey(out octet_ptr key, out unsigned long length);
boolean callFilterPlugins(in nsIMsgWindow aMsgWindow);
ACString getStringProperty(in string propertyName);
void setStringProperty(in string propertyName, in ACString propertyValue);
Determines if this folder is an ancestor of the supplied folder.
boolean isAncestorOf(in nsIMsgFolder folder);
Looks in immediate children of this folder for the given name.
boolean containsChildNamed(in AString name);
Return the child folder which the specified name.
nsIMsgFolder getChildNamed(in AString aName);
Finds the sub folder with the specified name.
nsIMsgFolder findSubFolder(in ACString escapedSubFolderName);
void AddFolderListener(in nsIFolderListener listener);
void RemoveFolderListener(in nsIFolderListener listener);
void NotifyPropertyChanged(in nsIAtom property, in ACString oldValue, in ACString newValue);
void NotifyIntPropertyChanged(in nsIAtom property, in long oldValue, in long newValue);
void NotifyBoolPropertyChanged(in nsIAtom property, in boolean oldValue, in boolean newValue);
void NotifyPropertyFlagChanged(in nsIMsgDBHdr item, in nsIAtom property, in unsigned long oldValue, in unsigned long newValue);
void NotifyUnicharPropertyChanged(in nsIAtom property, in AString oldValue, in AString newValue);
void NotifyItemAdded(in nsISupports item);
void NotifyItemRemoved(in nsISupports item);
void NotifyFolderEvent(in nsIAtom event);
void ListDescendents(in nsISupportsArray descendents);
void Shutdown(in boolean shutdownChildren);
void setInVFEditSearchScope(in boolean aSearchThisFolder, in boolean aSetOnSubFolders);
void copyDataToOutputStreamForAppend(in nsIInputStream aIStream, in long aLength, in nsIOutputStream outputStream);
void copyDataDone();
void setJunkScoreForMessages(in nsISupportsArray aMessages, in ACString aJunkScore);
void applyRetentionSettings();
Get the beginning of the message bodies for the passed in keys and store them in the msg hdr property "preview". This is intended for new mail alerts, title tips on folders with new messages, and perhaps titletips/message preview in the thread pane.
boolean fetchMsgPreviewText([array, size_is (aNumKeys)] in nsMsgKey aKeysToFetch, in unsigned long aNumKeys, in boolean aLocalOnly, in nsIUrlListener aUrlListener);
Used to set/clear tags - we could have a single method to setKeywords
which would figure out the diffs, but these methods might be more convenient. Keywords are space delimited, in the case of multiple keywords.
void addKeywordsToMessages(in nsISupportsArray aMessages, in ACString aKeywords);
void removeKeywordsFromMessages(in nsISupportsArray aMessages, in ACString aKeywords);
Extract the message preview text from aStream, storing it as a string property on aMsgHdr.
AUTF8String getMsgTextFromStream(in nsIMsgDBHdr aMsgHdr, in nsIInputStream aStream, in long aBytesToRead, in long aMaxOutputLen, in boolean aCompressQuotes);