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 $
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 ************************************************************************/
32 #include <tools/gen.hxx>
33 #include <tools/color.hxx>
34 #include <txatbase.hxx> // SwTxtAttr/SwTxtAttrEnd
37 class SwTxtNode
; // fuer SwTxtFld
39 class SvxTwoLinesItem
;
41 // ATT_CHARFMT *********************************************
43 class SwTxtCharFmt
: public SwTxtAttrEnd
45 SwTxtNode
* m_pTxtNode
;
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
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
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
;
90 SwTxtRuby( SwFmtRuby
& rAttr
, xub_StrLen nStart
, xub_StrLen nEnd
);
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
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?" );