bump product version to 5.0.4.1
[LibreOffice.git] / xmloff / inc / RDFaImportHelper.hxx
blobceb4c2e50467ac15858d0f1c676bf3d054e38de9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_XMLOFF_INC_RDFAIMPORTHELPER_HXX
21 #define INCLUDED_XMLOFF_INC_RDFAIMPORTHELPER_HXX
23 #include <memory>
24 #include <vector>
26 #include <com/sun/star/uno/Reference.h>
27 #include <rtl/ustring.hxx>
29 namespace com { namespace sun { namespace star {
30 namespace uno { class XComponentContext; }
31 namespace rdf { class XMetadatable; }
32 namespace rdf { class XRepositorySupplier; }
33 } } }
35 class SvXMLImport;
37 namespace xmloff {
39 struct RDFaEntry;
40 struct ParsedRDFaAttributes;
42 class RDFaImportHelper
45 private:
46 const SvXMLImport & m_rImport;
48 typedef ::std::vector< RDFaEntry > RDFaEntries_t;
50 RDFaEntries_t m_RDFaEntries;
52 const SvXMLImport & GetImport() const { return m_rImport; }
55 public:
56 RDFaImportHelper(const SvXMLImport & i_rImport);
58 ~RDFaImportHelper();
60 /** Parse RDFa attributes */
61 std::shared_ptr<ParsedRDFaAttributes> ParseRDFa(
62 OUString const & i_rAbout,
63 OUString const & i_rProperty,
64 OUString const & i_rContent,
65 OUString const & i_rDatatype);
67 /** Add a RDFa statement; must have been parsed with ParseRDFa */
68 void AddRDFa(
69 ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable>
70 const & i_xObject,
71 std::shared_ptr<ParsedRDFaAttributes> & i_pRDFaAttributes);
73 /** Parse and add a RDFa statement; parameters are XML attribute values */
74 void ParseAndAddRDFa(
75 ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable>
76 const & i_xObject,
77 OUString const & i_rAbout,
78 OUString const & i_rProperty,
79 OUString const & i_rContent,
80 OUString const & i_rDatatype);
82 /** Insert all added statements into the RDF repository.
83 <p> This is done <em>after</em> the input file has been read,
84 to prevent collision between generated ids and ids in the file.</p>
86 void InsertRDFa( ::com::sun::star::uno::Reference<
87 ::com::sun::star::rdf::XRepositorySupplier > const & i_xModel);
90 } // namespace xmloff
92 #endif // INCLUDED_XMLOFF_INC_RDFAIMPORTHELPER_HXX
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */