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 
23 #include <cppuhelper/implbase.hxx>
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 
32 namespace com::sun::star::container { class XStringKeyMap; }
33 namespace com::sun::star::text { class XTextRange; }
34 class SwTextNode;
35 class ModelToViewHelper;
36 
40  : public ::cppu::WeakImplHelper
41  < css::text::XTextMarkup
42  , css::text::XMultiTextMarkup
43  >
44 {
45 public:
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 
62 private:
63  SwXTextMarkup( const SwXTextMarkup & ) = delete;
64  SwXTextMarkup & operator =( const SwXTextMarkup & ) = delete;
65 
66  struct Impl;
68 
69 protected:
71  void ClearTextNode();
72  const ModelToViewHelper& GetConversionMap() const;
73 };
74 
78  public ::cppu::WeakImplHelper<
79  css::container::XStringKeyMap>
80 {
81 public:
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 
92 private:
93  SwXStringKeyMap(SwXStringKeyMap const &) = delete;
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: */
sal_Int32 nIndex
virtual css::uno::Any SAL_CALL getValue(const OUString &aKey) override
virtual sal_Bool SAL_CALL hasValue(const OUString &aKey) override
Implementation of the css::text::XTextMarkup interface.
virtual OUString SAL_CALL getKeyByIndex(::sal_Int32 nIndex) override
SwTextNode * GetTextNode()
virtual css::uno::Reference< css::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() override
void ClearTextNode()
virtual ~SwXTextMarkup() override
void operator=(SwXStringKeyMap const &)=delete
std::unique_ptr< T, UnoImplPtrDeleter< T > > UnoImplPtr
Smart pointer class ensuring that the pointed object is deleted with a locked SolarMutex.
std::map< OUString, css::uno::Any > maMap
virtual void SAL_CALL commitMultiTextMarkup(const css::uno::Sequence< css::text::TextMarkupDescriptor > &aMarkups) override
virtual css::uno::Any SAL_CALL getValueByIndex(::sal_Int32 nIndex) override
virtual void SAL_CALL insertValue(const OUString &aKey, const css::uno::Any &aValue) override
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(SwTextNode *const rTextNode, const ModelToViewHelper &rConversionMap)
Implementation of the css::container::XStringKeyMap interface.
unsigned char sal_Bool
::sw::UnoImplPtr< Impl > m_pImpl
SwXTextMarkup & operator=(const SwXTextMarkup &)=delete
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:80
virtual ~SwXStringKeyMap() 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
QPRO_FUNC_TYPE nType
sal_Int32 nLength
virtual ::sal_Int32 SAL_CALL getCount() override
const ModelToViewHelper & GetConversionMap() const