Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | #include "nsIRDFContainer.idl" |
michael@0 | 8 | #include "nsIRDFResource.idl" |
michael@0 | 9 | |
michael@0 | 10 | |
michael@0 | 11 | // Container utilities |
michael@0 | 12 | [scriptable, uuid(D4214E91-FB94-11D2-BDD8-00104BDE6048)] |
michael@0 | 13 | interface nsIRDFContainerUtils : nsISupports { |
michael@0 | 14 | /** |
michael@0 | 15 | * Returns 'true' if the property is an RDF ordinal property. |
michael@0 | 16 | */ |
michael@0 | 17 | boolean IsOrdinalProperty(in nsIRDFResource aProperty); |
michael@0 | 18 | |
michael@0 | 19 | /** |
michael@0 | 20 | * Convert the specified index to an ordinal property. |
michael@0 | 21 | */ |
michael@0 | 22 | nsIRDFResource IndexToOrdinalResource(in long aIndex); |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * Convert the specified ordinal property into an index |
michael@0 | 26 | */ |
michael@0 | 27 | long OrdinalResourceToIndex(in nsIRDFResource aOrdinal); |
michael@0 | 28 | |
michael@0 | 29 | /** |
michael@0 | 30 | * Return 'true' if the specified resource is a container |
michael@0 | 31 | */ |
michael@0 | 32 | boolean IsContainer(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); |
michael@0 | 33 | |
michael@0 | 34 | /** |
michael@0 | 35 | * Return 'true' if the specified resource is a container and it is empty |
michael@0 | 36 | */ |
michael@0 | 37 | boolean IsEmpty(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); |
michael@0 | 38 | |
michael@0 | 39 | /** |
michael@0 | 40 | * Return 'true' if the specified resource is a bag |
michael@0 | 41 | */ |
michael@0 | 42 | boolean IsBag(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); |
michael@0 | 43 | |
michael@0 | 44 | /** |
michael@0 | 45 | * Return 'true' if the specified resource is a sequence |
michael@0 | 46 | */ |
michael@0 | 47 | boolean IsSeq(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); |
michael@0 | 48 | |
michael@0 | 49 | /** |
michael@0 | 50 | * Return 'true' if the specified resource is an alternation |
michael@0 | 51 | */ |
michael@0 | 52 | boolean IsAlt(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); |
michael@0 | 53 | |
michael@0 | 54 | /** |
michael@0 | 55 | * Decorates the specified resource appropriately to make it |
michael@0 | 56 | * usable as an empty bag in the specified data source. |
michael@0 | 57 | */ |
michael@0 | 58 | nsIRDFContainer MakeBag(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); |
michael@0 | 59 | |
michael@0 | 60 | /** |
michael@0 | 61 | * Decorates the specified resource appropriately to make it |
michael@0 | 62 | * usable as an empty sequence in the specified data source. |
michael@0 | 63 | */ |
michael@0 | 64 | nsIRDFContainer MakeSeq(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); |
michael@0 | 65 | |
michael@0 | 66 | /** |
michael@0 | 67 | * Decorates the specified resource appropriately to make it |
michael@0 | 68 | * usable as an empty alternation in the specified data source. |
michael@0 | 69 | */ |
michael@0 | 70 | nsIRDFContainer MakeAlt(in nsIRDFDataSource aDataSource, in nsIRDFResource aResource); |
michael@0 | 71 | |
michael@0 | 72 | /** |
michael@0 | 73 | * Retrieve the index of element in the container. Returns -1 if |
michael@0 | 74 | * the element is not in the container. |
michael@0 | 75 | */ |
michael@0 | 76 | long indexOf(in nsIRDFDataSource aDataSource, in nsIRDFResource aContainer, in nsIRDFNode aElement); |
michael@0 | 77 | }; |
michael@0 | 78 | |
michael@0 | 79 | %{C++ |
michael@0 | 80 | extern nsresult |
michael@0 | 81 | NS_NewRDFContainerUtils(nsIRDFContainerUtils** aResult); |
michael@0 | 82 | %} |