bump product version to 4.1.6.2
[LibreOffice.git] / sw / inc / txtatr.hxx
blob08363b791610b43e8af3c9f77d67a3db6b4fbd82
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 _TXTATR_HXX
20 #define _TXTATR_HXX
22 #include <txatbase.hxx> // SwTxtAttr/SwTxtAttrEnd
23 #include <calbck.hxx>
26 class SwTxtNode; // For SwTxtFld.
27 class SwCharFmt;
29 namespace sw {
30 class MetaFieldManager;
34 // ATT_CHARFMT *********************************************
36 class SwTxtCharFmt : public SwTxtAttrEnd
38 SwTxtNode * m_pTxtNode;
39 sal_uInt16 m_nSortNumber;
41 public:
42 SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
43 virtual ~SwTxtCharFmt( );
45 // Passed from SwFmtCharFmt (no derivation from SwClient!).
46 void ModifyNotification( const SfxPoolItem*, const SfxPoolItem* );
47 bool GetInfo( SfxPoolItem& rInfo ) const;
49 // get and set TxtNode pointer
50 void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
52 void SetSortNumber( sal_uInt16 nSortNumber ) { m_nSortNumber = nSortNumber; }
53 sal_uInt16 GetSortNumber() const { return m_nSortNumber; }
57 // ******************************
59 class SwTxtAttrNesting : public SwTxtAttrEnd
61 protected:
62 SwTxtAttrNesting( SfxPoolItem & i_rAttr,
63 const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
64 virtual ~SwTxtAttrNesting();
67 class SwTxtMeta : public SwTxtAttrNesting
69 private:
70 SwTxtMeta( SwFmtMeta & i_rAttr,
71 const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
73 public:
74 static SwTxtMeta * CreateTxtMeta(
75 ::sw::MetaFieldManager & i_rTargetDocManager,
76 SwTxtNode *const i_pTargetTxtNode,
77 SwFmtMeta & i_rAttr,
78 xub_StrLen const i_nStart, xub_StrLen const i_nEnd,
79 bool const i_bIsCopy);
81 virtual ~SwTxtMeta();
83 void ChgTxtNode(SwTxtNode * const pNode);
87 // ******************************
89 class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrNesting, public SwClient
91 SwTxtNode* m_pTxtNode;
92 protected:
93 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
94 public:
95 SwTxtRuby( SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
96 virtual ~SwTxtRuby();
97 TYPEINFO();
99 virtual bool GetInfo( SfxPoolItem& rInfo ) const;
101 SW_DLLPRIVATE void InitRuby(SwTxtNode & rNode);
103 /// Get and set TxtNode pointer.
104 const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
105 inline const SwTxtNode& GetTxtNode() const;
106 void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
108 SwCharFmt* GetCharFmt();
109 const SwCharFmt* GetCharFmt() const
110 { return (const_cast<SwTxtRuby*>(this))->GetCharFmt(); }
114 inline const SwTxtNode& SwTxtRuby::GetTxtNode() const
116 OSL_ENSURE( m_pTxtNode, "SwTxtRuby: where is my TxtNode?" );
117 return *m_pTxtNode;
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */