Added nsIRDFContainer and nsIRDFContainerUtils to replace the old C versions in rdfutil.

This commit is contained in:
waterson%netscape.com 1999-04-26 18:45:59 +00:00
Родитель c1acd45694
Коммит 9c10e840ee
6 изменённых файлов: 170 добавлений и 0 удалений

Просмотреть файл

@ -1,5 +1,7 @@
rdf.h
nsIRDFCompositeDataSource.h
nsIRDFContainer.h
nsIRDFContainerUtils.h
nsIRDFContentSink.h
nsIRDFDataSource.h
nsIRDFNode.h

Просмотреть файл

@ -27,6 +27,8 @@ MODULE = rdf
EXPORTS = \
rdf.h \
nsIRDFCompositeDataSource.h \
nsIRDFContainer.h \
nsIRDFContainerUtils.h \
nsIRDFContentSink.h \
nsIRDFDataSource.h \
nsIRDFNode.h \

Просмотреть файл

@ -24,6 +24,8 @@ DEPTH=..\..\..
EXPORTS=\
rdf.h \
nsIRDFCompositeDataSource.h \
nsIRDFContainer.h \
nsIRDFContainerUtils.h \
nsIRDFContentSink.h \
nsIRDFDataSource.h \
nsIRDFNode.h \

Просмотреть файл

@ -0,0 +1,47 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (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/
*
* 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.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#ifndef nsIRDFContainer_h__
#define nsIRDFContainer_h__
#include "nsRDFInterfaces.h"
PR_EXTERN(nsresult)
NS_NewRDFContainer(nsIRDFContainer** aResult);
PR_EXTERN(nsresult)
NS_NewRDFContainer(nsIRDFDataSource* aDataSource,
nsIRDFResource* aResource,
nsIRDFContainer** aResult);
/**
* Create a cursor on a container that enumerates its contents in
* order
*/
PR_EXTERN(nsresult)
NS_NewContainerEnumerator(nsIRDFDataSource* aDataSource,
nsIRDFResource* aContainer,
nsISimpleEnumerator** aResult);
#endif // nsIRDFContainer_h__

Просмотреть файл

@ -0,0 +1,29 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (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/
*
* 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.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#ifndef nsIRDFContainerUtils_h__
#define nsIRDFContainerUtils_h__
#include "nsRDFInterfaces.h"
extern nsresult
NS_NewRDFContainerUtils(nsIRDFContainerUtils** aResult);
#endif // nsIRDFContainerUtils_h__

Просмотреть файл

@ -10,6 +10,7 @@
#include "nsICollection.h" /* interface nsICollection */
#include "nsIEnumerator.h" /* interface nsIEnumerator */
#include "nsrootidl.h" /* interface nsrootidl */
#include "nsISimpleEnumerator.h" /* interface nsISimpleEnumerator */
#ifdef XPIDL_JS_STUBS
#include "jsapi.h"
@ -309,4 +310,91 @@ class nsIRDFService : public nsISupports {
#endif
};
/* starting interface: nsIRDFContainer */
/* {D4214E90-FB94-11D2-BDD8-00104BDE6048} */
#define NS_IRDFCONTAINER_IID_STR "D4214E90-FB94-11D2-BDD8-00104BDE6048"
#define NS_IRDFCONTAINER_IID \
{0xD4214E90, 0xFB94, 0x11D2, \
{ 0xBD, 0xD8, 0x00, 0x10, 0x4B, 0xDE, 0x60, 0x48 }}
class nsIRDFContainer : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IRDFCONTAINER_IID)
/* void Init (in nsIRDFDataSource aDataSource, in nsIRDFResource aContainer); */
NS_IMETHOD Init(nsIRDFDataSource *aDataSource, nsIRDFResource *aContainer) = 0;
/* long GetCount (); */
NS_IMETHOD GetCount(PRInt32 *_retval) = 0;
/* nsISimpleEnumerator GetElements (); */
NS_IMETHOD GetElements(nsISimpleEnumerator **_retval) = 0;
/* void AppendElement (in nsIRDFNode aElement); */
NS_IMETHOD AppendElement(nsIRDFNode *aElement) = 0;
/* void RemoveElement (in nsIRDFNode aElement, in boolean aRenumber); */
NS_IMETHOD RemoveElement(nsIRDFNode *aElement, PRBool aRenumber) = 0;
/* void InsertElementAt (in nsIRDFNode aElement, in long aIndex, in boolean aRenumber); */
NS_IMETHOD InsertElementAt(nsIRDFNode *aElement, PRInt32 aIndex, PRBool aRenumber) = 0;
/* long IndexOf (in nsIRDFNode aElement); */
NS_IMETHOD IndexOf(nsIRDFNode *aElement, PRInt32 *_retval) = 0;
#ifdef XPIDL_JS_STUBS
static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx);
static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIRDFContainer *priv);
#endif
};
/* starting interface: nsIRDFContainerUtils */
/* {D4214E91-FB94-11D2-BDD8-00104BDE6048} */
#define NS_IRDFCONTAINERUTILS_IID_STR "D4214E91-FB94-11D2-BDD8-00104BDE6048"
#define NS_IRDFCONTAINERUTILS_IID \
{0xD4214E91, 0xFB94, 0x11D2, \
{ 0xBD, 0xD8, 0x00, 0x10, 0x4B, 0xDE, 0x60, 0x48 }}
class nsIRDFContainerUtils : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IRDFCONTAINERUTILS_IID)
/* boolean IsOrdinalProperty (in nsIRDFResource aProperty); */
NS_IMETHOD IsOrdinalProperty(nsIRDFResource *aProperty, PRBool *_retval) = 0;
/* nsIRDFResource IndexToOrdinalResource (in long aIndex); */
NS_IMETHOD IndexToOrdinalResource(PRInt32 aIndex, nsIRDFResource **_retval) = 0;
/* long OrdinalResourceToIndex (in nsIRDFResource aOrdinal); */
NS_IMETHOD OrdinalResourceToIndex(nsIRDFResource *aOrdinal, PRInt32 *_retval) = 0;
/* boolean IsContainer (in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); */
NS_IMETHOD IsContainer(nsIRDFDataSource *aDataSource, nsIRDFResource *aResource, PRBool *_retval) = 0;
/* boolean IsBag (in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); */
NS_IMETHOD IsBag(nsIRDFDataSource *aDataSource, nsIRDFResource *aResource, PRBool *_retval) = 0;
/* boolean IsSeq (in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); */
NS_IMETHOD IsSeq(nsIRDFDataSource *aDataSource, nsIRDFResource *aResource, PRBool *_retval) = 0;
/* boolean IsAlt (in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); */
NS_IMETHOD IsAlt(nsIRDFDataSource *aDataSource, nsIRDFResource *aResource, PRBool *_retval) = 0;
/* nsIRDFContainer MakeBag (in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); */
NS_IMETHOD MakeBag(nsIRDFDataSource *aDataSource, nsIRDFResource *aResource, nsIRDFContainer **_retval) = 0;
/* nsIRDFContainer MakeSeq (in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); */
NS_IMETHOD MakeSeq(nsIRDFDataSource *aDataSource, nsIRDFResource *aResource, nsIRDFContainer **_retval) = 0;
/* nsIRDFContainer MakeAlt (in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); */
NS_IMETHOD MakeAlt(nsIRDFDataSource *aDataSource, nsIRDFResource *aResource, nsIRDFContainer **_retval) = 0;
#ifdef XPIDL_JS_STUBS
static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx);
static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIRDFContainerUtils *priv);
#endif
};
#endif /* __gen_nsRDFInterfaces_h__ */