rdf/base/public/nsIRDFContentSink.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/rdf/base/public/nsIRDFContentSink.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     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 +/*
    1.10 +
    1.11 +  An RDF-specific content sink. The content sink is targeted by the
    1.12 +  parser for building the RDF content model.
    1.13 +
    1.14 + */
    1.15 +
    1.16 +#ifndef nsIRDFContentSink_h___
    1.17 +#define nsIRDFContentSink_h___
    1.18 +
    1.19 +#include "nsIXMLContentSink.h"
    1.20 +class nsIRDFDataSource;
    1.21 +class nsIURI;
    1.22 +
    1.23 +// {3a7459d7-d723-483c-aef0-404fc48e09b8}
    1.24 +#define NS_IRDFCONTENTSINK_IID \
    1.25 +{ 0x3a7459d7, 0xd723, 0x483c, { 0xae, 0xf0, 0x40, 0x4f, 0xc4, 0x8e, 0x09, 0xb8 } }
    1.26 +
    1.27 +/**
    1.28 + * This interface represents a content sink for RDF files.
    1.29 + */
    1.30 +
    1.31 +class nsIRDFContentSink : public nsIXMLContentSink {
    1.32 +public:
    1.33 +    NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRDFCONTENTSINK_IID)
    1.34 +
    1.35 +    /**
    1.36 +     * Initialize the content sink.
    1.37 +     */
    1.38 +    NS_IMETHOD Init(nsIURI* aURL) = 0;
    1.39 +
    1.40 +    /**
    1.41 +     * Set the content sink's RDF Data source
    1.42 +     */
    1.43 +    NS_IMETHOD SetDataSource(nsIRDFDataSource* aDataSource) = 0;
    1.44 +
    1.45 +    /**
    1.46 +     * Retrieve the content sink's RDF data source.
    1.47 +     */
    1.48 +    NS_IMETHOD GetDataSource(nsIRDFDataSource*& rDataSource) = 0;
    1.49 +};
    1.50 +
    1.51 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIRDFContentSink, NS_IRDFCONTENTSINK_IID)
    1.52 +
    1.53 +/**
    1.54 + * This constructs a content sink that can be used without a
    1.55 + * document, say, to create a stand-alone in-memory graph.
    1.56 + */
    1.57 +nsresult
    1.58 +NS_NewRDFContentSink(nsIRDFContentSink** aResult);
    1.59 +
    1.60 +#endif // nsIRDFContentSink_h___

mercurial