1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 RDFAIMPORTHELPER_HXX
21 #define RDFAIMPORTHELPER_HXX
25 #include <boost/shared_ptr.hpp>
27 #include <com/sun/star/uno/Reference.h>
30 namespace rtl
{ class OUString
; }
32 namespace com
{ namespace sun
{ namespace star
{
33 namespace uno
{ class XComponentContext
; }
34 namespace rdf
{ class XMetadatable
; }
35 namespace rdf
{ class XRepositorySupplier
; }
43 struct ParsedRDFaAttributes
;
45 class SAL_DLLPRIVATE RDFaImportHelper
49 const SvXMLImport
& m_rImport
;
51 typedef ::std::vector
< RDFaEntry
> RDFaEntries_t
;
53 RDFaEntries_t m_RDFaEntries
;
55 const SvXMLImport
& GetImport() const { return m_rImport
; }
59 RDFaImportHelper(const SvXMLImport
& i_rImport
);
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
);
70 /** Add a RDFa statement; must have been parsed with ParseRDFa */
72 ::com::sun::star::uno::Reference
< ::com::sun::star::rdf::XMetadatable
>
74 ::boost::shared_ptr
<ParsedRDFaAttributes
> & i_pRDFaAttributes
);
76 /** Parse and add a RDFa statement; parameters are XML attribute values */
78 ::com::sun::star::uno::Reference
< ::com::sun::star::rdf::XMetadatable
>
80 ::rtl::OUString
const & i_rAbout
,
81 ::rtl::OUString
const & i_rProperty
,
82 ::rtl::OUString
const & i_rContent
,
83 ::rtl::OUString
const & i_rDatatype
);
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>
89 void InsertRDFa( ::com::sun::star::uno::Reference
<
90 ::com::sun::star::rdf::XRepositorySupplier
> const & i_xModel
);
95 #endif // RDFAIMPORTHELPER_HXX
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */