Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/xmloff/inc/RDFaImportHelper.hxx
Line
Count
Source
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 rdf { class XMetadatable; }
30
    namespace rdf { class XRepositorySupplier; }
31
}
32
33
class SvXMLImport;
34
35
namespace xmloff {
36
37
struct RDFaEntry;
38
struct ParsedRDFaAttributes;
39
40
class RDFaImportHelper
41
{
42
43
private:
44
    const SvXMLImport & m_rImport;
45
46
    ::std::vector< RDFaEntry > m_RDFaEntries;
47
48
0
    const SvXMLImport & GetImport() const { return m_rImport; }
49
50
51
public:
52
    RDFaImportHelper(const SvXMLImport & i_rImport);
53
54
    ~RDFaImportHelper();
55
56
    /** Parse RDFa attributes */
57
    std::shared_ptr<ParsedRDFaAttributes> ParseRDFa(
58
        OUString const & i_rAbout,
59
        OUString const & i_rProperty,
60
        OUString const & i_rContent,
61
        OUString const & i_rDatatype);
62
63
    /** Add a RDFa statement; must have been parsed with ParseRDFa */
64
    void AddRDFa(
65
        css::uno::Reference< css::rdf::XMetadatable> const & i_xObject,
66
        std::shared_ptr<ParsedRDFaAttributes> const & i_pRDFaAttributes);
67
68
    /** Parse and add a RDFa statement; parameters are XML attribute values */
69
    void ParseAndAddRDFa(
70
        css::uno::Reference< css::rdf::XMetadatable> const & i_xObject,
71
        OUString const & i_rAbout,
72
        OUString const & i_rProperty,
73
        OUString const & i_rContent,
74
        OUString const & i_rDatatype);
75
76
    /** Insert all added statements into the RDF repository.
77
        <p> This is done <em>after</em> the input file has been read,
78
        to prevent collision between generated ids and ids in the file.</p>
79
     */
80
    void InsertRDFa( css::uno::Reference< css::rdf::XRepositorySupplier > const & i_xModel);
81
};
82
83
} // namespace xmloff
84
85
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */