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>
28 #include <rtl/ustring.hxx>
30 namespace com
{ namespace sun
{ namespace star
{
31 namespace uno
{ class XComponentContext
; }
32 namespace rdf
{ class XMetadatable
; }
33 namespace rdf
{ class XRepositorySupplier
; }
41 struct ParsedRDFaAttributes
;
43 class SAL_DLLPRIVATE RDFaImportHelper
47 const SvXMLImport
& m_rImport
;
49 typedef ::std::vector
< RDFaEntry
> RDFaEntries_t
;
51 RDFaEntries_t m_RDFaEntries
;
53 const SvXMLImport
& GetImport() const { return m_rImport
; }
57 RDFaImportHelper(const SvXMLImport
& i_rImport
);
61 /** Parse RDFa attributes */
62 ::boost::shared_ptr
<ParsedRDFaAttributes
> ParseRDFa(
63 OUString
const & i_rAbout
,
64 OUString
const & i_rProperty
,
65 OUString
const & i_rContent
,
66 OUString
const & i_rDatatype
);
68 /** Add a RDFa statement; must have been parsed with ParseRDFa */
70 ::com::sun::star::uno::Reference
< ::com::sun::star::rdf::XMetadatable
>
72 ::boost::shared_ptr
<ParsedRDFaAttributes
> & i_pRDFaAttributes
);
74 /** Parse and add a RDFa statement; parameters are XML attribute values */
76 ::com::sun::star::uno::Reference
< ::com::sun::star::rdf::XMetadatable
>
78 OUString
const & i_rAbout
,
79 OUString
const & i_rProperty
,
80 OUString
const & i_rContent
,
81 OUString
const & i_rDatatype
);
83 /** Insert all added statements into the RDF repository.
84 <p> This is done <em>after</em> the input file has been read,
85 to prevent collision between generated ids and ids in the file.</p>
87 void InsertRDFa( ::com::sun::star::uno::Reference
<
88 ::com::sun::star::rdf::XRepositorySupplier
> const & i_xModel
);
93 #endif // RDFAIMPORTHELPER_HXX
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */