Replace workaround of resize to invalidate with an explicit SfxHint
[LibreOffice.git] / sw / inc / txtatr.hxx
blobcf1b77073676895107ac0af5315e4d4ce7deb48b
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 .
19 #ifndef INCLUDED_SW_INC_TXTATR_HXX
20 #define INCLUDED_SW_INC_TXTATR_HXX
22 #include "txatbase.hxx"
23 #include "calbck.hxx"
25 class SwTextNode;
26 class SwCharFormat;
27 class SwFormatMeta;
29 namespace sw {
30 class MetaFieldManager;
31 class AutoFormatUsedHint;
34 class SwTextCharFormat final : public SwTextAttrEnd
36 SwTextNode * m_pTextNode;
37 sal_uInt16 m_nSortNumber;
39 public:
40 SwTextCharFormat(
41 const SfxPoolItemHolder& rAttr,
42 sal_Int32 nStart,
43 sal_Int32 nEnd );
44 virtual ~SwTextCharFormat( ) override;
46 void TriggerNodeUpdate(const sw::LegacyModifyHint&);
48 // get and set TextNode pointer
49 void ChgTextNode( SwTextNode* pNew ) { m_pTextNode = pNew; }
51 void SetSortNumber( sal_uInt16 nSortNumber ) { m_nSortNumber = nSortNumber; }
52 sal_uInt16 GetSortNumber() const { return m_nSortNumber; }
53 void HandleAutoFormatUsedHint(const sw::AutoFormatUsedHint&);
57 class SwTextMeta final : public SwTextAttrNesting
59 private:
60 SwTextMeta(
61 const SfxPoolItemHolder& rAttr,
62 const sal_Int32 i_nStart,
63 const sal_Int32 i_nEnd );
65 public:
66 static SwTextMeta * CreateTextMeta(
67 ::sw::MetaFieldManager & i_rTargetDocManager,
68 SwTextNode *const i_pTargetTextNode,
69 const SfxPoolItemHolder& rAttr,
70 // SwFormatMeta & i_rAttr,
71 sal_Int32 const i_nStart, sal_Int32 const i_nEnd,
72 bool const i_bIsCopy);
74 virtual ~SwTextMeta() override;
76 void ChgTextNode(SwTextNode * const pNode);
80 class SW_DLLPUBLIC SwTextRuby final: public SwTextAttrNesting, public SwClient
82 SwTextNode* m_pTextNode;
83 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
84 public:
85 SwTextRuby(
86 const SfxPoolItemHolder& rAttr,
87 sal_Int32 nStart,
88 sal_Int32 nEnd );
89 virtual ~SwTextRuby() override;
91 SAL_DLLPRIVATE void InitRuby(SwTextNode & rNode);
93 /// Get and set TextNode pointer.
94 inline const SwTextNode& GetTextNode() const;
95 void ChgTextNode( SwTextNode* pNew ) { m_pTextNode = pNew; }
97 SwCharFormat* GetCharFormat();
98 const SwCharFormat* GetCharFormat() const
99 { return const_cast<SwTextRuby*>(this)->GetCharFormat(); }
102 inline const SwTextNode& SwTextRuby::GetTextNode() const
104 assert( m_pTextNode );
105 return *m_pTextNode;
108 #endif
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */