Branch data Line data Source code
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 : : #ifndef RDFAIMPORTHELPER_HXX
21 : : #define RDFAIMPORTHELPER_HXX
22 : :
23 : : #include <vector>
24 : :
25 : : #include <boost/shared_ptr.hpp>
26 : :
27 : : #include <com/sun/star/uno/Reference.h>
28 : :
29 : :
30 : : namespace rtl { class OUString; }
31 : :
32 : : namespace com { namespace sun { namespace star {
33 : : namespace uno { class XComponentContext; }
34 : : namespace rdf { class XMetadatable; }
35 : : namespace rdf { class XRepositorySupplier; }
36 : : } } }
37 : :
38 : : class SvXMLImport;
39 : :
40 : : namespace xmloff {
41 : :
42 : : struct RDFaEntry;
43 : : struct ParsedRDFaAttributes;
44 : :
45 : : class SAL_DLLPRIVATE RDFaImportHelper
46 : : {
47 : :
48 : : private:
49 : : const SvXMLImport & m_rImport;
50 : :
51 : : typedef ::std::vector< RDFaEntry > RDFaEntries_t;
52 : :
53 : : RDFaEntries_t m_RDFaEntries;
54 : :
55 : 88 : const SvXMLImport & GetImport() const { return m_rImport; }
56 : :
57 : :
58 : : public:
59 : : RDFaImportHelper(const SvXMLImport & i_rImport);
60 : :
61 : : ~RDFaImportHelper();
62 : :
63 : : /** Parse RDFa attributes */
64 : : ::boost::shared_ptr<ParsedRDFaAttributes> ParseRDFa(
65 : : ::rtl::OUString const & i_rAbout,
66 : : ::rtl::OUString const & i_rProperty,
67 : : ::rtl::OUString const & i_rContent,
68 : : ::rtl::OUString const & i_rDatatype);
69 : :
70 : : /** Add a RDFa statement; must have been parsed with ParseRDFa */
71 : : void AddRDFa(
72 : : ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable>
73 : : const & i_xObject,
74 : : ::boost::shared_ptr<ParsedRDFaAttributes> & i_pRDFaAttributes);
75 : :
76 : : /** Parse and add a RDFa statement; parameters are XML attribute values */
77 : : void ParseAndAddRDFa(
78 : : ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable>
79 : : const & i_xObject,
80 : : ::rtl::OUString const & i_rAbout,
81 : : ::rtl::OUString const & i_rProperty,
82 : : ::rtl::OUString const & i_rContent,
83 : : ::rtl::OUString const & i_rDatatype);
84 : :
85 : : /** Insert all added statements into the RDF repository.
86 : : <p> This is done <em>after</em> the input file has been read,
87 : : to prevent collision between generated ids and ids in the file.</p>
88 : : */
89 : : void InsertRDFa( ::com::sun::star::uno::Reference<
90 : : ::com::sun::star::rdf::XRepositorySupplier > const & i_xModel);
91 : : };
92 : :
93 : : } // namespace xmloff
94 : :
95 : : #endif // RDFAIMPORTHELPER_HXX
96 : :
97 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|