merge the formfield patch from ooo-build
[ooovba.git] / sw / inc / txtatr.hxx
blob5a36625d526cccc2dcdb36c31d8723d057c103ee
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: txtatr.hxx,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _TXTATR_HXX
31 #define _TXTATR_HXX
33 #include <txatbase.hxx> // SwTxtAttr/SwTxtAttrEnd
34 #include <calbck.hxx>
37 class SwTxtNode; // fuer SwTxtFld
38 class SwCharFmt;
40 // ATT_CHARFMT *********************************************
42 class SwTxtCharFmt : public SwTxtAttrEnd
44 SwTxtNode * m_pTxtNode;
45 USHORT m_nSortNumber;
47 public:
48 SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
49 virtual ~SwTxtCharFmt( );
51 // werden vom SwFmtCharFmt hierher weitergeleitet
52 virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // SwClient
53 virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
55 // get and set TxtNode pointer
56 void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
58 void SetSortNumber( USHORT nSortNumber ) { m_nSortNumber = nSortNumber; }
59 USHORT GetSortNumber() const { return m_nSortNumber; }
63 // ATT_XMLCONTAINERITEM ******************************
65 class SwTxtXMLAttrContainer : public SwTxtAttrEnd
67 public:
68 SwTxtXMLAttrContainer( SvXMLAttrContainerItem& rAttr,
69 xub_StrLen nStart, xub_StrLen nEnd );
72 // ******************************
74 class SwTxtAttrNesting : public SwTxtAttrEnd
76 public:
77 SwTxtAttrNesting( SfxPoolItem & i_rAttr,
78 const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
79 virtual ~SwTxtAttrNesting();
82 class SwTxtMeta : public SwTxtAttrNesting
84 private:
85 SwTxtNode * m_pTxtNode;
87 public:
88 SwTxtMeta( SwFmtMeta & i_rAttr,
89 const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
90 virtual ~SwTxtMeta();
92 void ChgTxtNode( SwTxtNode * const pNode ) { m_pTxtNode = pNode; }
93 SwTxtNode * GetTxtNode() const { return m_pTxtNode; }
98 // ******************************
100 class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrNesting, public SwClient
102 SwTxtNode* m_pTxtNode;
104 public:
105 SwTxtRuby( SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
106 virtual ~SwTxtRuby();
107 TYPEINFO();
109 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
110 virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
112 /// get and set TxtNode pointer
113 const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
114 inline const SwTxtNode& GetTxtNode() const;
115 void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
117 SwCharFmt* GetCharFmt();
118 const SwCharFmt* GetCharFmt() const
119 { return (const_cast<SwTxtRuby*>(this))->GetCharFmt(); }
122 // --------------- Inline Implementierungen ------------------------
124 inline const SwTxtNode& SwTxtRuby::GetTxtNode() const
126 ASSERT( m_pTxtNode, "SwTxtRuby: where is my TxtNode?" );
127 return *m_pTxtNode;
130 #endif