1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/rdf/base/idl/nsIRDFContainerUtils.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,82 @@ 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 +#include "nsIRDFContainer.idl" 1.11 +#include "nsIRDFResource.idl" 1.12 + 1.13 + 1.14 +// Container utilities 1.15 +[scriptable, uuid(D4214E91-FB94-11D2-BDD8-00104BDE6048)] 1.16 +interface nsIRDFContainerUtils : nsISupports { 1.17 + /** 1.18 + * Returns 'true' if the property is an RDF ordinal property. 1.19 + */ 1.20 + boolean IsOrdinalProperty(in nsIRDFResource aProperty); 1.21 + 1.22 + /** 1.23 + * Convert the specified index to an ordinal property. 1.24 + */ 1.25 + nsIRDFResource IndexToOrdinalResource(in long aIndex); 1.26 + 1.27 + /** 1.28 + * Convert the specified ordinal property into an index 1.29 + */ 1.30 + long OrdinalResourceToIndex(in nsIRDFResource aOrdinal); 1.31 + 1.32 + /** 1.33 + * Return 'true' if the specified resource is a container 1.34 + */ 1.35 + boolean IsContainer(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); 1.36 + 1.37 + /** 1.38 + * Return 'true' if the specified resource is a container and it is empty 1.39 + */ 1.40 + boolean IsEmpty(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); 1.41 + 1.42 + /** 1.43 + * Return 'true' if the specified resource is a bag 1.44 + */ 1.45 + boolean IsBag(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); 1.46 + 1.47 + /** 1.48 + * Return 'true' if the specified resource is a sequence 1.49 + */ 1.50 + boolean IsSeq(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); 1.51 + 1.52 + /** 1.53 + * Return 'true' if the specified resource is an alternation 1.54 + */ 1.55 + boolean IsAlt(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); 1.56 + 1.57 + /** 1.58 + * Decorates the specified resource appropriately to make it 1.59 + * usable as an empty bag in the specified data source. 1.60 + */ 1.61 + nsIRDFContainer MakeBag(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); 1.62 + 1.63 + /** 1.64 + * Decorates the specified resource appropriately to make it 1.65 + * usable as an empty sequence in the specified data source. 1.66 + */ 1.67 + nsIRDFContainer MakeSeq(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); 1.68 + 1.69 + /** 1.70 + * Decorates the specified resource appropriately to make it 1.71 + * usable as an empty alternation in the specified data source. 1.72 + */ 1.73 + nsIRDFContainer MakeAlt(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); 1.74 + 1.75 + /** 1.76 + * Retrieve the index of element in the container. Returns -1 if 1.77 + * the element is not in the container. 1.78 + */ 1.79 + long indexOf(in nsIRDFDataSource aDataSource, in nsIRDFResource aContainer, in nsIRDFNode aElement); 1.80 +}; 1.81 + 1.82 +%{C++ 1.83 +extern nsresult 1.84 +NS_NewRDFContainerUtils(nsIRDFContainerUtils** aResult); 1.85 +%}