LibreOffice Module writerfilter (master) 1
SmartTagHandler.hxx
Go to the documentation of this file.
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#pragma once
10
11#include <vector>
12
13#include "LoggedResources.hxx"
14
15namespace com::sun::star
16{
17namespace rdf
18{
19class XDocumentMetadataAccess;
20}
21namespace text
22{
23class XTextDocument;
24class XTextRange;
25}
26namespace uno
27{
28class XComponentContext;
29}
30}
31
33{
36{
37 css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
38 css::uno::Reference<css::rdf::XDocumentMetadataAccess> m_xDocumentMetadataAccess;
39 OUString m_aURI;
40 OUString m_aElement;
41 std::vector<std::pair<OUString, OUString>> m_aAttributes;
42
43public:
44 SmartTagHandler(css::uno::Reference<css::uno::XComponentContext> xComponentContext,
45 const css::uno::Reference<css::text::XTextDocument>& xTextDocument);
46 ~SmartTagHandler() override;
47
48 void lcl_attribute(Id nId, Value& rValue) override;
49 void lcl_sprm(Sprm& rSprm) override;
50
51 void setURI(const OUString& rURI);
52 void setElement(const OUString& rElement);
53
55 void handle(const css::uno::Reference<css::text::XTextRange>& xParagraph);
56};
57
58} // namespace writerfilter::dmapper
59
60/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
An SPRM: Section, Paragraph and Run Modifier.
Handler for smart tags, i.e. <w:smartTag> and below.
void lcl_sprm(Sprm &rSprm) override
SmartTagHandler(css::uno::Reference< css::uno::XComponentContext > xComponentContext, const css::uno::Reference< css::text::XTextDocument > &xTextDocument)
void setElement(const OUString &rElement)
std::vector< std::pair< OUString, OUString > > m_aAttributes
css::uno::Reference< css::uno::XComponentContext > m_xComponentContext
void lcl_attribute(Id nId, Value &rValue) override
void handle(const css::uno::Reference< css::text::XTextRange > &xParagraph)
Set m_aAttributes as RDF statements on xParagraph.
css::uno::Reference< css::rdf::XDocumentMetadataAccess > m_xDocumentMetadataAccess
def text(shape, orig_st)
sal_uInt32 Id