|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
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 interface nsIAtom; |
|
9 |
|
10 %{C++ |
|
11 #define NS_ATOMSERVICE_CID \ |
|
12 { /* ed3db3fc-0168-4cab-8818-98f5475a490c */ \ |
|
13 0xed3db3fc, \ |
|
14 0x0168, \ |
|
15 0x4cab, \ |
|
16 {0x88, 0x18, 0x98, 0xf5, 0x47, 0x5a, 0x49, 0x0c} } |
|
17 |
|
18 #define NS_ATOMSERVICE_CONTRACTID "@mozilla.org/atom-service;1" |
|
19 %} |
|
20 |
|
21 /* |
|
22 * Should this really be scriptable? Using atoms from script or proxies |
|
23 * could be dangerous since double-wrapping could lead to loss of |
|
24 * pointer identity. |
|
25 */ |
|
26 |
|
27 [scriptable, uuid(9c1f50b9-f9eb-42d4-a8cb-2c7600aeb241)] |
|
28 interface nsIAtomService : nsISupports { |
|
29 |
|
30 /** |
|
31 * Version of NS_NewAtom that doesn't require linking against the |
|
32 * XPCOM library. See nsIAtom.idl. |
|
33 */ |
|
34 nsIAtom getAtom(in AString value); |
|
35 |
|
36 /** |
|
37 * Version of NS_NewPermanentAtom that doesn't require linking against |
|
38 * the XPCOM library. See nsIAtom.idl. |
|
39 */ |
|
40 nsIAtom getPermanentAtom(in AString value); |
|
41 |
|
42 /** |
|
43 * Get an atom with a utf8 string. |
|
44 */ |
|
45 [noscript] nsIAtom getAtomUTF8(in string value); |
|
46 [noscript] nsIAtom getPermanentAtomUTF8(in string value); |
|
47 }; |