xpcom/ds/nsIPersistentProperties2.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsIProperties.idl"
michael@0 7
michael@0 8 interface nsIInputStream;
michael@0 9 interface nsIOutputStream;
michael@0 10 interface nsISimpleEnumerator;
michael@0 11
michael@0 12 [scriptable, uuid(283EE646-1AEF-11D4-98B3-00C04fA0CE9A)]
michael@0 13 interface nsIPropertyElement : nsISupports {
michael@0 14 attribute AUTF8String key;
michael@0 15 attribute AString value;
michael@0 16 };
michael@0 17
michael@0 18 [scriptable, uuid(1A180F60-93B2-11d2-9B8B-00805F8A16D9)]
michael@0 19 interface nsIPersistentProperties : nsIProperties
michael@0 20 {
michael@0 21 /**
michael@0 22 * load a set of name/value pairs from the input stream
michael@0 23 * names and values should be in UTF8
michael@0 24 */
michael@0 25 void load(in nsIInputStream input);
michael@0 26
michael@0 27 /**
michael@0 28 * output the values to the stream - results will be in UTF8
michael@0 29 */
michael@0 30 void save(in nsIOutputStream output, in AUTF8String header);
michael@0 31
michael@0 32 /**
michael@0 33 * call subclass() to make future calls to load() set the properties
michael@0 34 * in this "superclass" instead
michael@0 35 */
michael@0 36 void subclass(in nsIPersistentProperties superclass);
michael@0 37
michael@0 38 /**
michael@0 39 * get an enumeration of nsIPropertyElement objects,
michael@0 40 * which are read-only (i.e. setting properties on the element will
michael@0 41 * not make changes back into the source nsIPersistentProperties
michael@0 42 */
michael@0 43 nsISimpleEnumerator enumerate();
michael@0 44
michael@0 45 /**
michael@0 46 * shortcut to nsIProperty's get() which retrieves a string value
michael@0 47 * directly (and thus faster)
michael@0 48 */
michael@0 49 AString getStringProperty(in AUTF8String key);
michael@0 50
michael@0 51 /**
michael@0 52 * shortcut to nsIProperty's set() which sets a string value
michael@0 53 * directly (and thus faster). If the given property already exists,
michael@0 54 * then the old value will be returned
michael@0 55 */
michael@0 56 AString setStringProperty(in AUTF8String key, in AString value);
michael@0 57 };
michael@0 58
michael@0 59
michael@0 60 %{C++
michael@0 61
michael@0 62 #define NS_IPERSISTENTPROPERTIES_CID \
michael@0 63 { 0x2245e573, 0x9464, 0x11d2, \
michael@0 64 { 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9 } }
michael@0 65
michael@0 66 #define NS_PERSISTENTPROPERTIES_CONTRACTID "@mozilla.org/persistent-properties;1"
michael@0 67
michael@0 68 %}
michael@0 69

mercurial