2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2000-05-01 09:47:12 +04:00
|
|
|
|
2002-08-30 21:13:34 +04:00
|
|
|
#include "nsIProperties.idl"
|
2000-05-01 09:47:12 +04:00
|
|
|
|
2002-08-30 22:48:57 +04:00
|
|
|
interface nsIInputStream;
|
|
|
|
interface nsIOutputStream;
|
2013-09-23 21:29:27 +04:00
|
|
|
interface nsISimpleEnumerator;
|
2002-08-30 22:48:57 +04:00
|
|
|
|
2002-08-30 21:13:34 +04:00
|
|
|
[scriptable, uuid(283EE646-1AEF-11D4-98B3-00C04fA0CE9A)]
|
|
|
|
interface nsIPropertyElement : nsISupports {
|
|
|
|
attribute AUTF8String key;
|
|
|
|
attribute AString value;
|
|
|
|
};
|
2000-05-01 09:47:12 +04:00
|
|
|
|
2015-01-18 03:46:48 +03:00
|
|
|
[scriptable, uuid(706867af-0400-4faa-beb1-0dae87308784)]
|
2002-08-30 21:13:34 +04:00
|
|
|
interface nsIPersistentProperties : nsIProperties
|
|
|
|
{
|
2002-08-30 21:33:55 +04:00
|
|
|
/**
|
|
|
|
* load a set of name/value pairs from the input stream
|
|
|
|
* names and values should be in UTF8
|
|
|
|
*/
|
2002-08-30 21:13:34 +04:00
|
|
|
void load(in nsIInputStream input);
|
2002-08-30 21:33:55 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* output the values to the stream - results will be in UTF8
|
|
|
|
*/
|
2002-08-30 21:13:34 +04:00
|
|
|
void save(in nsIOutputStream output, in AUTF8String header);
|
2002-08-30 21:33:55 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* get an enumeration of nsIPropertyElement objects,
|
|
|
|
* which are read-only (i.e. setting properties on the element will
|
|
|
|
* not make changes back into the source nsIPersistentProperties
|
|
|
|
*/
|
2002-08-30 21:13:34 +04:00
|
|
|
nsISimpleEnumerator enumerate();
|
2000-05-01 09:47:12 +04:00
|
|
|
|
2002-08-30 21:33:55 +04:00
|
|
|
/**
|
|
|
|
* shortcut to nsIProperty's get() which retrieves a string value
|
|
|
|
* directly (and thus faster)
|
|
|
|
*/
|
2002-08-30 21:13:34 +04:00
|
|
|
AString getStringProperty(in AUTF8String key);
|
2002-08-30 21:33:55 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* shortcut to nsIProperty's set() which sets a string value
|
2006-10-11 21:21:38 +04:00
|
|
|
* directly (and thus faster). If the given property already exists,
|
|
|
|
* then the old value will be returned
|
2002-08-30 22:43:32 +04:00
|
|
|
*/
|
2002-08-30 21:13:34 +04:00
|
|
|
AString setStringProperty(in AUTF8String key, in AString value);
|
2000-05-01 09:47:12 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
%{C++
|
|
|
|
|
|
|
|
#define NS_IPERSISTENTPROPERTIES_CID \
|
|
|
|
{ 0x2245e573, 0x9464, 0x11d2, \
|
|
|
|
{ 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9 } }
|
|
|
|
|
2000-09-14 03:57:52 +04:00
|
|
|
#define NS_PERSISTENTPROPERTIES_CONTRACTID "@mozilla.org/persistent-properties;1"
|
2000-05-01 09:47:12 +04:00
|
|
|
|
|
|
|
%}
|
2002-08-30 21:13:34 +04:00
|
|
|
|