update dev300-m58
[ooovba.git] / sw / inc / txtatr.hxx
blobc6c8f1da9b1d691c116a7cbe06bda7cce8f7a002
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
32 #include <tools/gen.hxx>
33 #include <tools/color.hxx>
34 #include <txatbase.hxx> // SwTxtAttr/SwTxtAttrEnd
35 #include <calbck.hxx>
37 class SwTxtNode; // fuer SwTxtFld
38 class SwCharFmt;
39 class SvxTwoLinesItem;
41 // ATT_CHARFMT *********************************************
43 class SwTxtCharFmt : public SwTxtAttrEnd
45 SwTxtNode * m_pTxtNode;
46 USHORT m_nSortNumber;
48 public:
49 SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
50 virtual ~SwTxtCharFmt( );
52 // werden vom SwFmtCharFmt hierher weitergeleitet
53 virtual void Modify( SfxPoolItem*, SfxPoolItem* ); // SwClient
54 virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
56 // get and set TxtNode pointer
57 void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
59 void SetSortNumber( USHORT nSortNumber ) { m_nSortNumber = nSortNumber; }
60 USHORT GetSortNumber() const { return m_nSortNumber; }
63 // ATT_HARDBLANK ******************************
65 class SwTxtHardBlank : public SwTxtAttr
67 sal_Unicode m_Char;
69 public:
70 SwTxtHardBlank( const SwFmtHardBlank& rAttr, xub_StrLen nStart );
71 inline sal_Unicode GetChar() const { return m_Char; }
74 // ATT_XNLCONTAINERITEM ******************************
76 class SwTxtXMLAttrContainer : public SwTxtAttrEnd
78 public:
79 SwTxtXMLAttrContainer( const SvXMLAttrContainerItem& rAttr,
80 xub_StrLen nStart, xub_StrLen nEnd );
83 // ******************************
85 class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrEnd, public SwClient
87 SwTxtNode* m_pTxtNode;
89 public:
90 SwTxtRuby( SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
91 virtual ~SwTxtRuby();
92 TYPEINFO();
94 virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew);
95 virtual BOOL GetInfo( SfxPoolItem& rInfo ) const;
97 /// get and set TxtNode pointer
98 const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
99 inline const SwTxtNode& GetTxtNode() const;
100 void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
102 SwCharFmt* GetCharFmt();
103 const SwCharFmt* GetCharFmt() const
104 { return ((SwTxtRuby*)this)->GetCharFmt(); }
107 // ******************************
109 class SwTxt2Lines : public SwTxtAttrEnd
111 public:
112 SwTxt2Lines( const SvxTwoLinesItem& rAttr,
113 xub_StrLen nStart, xub_StrLen nEnd );
116 // --------------- Inline Implementierungen ------------------------
118 inline const SwTxtNode& SwTxtRuby::GetTxtNode() const
120 ASSERT( m_pTxtNode, "SwTxtRuby: where is my TxtNode?" );
121 return *m_pTxtNode;
124 #endif