summaryrefslogtreecommitdiffstats
path: root/comm/mailnews/base/public/nsIMsgFolderCacheElement.idl
diff options
context:
space:
mode:
Diffstat (limited to 'comm/mailnews/base/public/nsIMsgFolderCacheElement.idl')
-rw-r--r--comm/mailnews/base/public/nsIMsgFolderCacheElement.idl35
1 files changed, 35 insertions, 0 deletions
diff --git a/comm/mailnews/base/public/nsIMsgFolderCacheElement.idl b/comm/mailnews/base/public/nsIMsgFolderCacheElement.idl
new file mode 100644
index 0000000000..dd4b54c4f0
--- /dev/null
+++ b/comm/mailnews/base/public/nsIMsgFolderCacheElement.idl
@@ -0,0 +1,35 @@
+/* -*- Mode: IDL; tab-width: 4; 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 for a folder to get/set its values in the foldercache.
+ */
+[scriptable, uuid(c7392b12-f68a-46b2-af5e-d47350bb17c3)]
+interface nsIMsgFolderCacheElement : nsISupports
+{
+ readonly attribute ACString key;
+ // Notes on the getCached...() functions:
+ // - They will fail if the property doesn't exist. That is, they'll
+ // throw an exception in JS, or return an NS_ERROR_* code in C++.
+ // - null values are returned as empty string (for getCachedString()),
+ // or zero (for the numeric accessors). NOTE: there should be no
+ // way to actually set properties to null, but the
+ // panacea.dat->folderCache.json might have introduced some, so we
+ // need to handle them.
+ // - On the C++ side there is legacy code which calls these functions
+ // without checking the error code and relies on the return value
+ // remaining unchanged if the function fails.
+ AUTF8String getCachedString(in string propertyName);
+ long getCachedInt32(in string propertyName);
+ unsigned long getCachedUInt32(in string propertyName);
+ long long getCachedInt64(in string propertyName);
+
+ void setCachedString(in string propertyName, in AUTF8String propertyValue);
+ void setCachedInt32(in string propertyName, in long propertyValue);
+ void setCachedUInt32(in string propertyName, in unsigned long propertyValue);
+ void setCachedInt64(in string propertyName, in long long propertyValue);
+};