nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / core / inc / unotextmarkup.hxx
blobbfbded136a66ed331b37ab762bf60f6db948d605
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 INCLUDED_SW_SOURCE_CORE_INC_UNOTEXTMARKUP_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_UNOTEXTMARKUP_HXX
23 #include <cppuhelper/implbase.hxx>
25 #include <com/sun/star/text/XTextMarkup.hpp>
26 #include <com/sun/star/text/XMultiTextMarkup.hpp>
28 #include <unobaseclass.hxx>
30 #include <map>
32 namespace com::sun::star::container { class XStringKeyMap; }
33 namespace com::sun::star::text { class XTextRange; }
34 class SwTextNode;
35 class ModelToViewHelper;
37 /** Implementation of the css::text::XTextMarkup interface
39 class SwXTextMarkup
40 : public ::cppu::WeakImplHelper
41 < css::text::XTextMarkup
42 , css::text::XMultiTextMarkup
45 public:
46 SwXTextMarkup(SwTextNode *const rTextNode,
47 const ModelToViewHelper& rConversionMap);
48 virtual ~SwXTextMarkup() override;
50 // css::text::XTextMarkup:
51 virtual css::uno::Reference< css::container::XStringKeyMap > SAL_CALL getMarkupInfoContainer() override;
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;
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;
59 // css::text::XMultiTextMarkup:
60 virtual void SAL_CALL commitMultiTextMarkup( const css::uno::Sequence< css::text::TextMarkupDescriptor >& aMarkups ) override;
62 private:
63 SwXTextMarkup( const SwXTextMarkup & ) = delete;
64 SwXTextMarkup & operator =( const SwXTextMarkup & ) = delete;
66 struct Impl;
67 ::sw::UnoImplPtr<Impl> m_pImpl;
69 protected:
70 SwTextNode* GetTextNode();
71 void ClearTextNode();
72 const ModelToViewHelper& GetConversionMap() const;
75 /** Implementation of the css::container::XStringKeyMap interface
77 class SwXStringKeyMap:
78 public ::cppu::WeakImplHelper<
79 css::container::XStringKeyMap>
81 public:
82 SwXStringKeyMap();
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;
92 private:
93 SwXStringKeyMap(SwXStringKeyMap const &) = delete;
94 void operator =(SwXStringKeyMap const &) = delete;
96 virtual ~SwXStringKeyMap() override {}
98 std::map< OUString, css::uno::Any > maMap;
101 #endif
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */