xpcom/ds/nsIAtomService.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/ds/nsIAtomService.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +interface nsIAtom;
    1.12 +
    1.13 +%{C++
    1.14 +#define NS_ATOMSERVICE_CID \
    1.15 +{ /* ed3db3fc-0168-4cab-8818-98f5475a490c */ \
    1.16 +    0xed3db3fc,                              \
    1.17 +    0x0168,                                  \
    1.18 +    0x4cab,                                  \
    1.19 +    {0x88, 0x18, 0x98, 0xf5, 0x47, 0x5a, 0x49, 0x0c} }
    1.20 +
    1.21 +#define NS_ATOMSERVICE_CONTRACTID "@mozilla.org/atom-service;1"
    1.22 +%}
    1.23 +
    1.24 +/*
    1.25 + * Should this really be scriptable?  Using atoms from script or proxies
    1.26 + * could be dangerous since double-wrapping could lead to loss of
    1.27 + * pointer identity.
    1.28 + */
    1.29 + 
    1.30 +[scriptable, uuid(9c1f50b9-f9eb-42d4-a8cb-2c7600aeb241)]
    1.31 +interface nsIAtomService : nsISupports {
    1.32 +
    1.33 +  /**
    1.34 +   * Version of NS_NewAtom that doesn't require linking against the
    1.35 +   * XPCOM library.  See nsIAtom.idl.
    1.36 +   */
    1.37 +  nsIAtom getAtom(in AString value);
    1.38 +
    1.39 +  /**
    1.40 +   * Version of NS_NewPermanentAtom that doesn't require linking against
    1.41 +   * the XPCOM library.  See nsIAtom.idl.
    1.42 +   */
    1.43 +  nsIAtom getPermanentAtom(in AString value);
    1.44 +
    1.45 +  /**
    1.46 +   * Get an atom with a utf8 string.
    1.47 +   */
    1.48 +  [noscript] nsIAtom getAtomUTF8(in string value);
    1.49 +  [noscript] nsIAtom getPermanentAtomUTF8(in string value);
    1.50 +};

mercurial