LibreOffice Module sw (master) 1
unotextmarkup.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 * 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 INCLUDED_SW_SOURCE_CORE_INC_UNOTEXTMARKUP_HXX
21#define INCLUDED_SW_SOURCE_CORE_INC_UNOTEXTMARKUP_HXX
22
24
25#include <com/sun/star/text/XTextMarkup.hpp>
26#include <com/sun/star/text/XMultiTextMarkup.hpp>
27
28#include <unobaseclass.hxx>
29
30#include <map>
31
32namespace com::sun::star::container { class XStringKeyMap; }
33namespace com::sun::star::text { class XTextRange; }
34class SwTextNode;
36
40 : public ::cppu::WeakImplHelper
41 < css::text::XTextMarkup
42 , css::text::XMultiTextMarkup
43 >
44{
45public:
46 SwXTextMarkup(SwTextNode *const rTextNode,
47 const ModelToViewHelper& rConversionMap);
48 virtual ~SwXTextMarkup() override;
49
50 // css::text::XTextMarkup:
51 virtual css::uno::Reference< css::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() override;
52
53 virtual void SAL_CALL commitStringMarkup(::sal_Int32 nType, const OUString & aIdentifier, ::sal_Int32 nStart, ::sal_Int32 nLength,
54 const css::uno::Reference< css::container::XStringKeyMap > & xMarkupInfoContainer) override;
55
56 virtual void SAL_CALL commitTextRangeMarkup(::sal_Int32 nType, const OUString & aIdentifier, const css::uno::Reference< css::text::XTextRange> & xRange,
57 const css::uno::Reference< css::container::XStringKeyMap > & xMarkupInfoContainer) override;
58
59 // css::text::XMultiTextMarkup:
60 virtual void SAL_CALL commitMultiTextMarkup( const css::uno::Sequence< css::text::TextMarkupDescriptor >& aMarkups ) override;
61
62private:
63 SwXTextMarkup( const SwXTextMarkup & ) = delete;
64 SwXTextMarkup & operator =( const SwXTextMarkup & ) = delete;
65
66 struct Impl;
68
69protected:
71 void ClearTextNode();
73};
74
77class SwXStringKeyMap final :
78 public ::cppu::WeakImplHelper<
79 css::container::XStringKeyMap>
80{
81public:
83
84 // css::container::XStringKeyMap:
85 virtual css::uno::Any SAL_CALL getValue(const OUString & aKey) override;
86 virtual sal_Bool SAL_CALL hasValue(const OUString & aKey) override;
87 virtual void SAL_CALL insertValue(const OUString & aKey, const css::uno::Any & aValue) override;
88 virtual ::sal_Int32 SAL_CALL getCount() override;
89 virtual OUString SAL_CALL getKeyByIndex(::sal_Int32 nIndex) override;
90 virtual css::uno::Any SAL_CALL getValueByIndex(::sal_Int32 nIndex) override;
91
92private:
94 void operator =(SwXStringKeyMap const &) = delete;
95
96 virtual ~SwXStringKeyMap() override {}
97
98 std::map< OUString, css::uno::Any > maMap;
99};
100
101#endif
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
Implementation of the css::container::XStringKeyMap interface.
virtual ~SwXStringKeyMap() override
std::map< OUString, css::uno::Any > maMap
virtual sal_Bool SAL_CALL hasValue(const OUString &aKey) override
virtual css::uno::Any SAL_CALL getValue(const OUString &aKey) override
void operator=(SwXStringKeyMap const &)=delete
virtual ::sal_Int32 SAL_CALL getCount() override
virtual css::uno::Any SAL_CALL getValueByIndex(::sal_Int32 nIndex) override
virtual OUString SAL_CALL getKeyByIndex(::sal_Int32 nIndex) override
SwXStringKeyMap(SwXStringKeyMap const &)=delete
virtual void SAL_CALL insertValue(const OUString &aKey, const css::uno::Any &aValue) override
Implementation of the css::text::XTextMarkup interface.
virtual void SAL_CALL commitStringMarkup(::sal_Int32 nType, const OUString &aIdentifier, ::sal_Int32 nStart, ::sal_Int32 nLength, const css::uno::Reference< css::container::XStringKeyMap > &xMarkupInfoContainer) override
SwXTextMarkup(const SwXTextMarkup &)=delete
::sw::UnoImplPtr< Impl > m_pImpl
virtual css::uno::Reference< css::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() override
const ModelToViewHelper & GetConversionMap() const
virtual void SAL_CALL commitMultiTextMarkup(const css::uno::Sequence< css::text::TextMarkupDescriptor > &aMarkups) override
SwXTextMarkup & operator=(const SwXTextMarkup &)=delete
SwXTextMarkup(SwTextNode *const rTextNode, const ModelToViewHelper &rConversionMap)
virtual ~SwXTextMarkup() override
virtual void SAL_CALL commitTextRangeMarkup(::sal_Int32 nType, const OUString &aIdentifier, const css::uno::Reference< css::text::XTextRange > &xRange, const css::uno::Reference< css::container::XStringKeyMap > &xMarkupInfoContainer) override
void ClearTextNode()
SwTextNode * GetTextNode()
sal_Int32 nIndex
std::unique_ptr< T, UnoImplPtrDeleter< T > > UnoImplPtr
Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex.
QPRO_FUNC_TYPE nType
unsigned char sal_Bool
sal_Int32 nLength