LibreOffice Module xmloff (master)  1
RDFaImportHelper.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #pragma once
21 
22 #include <memory>
23 #include <vector>
24 
25 #include <com/sun/star/uno/Reference.h>
26 #include <rtl/ustring.hxx>
27 
28 namespace com::sun::star {
29  namespace uno { class XComponentContext; }
30  namespace rdf { class XMetadatable; }
31  namespace rdf { class XRepositorySupplier; }
32 }
33 
34 class SvXMLImport;
35 
36 namespace xmloff {
37 
38 struct RDFaEntry;
39 struct ParsedRDFaAttributes;
40 
42 {
43 
44 private:
46 
47  ::std::vector< RDFaEntry > m_RDFaEntries;
48 
49  const SvXMLImport & GetImport() const { return m_rImport; }
50 
51 
52 public:
53  RDFaImportHelper(const SvXMLImport & i_rImport);
54 
56 
58  std::shared_ptr<ParsedRDFaAttributes> ParseRDFa(
59  OUString const & i_rAbout,
60  OUString const & i_rProperty,
61  OUString const & i_rContent,
62  OUString const & i_rDatatype);
63 
65  void AddRDFa(
66  css::uno::Reference< css::rdf::XMetadatable> const & i_xObject,
67  std::shared_ptr<ParsedRDFaAttributes> const & i_pRDFaAttributes);
68 
70  void ParseAndAddRDFa(
71  css::uno::Reference< css::rdf::XMetadatable> const & i_xObject,
72  OUString const & i_rAbout,
73  OUString const & i_rProperty,
74  OUString const & i_rContent,
75  OUString const & i_rDatatype);
76 
81  void InsertRDFa( css::uno::Reference< css::rdf::XRepositorySupplier > const & i_xModel);
82 };
83 
84 } // namespace xmloff
85 
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::vector< RDFaEntry > m_RDFaEntries
exports com.sun.star. rdf
const SvXMLImport & GetImport() const
const SvXMLImport & m_rImport
std::shared_ptr< ParsedRDFaAttributes > ParseRDFa(OUString const &i_rAbout, OUString const &i_rProperty, OUString const &i_rContent, OUString const &i_rDatatype)
Parse RDFa attributes.
RDFaImportHelper(const SvXMLImport &i_rImport)
void ParseAndAddRDFa(css::uno::Reference< css::rdf::XMetadatable > const &i_xObject, OUString const &i_rAbout, OUString const &i_rProperty, OUString const &i_rContent, OUString const &i_rDatatype)
Parse and add a RDFa statement; parameters are XML attribute values.
void InsertRDFa(css::uno::Reference< css::rdf::XRepositorySupplier > const &i_xModel)
Insert all added statements into the RDF repository.
void AddRDFa(css::uno::Reference< css::rdf::XMetadatable > const &i_xObject, std::shared_ptr< ParsedRDFaAttributes > const &i_pRDFaAttributes)
Add a RDFa statement; must have been parsed with ParseRDFa.