summaryrefslogtreecommitdiffstats
path: root/comm/mailnews/base/public/nsIFolderListener.idl
diff options
context:
space:
mode:
Diffstat (limited to 'comm/mailnews/base/public/nsIFolderListener.idl')
-rw-r--r--comm/mailnews/base/public/nsIFolderListener.idl70
1 files changed, 70 insertions, 0 deletions
diff --git a/comm/mailnews/base/public/nsIFolderListener.idl b/comm/mailnews/base/public/nsIFolderListener.idl
new file mode 100644
index 0000000000..3906ef2f46
--- /dev/null
+++ b/comm/mailnews/base/public/nsIFolderListener.idl
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsISupports.idl"
+
+interface nsIMsgFolder;
+interface nsIMsgDBHdr;
+
+typedef unsigned long folderListenerNotifyFlagValue;
+
+/**
+ * nsIFolderListener defines callbacks to handle various notifications
+ * about changes in folders.
+ * These listeners can be attached to individual folders, or they
+ * can be registered globally, with nsIMsgMailSession.
+ * These notifications originate from nsIMsgFolder implementations.
+ * (nsIMsgFolder has corresponding methods for generating these
+ * notifications).
+ */
+[scriptable, uuid(f60ee1a2-6d81-422c-958f-d408b1b2daa7)]
+interface nsIFolderListener : nsISupports {
+ // "added" flag covers adding both messages and child folders.
+ const folderListenerNotifyFlagValue added = 0x1;
+ void onFolderAdded(in nsIMsgFolder parent, in nsIMsgFolder child);
+ void onMessageAdded(in nsIMsgFolder parent, in nsIMsgDBHdr msg);
+
+ // "removed" flag covers removing both messages and child folders.
+ const folderListenerNotifyFlagValue removed = 0x2;
+ void onFolderRemoved(in nsIMsgFolder parent, in nsIMsgFolder child);
+ void onMessageRemoved(in nsIMsgFolder parent, in nsIMsgDBHdr msg);
+
+ const folderListenerNotifyFlagValue propertyChanged = 0x4;
+ void onFolderPropertyChanged(in nsIMsgFolder folder,
+ in ACString property,
+ in AUTF8String oldValue,
+ in AUTF8String newValue);
+
+ const folderListenerNotifyFlagValue intPropertyChanged = 0x8;
+ // While this property handles long long (64bit wide) values,
+ // the Javascript engine will only pass values up to 2^53 to the consumers.
+ void onFolderIntPropertyChanged(in nsIMsgFolder folder,
+ in ACString property,
+ in long long oldValue,
+ in long long newValue);
+
+ const folderListenerNotifyFlagValue boolPropertyChanged = 0x10;
+ void onFolderBoolPropertyChanged(in nsIMsgFolder folder,
+ in ACString property,
+ in boolean oldValue,
+ in boolean newValue);
+
+ const folderListenerNotifyFlagValue unicharPropertyChanged = 0x20;
+ void onFolderUnicharPropertyChanged(in nsIMsgFolder folder,
+ in ACString property,
+ in AString oldValue,
+ in AString newValue);
+
+ const folderListenerNotifyFlagValue propertyFlagChanged = 0x40;
+ void onFolderPropertyFlagChanged(in nsIMsgDBHdr msg,
+ in ACString property,
+ in unsigned long oldFlag,
+ in unsigned long newFlag);
+
+ const folderListenerNotifyFlagValue event = 0x80;
+ void onFolderEvent(in nsIMsgFolder folder, in ACString event);
+
+ const folderListenerNotifyFlagValue all = 0xFFFFFFFF;
+};