2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1999-05-04 07:37:07 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.1 (the "License"); you may not use this file except in
|
|
|
|
* compliance with the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/NPL/
|
1999-05-04 07:37:07 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1999-05-04 07:37:07 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:43:54 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-05-04 07:37:07 +04:00
|
|
|
|
1999-11-24 23:51:39 +03:00
|
|
|
#include "nsrootidl.idl"
|
1999-05-04 07:37:07 +04:00
|
|
|
#include "nsIRDFNode.idl"
|
|
|
|
|
|
|
|
|
1999-06-26 00:51:13 +04:00
|
|
|
/**
|
|
|
|
* An nsIRDFResource is an object that has unique identity in the
|
|
|
|
* RDF data model. The object's identity is determined by its URI.
|
|
|
|
*/
|
1999-05-04 07:37:07 +04:00
|
|
|
[scriptable, uuid(E0C493D1-9542-11d2-8EB8-00805F29F370)]
|
|
|
|
interface nsIRDFResource : nsIRDFNode {
|
1999-06-26 00:51:13 +04:00
|
|
|
/**
|
|
|
|
* The single-byte string value of the resource
|
|
|
|
*/
|
1999-05-04 07:37:07 +04:00
|
|
|
readonly attribute string Value;
|
|
|
|
|
1999-06-26 00:51:13 +04:00
|
|
|
/**
|
|
|
|
* An unscriptable version used to avoid a string copy. Meant
|
|
|
|
* for use as a performance optimization.
|
|
|
|
*/
|
|
|
|
[noscript] void GetValueConst([shared] out string aConstValue);
|
1999-05-04 07:37:07 +04:00
|
|
|
|
1999-06-26 00:51:13 +04:00
|
|
|
/**
|
|
|
|
* This method is called by the nsIRDFService after constructing
|
|
|
|
* a resource object to initialize it's URI. You would not normally
|
|
|
|
* call this method directly
|
|
|
|
*/
|
|
|
|
void Init(in string uri);
|
1999-05-04 07:37:07 +04:00
|
|
|
|
1999-06-26 00:51:13 +04:00
|
|
|
/**
|
|
|
|
* Determine if the resource has the given URI.
|
|
|
|
*/
|
1999-05-04 07:37:07 +04:00
|
|
|
boolean EqualsString(in string aURI);
|
1999-11-24 23:51:39 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve the "delegate" object for this resource. A resource
|
|
|
|
* may have several delegate objects, each of whose lifetimes is
|
|
|
|
* bound to the life of the resource object.
|
|
|
|
*
|
|
|
|
* This method will return the delegate for the given key after
|
|
|
|
* QueryInterface()-ing it to the requested IID.
|
|
|
|
*
|
|
|
|
* If no delegate exists for the specified key, this method will
|
|
|
|
* attempt to create one using the component manager. Specifically,
|
|
|
|
* it will combine aKey with the resource's URI scheme to produce
|
2000-09-14 03:57:52 +04:00
|
|
|
* a ContractID as follows:
|
1999-11-24 23:51:39 +03:00
|
|
|
*
|
|
|
|
* component:/rdf/delegate-factory/[key]/[scheme]
|
|
|
|
*
|
2000-09-14 03:57:52 +04:00
|
|
|
* This ContractID will be used to locate a factory using the
|
1999-11-24 23:51:39 +03:00
|
|
|
* FindFactory() method of nsIComponentManager. If the nsIFactory
|
|
|
|
* exists, it will be used to create a "delegate factory"; that
|
|
|
|
* is, an object that supports nsIRDFDelegateFactory. The delegate
|
|
|
|
* factory will be used to construct the delegate object.
|
|
|
|
*/
|
|
|
|
void GetDelegate(in string aKey, in nsIIDRef aIID,
|
|
|
|
[iid_is(aIID),retval] out nsQIResult aResult);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Force a delegate to be "unbound" from the resource.
|
|
|
|
*
|
|
|
|
* Normally, a delegate object's lifetime will be identical to
|
|
|
|
* that of the resource to which it is bound; this method allows a
|
|
|
|
* delegate to unlink itself from an RDF resource prematurely.
|
|
|
|
*/
|
|
|
|
void ReleaseDelegate(in string aKey);
|
1999-05-04 07:37:07 +04:00
|
|
|
};
|
|
|
|
|
1999-11-24 23:51:39 +03:00
|
|
|
|