1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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"
30 class MetaFieldManager
;
33 class SwTextCharFormat final
: public SwTextAttrEnd
35 SwTextNode
* m_pTextNode
;
36 sal_uInt16 m_nSortNumber
;
39 SwTextCharFormat( SwFormatCharFormat
& rAttr
, sal_Int32 nStart
, sal_Int32 nEnd
);
40 virtual ~SwTextCharFormat( ) override
;
42 void TriggerNodeUpdate(const sw::LegacyModifyHint
&);
43 bool GetInfo( SfxPoolItem
const & rInfo
) const;
45 // get and set TextNode pointer
46 void ChgTextNode( SwTextNode
* pNew
) { m_pTextNode
= pNew
; }
48 void SetSortNumber( sal_uInt16 nSortNumber
) { m_nSortNumber
= nSortNumber
; }
49 sal_uInt16
GetSortNumber() const { return m_nSortNumber
; }
53 class SwTextMeta final
: public SwTextAttrNesting
56 SwTextMeta( SwFormatMeta
& i_rAttr
,
57 const sal_Int32 i_nStart
, const sal_Int32 i_nEnd
);
60 static SwTextMeta
* CreateTextMeta(
61 ::sw::MetaFieldManager
& i_rTargetDocManager
,
62 SwTextNode
*const i_pTargetTextNode
,
63 SwFormatMeta
& i_rAttr
,
64 sal_Int32
const i_nStart
, sal_Int32
const i_nEnd
,
65 bool const i_bIsCopy
);
67 virtual ~SwTextMeta() override
;
69 void ChgTextNode(SwTextNode
* const pNode
);
73 class SW_DLLPUBLIC SwTextRuby final
: public SwTextAttrNesting
, public SwClient
75 SwTextNode
* m_pTextNode
;
76 virtual void SwClientNotify(const SwModify
&, const SfxHint
&) override
;
78 SwTextRuby( SwFormatRuby
& rAttr
, sal_Int32 nStart
, sal_Int32 nEnd
);
79 virtual ~SwTextRuby() override
;
81 virtual bool GetInfo( SfxPoolItem
& rInfo
) const override
;
83 SAL_DLLPRIVATE
void InitRuby(SwTextNode
& rNode
);
85 /// Get and set TextNode pointer.
86 inline const SwTextNode
& GetTextNode() const;
87 void ChgTextNode( SwTextNode
* pNew
) { m_pTextNode
= pNew
; }
89 SwCharFormat
* GetCharFormat();
90 const SwCharFormat
* GetCharFormat() const
91 { return const_cast<SwTextRuby
*>(this)->GetCharFormat(); }
94 inline const SwTextNode
& SwTextRuby::GetTextNode() const
96 assert( m_pTextNode
);
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */