rdf/base/idl/nsIRDFResource.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/rdf/base/idl/nsIRDFResource.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,81 @@
     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 "nsrootidl.idl"
    1.10 +#include "nsIRDFNode.idl"
    1.11 +
    1.12 +
    1.13 +/**
    1.14 + * An nsIRDFResource is an object that has unique identity in the 
    1.15 + * RDF data model. The object's identity is determined by its URI.
    1.16 + */
    1.17 +[scriptable, uuid(fb9686a7-719a-49dc-9107-10dea5739341)]
    1.18 +interface nsIRDFResource : nsIRDFNode {
    1.19 +    /**
    1.20 +     * The single-byte string value of the resource.
    1.21 +     * @note THIS IS OBSOLETE. C++ should use GetValueConst and script
    1.22 +     *       should use .valueUTF8
    1.23 +     */
    1.24 +    readonly attribute string Value;
    1.25 +
    1.26 +    /**
    1.27 +     * The UTF-8 URI of the resource.
    1.28 +     */
    1.29 +    readonly attribute AUTF8String ValueUTF8;
    1.30 +
    1.31 +    /**
    1.32 +     * An unscriptable version used to avoid a string copy. Meant
    1.33 +     * for use as a performance optimization. The string is encoded
    1.34 +     * in UTF-8.
    1.35 +     */
    1.36 +    [noscript] void GetValueConst([shared] out string aConstValue);
    1.37 +
    1.38 +    /**
    1.39 +     * This method is called by the nsIRDFService after constructing
    1.40 +     * a resource object to initialize its URI. You would not normally
    1.41 +     * call this method directly
    1.42 +     */
    1.43 +    void Init(in string uri);
    1.44 +
    1.45 +    /**
    1.46 +     * Determine if the resource has the given URI.
    1.47 +     */
    1.48 +    boolean EqualsString(in string aURI);
    1.49 +
    1.50 +    /**
    1.51 +     * Retrieve the "delegate" object for this resource. A resource
    1.52 +     * may have several delegate objects, each of whose lifetimes is
    1.53 +     * bound to the life of the resource object.
    1.54 +     *
    1.55 +     * This method will return the delegate for the given key after
    1.56 +     * QueryInterface()-ing it to the requested IID.
    1.57 +     *
    1.58 +     * If no delegate exists for the specified key, this method will
    1.59 +     * attempt to create one using the component manager. Specifically,
    1.60 +     * it will combine aKey with the resource's URI scheme to produce
    1.61 +     * a ContractID as follows:
    1.62 +     *
    1.63 +     *   component:/rdf/delegate-factory/[key]/[scheme]
    1.64 +     *
    1.65 +     * This ContractID will be used to locate a factory using the
    1.66 +     * FindFactory() method of nsIComponentManager. If the nsIFactory
    1.67 +     * exists, it will be used to create a "delegate factory"; that
    1.68 +     * is, an object that supports nsIRDFDelegateFactory. The delegate
    1.69 +     * factory will be used to construct the delegate object.
    1.70 +     */
    1.71 +    void GetDelegate(in string aKey, in nsIIDRef aIID,
    1.72 +                     [iid_is(aIID),retval] out nsQIResult aResult);
    1.73 +
    1.74 +    /**
    1.75 +     * Force a delegate to be "unbound" from the resource.
    1.76 +     *
    1.77 +     * Normally, a delegate object's lifetime will be identical to
    1.78 +     * that of the resource to which it is bound; this method allows a
    1.79 +     * delegate to unlink itself from an RDF resource prematurely.
    1.80 +     */
    1.81 +    void ReleaseDelegate(in string aKey);
    1.82 +};
    1.83 +
    1.84 +

mercurial