summaryrefslogtreecommitdiffstats
path: root/comm/mailnews/base/public/nsIMsgFolderCacheElement.idl
blob: dd4b54c4f0111ca947b9ede84811f34bbba2fd98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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);
};