content/xul/templates/src/nsXULTemplateResultSetRDF.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/xul/templates/src/nsXULTemplateResultSetRDF.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     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 +#ifndef nsXULTemplateResultSetRDF_h__
    1.10 +#define nsXULTemplateResultSetRDF_h__
    1.11 +
    1.12 +#include "nsISimpleEnumerator.h"
    1.13 +#include "nsRuleNetwork.h"
    1.14 +#include "nsRDFQuery.h"
    1.15 +#include "nsXULTemplateResultRDF.h"
    1.16 +#include "mozilla/Attributes.h"
    1.17 +
    1.18 +class nsXULTemplateQueryProcessorRDF;
    1.19 +class nsXULTemplateResultRDF;
    1.20 +
    1.21 +/**
    1.22 + * An enumerator used to iterate over a set of results.
    1.23 + */
    1.24 +class nsXULTemplateResultSetRDF MOZ_FINAL : public nsISimpleEnumerator
    1.25 +{
    1.26 +private:
    1.27 +    nsXULTemplateQueryProcessorRDF* mProcessor;
    1.28 +
    1.29 +    nsRDFQuery* mQuery;
    1.30 +
    1.31 +    const InstantiationSet* mInstantiations;
    1.32 +
    1.33 +    nsCOMPtr<nsIRDFResource> mResource;
    1.34 +
    1.35 +    InstantiationSet::List *mCurrent;
    1.36 +
    1.37 +    bool mCheckedNext;
    1.38 +
    1.39 +public:
    1.40 +
    1.41 +    // nsISupports interface
    1.42 +    NS_DECL_ISUPPORTS
    1.43 +
    1.44 +    // nsISimpleEnumerator interface
    1.45 +    NS_DECL_NSISIMPLEENUMERATOR
    1.46 +
    1.47 +    nsXULTemplateResultSetRDF(nsXULTemplateQueryProcessorRDF *aProcessor,
    1.48 +                              nsRDFQuery* aQuery,
    1.49 +                              const InstantiationSet* aInstantiations)
    1.50 +        : mProcessor(aProcessor),
    1.51 +          mQuery(aQuery),
    1.52 +          mInstantiations(aInstantiations),
    1.53 +          mCurrent(nullptr),
    1.54 +          mCheckedNext(false)
    1.55 +    { }
    1.56 +
    1.57 +    ~nsXULTemplateResultSetRDF()
    1.58 +    {
    1.59 +        delete mInstantiations;
    1.60 +    }
    1.61 +};
    1.62 +
    1.63 +#endif // nsXULTemplateResultSetRDF_h__

mercurial