Bug 1690340 - Part 4: Insert the "Page Source" before the "Extensions for Developers...
[gecko.git] / xpcom / ds / nsIPersistentProperties2.idl
blobd0158d6e5b48dad3dbd0e99e4407d42a8dec5d4f
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsIProperties.idl"
8 interface nsIInputStream;
9 interface nsIOutputStream;
10 interface nsISimpleEnumerator;
12 %{C++
13 #include "mozilla/MemoryReporting.h"
16 [scriptable, uuid(283EE646-1AEF-11D4-98B3-00C04fA0CE9A)]
17 interface nsIPropertyElement : nsISupports {
18 attribute AUTF8String key;
19 attribute AString value;
22 [scriptable, uuid(706867af-0400-4faa-beb1-0dae87308784)]
23 interface nsIPersistentProperties : nsIProperties
25 /**
26 * load a set of name/value pairs from the input stream
27 * names and values should be in UTF8
29 void load(in nsIInputStream input);
31 /**
32 * output the values to the stream - results will be in UTF8
34 void save(in nsIOutputStream output, in AUTF8String header);
36 /**
37 * get an enumeration of nsIPropertyElement objects,
38 * which are read-only (i.e. setting properties on the element will
39 * not make changes back into the source nsIPersistentProperties
41 nsISimpleEnumerator enumerate();
43 /**
44 * shortcut to nsIProperty's get() which retrieves a string value
45 * directly (and thus faster)
47 AString getStringProperty(in AUTF8String key);
49 /**
50 * shortcut to nsIProperty's set() which sets a string value
51 * directly (and thus faster). If the given property already exists,
52 * then the old value will be returned
54 AString setStringProperty(in AUTF8String key, in AString value);
56 %{C++
57 virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;