nsIRDFContentSink.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /*
  6. An RDF-specific content sink. The content sink is targeted by the
  7. parser for building the RDF content model.
  8. */
  9. #ifndef nsIRDFContentSink_h___
  10. #define nsIRDFContentSink_h___
  11. #include "nsIXMLContentSink.h"
  12. class nsIRDFDataSource;
  13. class nsIURI;
  14. // {3a7459d7-d723-483c-aef0-404fc48e09b8}
  15. #define NS_IRDFCONTENTSINK_IID \
  16. { 0x3a7459d7, 0xd723, 0x483c, { 0xae, 0xf0, 0x40, 0x4f, 0xc4, 0x8e, 0x09, 0xb8 } }
  17. /**
  18. * This interface represents a content sink for RDF files.
  19. */
  20. class nsIRDFContentSink : public nsIXMLContentSink {
  21. public:
  22. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRDFCONTENTSINK_IID)
  23. /**
  24. * Initialize the content sink.
  25. */
  26. NS_IMETHOD Init(nsIURI* aURL) = 0;
  27. /**
  28. * Set the content sink's RDF Data source
  29. */
  30. NS_IMETHOD SetDataSource(nsIRDFDataSource* aDataSource) = 0;
  31. /**
  32. * Retrieve the content sink's RDF data source.
  33. */
  34. NS_IMETHOD GetDataSource(nsIRDFDataSource*& rDataSource) = 0;
  35. };
  36. NS_DEFINE_STATIC_IID_ACCESSOR(nsIRDFContentSink, NS_IRDFCONTENTSINK_IID)
  37. /**
  38. * This constructs a content sink that can be used without a
  39. * document, say, to create a stand-alone in-memory graph.
  40. */
  41. nsresult
  42. NS_NewRDFContentSink(nsIRDFContentSink** aResult);
  43. class nsRDFAtoms {
  44. public:
  45. static void RegisterAtoms();
  46. };
  47. #endif // nsIRDFContentSink_h___