modules/libpref/public/nsIPrefLocalizedString.idl

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:7244d10de228
1 /* -*- Mode: IDL; 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/. */
5
6 #include "nsISupports.idl"
7
8 /**
9 * The nsIPrefLocalizedString interface is simply a wrapper interface for
10 * nsISupportsString so the preferences service can have a unique identifier
11 * to distinguish between requests for normal wide strings (nsISupportsString)
12 * and "localized" wide strings, which get their default values from properites
13 * files.
14 *
15 * @see nsIPrefBranch
16 * @see nsISupportsString
17 */
18
19 [scriptable, uuid(ae419e24-1dd1-11b2-b39a-d3e5e7073802)]
20 interface nsIPrefLocalizedString : nsISupports
21 {
22 /**
23 * Provides access to string data stored in this property.
24 *
25 * @throws Error An error occurred.
26 */
27 attribute wstring data;
28
29 /**
30 * Used to retrieve the contents of this object into a wide string.
31 *
32 * @return wstring The string containing the data stored within this object.
33 */
34 wstring toString();
35
36 /**
37 * Used to set the contents of this object.
38 *
39 * @param length The length of the string. This value should not include
40 * space for the null terminator, nor should it account for the
41 * size of a character. It should only be the number of
42 * characters for which there is space in the string.
43 * @param data The string data to be stored.
44 *
45 * @note
46 * This makes a copy of the string argument passed in.
47 */
48 void setDataWithLength(in unsigned long length,
49 [size_is(length)] in wstring data);
50 };
51
52 %{C++
53
54 #define NS_PREFLOCALIZEDSTRING_CID \
55 { /* {064d9cee-1dd2-11b2-83e3-d25ab0193c26} */ \
56 0x064d9cee, \
57 0x1dd2, \
58 0x11b2, \
59 { 0x83, 0xe3, 0xd2, 0x5a, 0xb0, 0x19, 0x3c, 0x26 } \
60 }
61
62 #define NS_PREFLOCALIZEDSTRING_CONTRACTID "@mozilla.org/pref-localizedstring;1"
63
64 %}

mercurial