update dev300-m57
[ooovba.git] / sw / inc / tgrditem.hxx
blobe18dc78d3a71e429ab33dd2f2fc20676525f6f53
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: tgrditem.hxx,v $
10 * $Revision: 1.9 $
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 SW_TGRDITEM_HXX
31 #define SW_TGRDITEM_HXX
33 #include <tools/color.hxx>
34 #include <svtools/poolitem.hxx>
35 #include "swdllapi.h"
36 #include <hintids.hxx>
37 #include <format.hxx>
39 class IntlWrapper;
41 enum SwTextGrid { GRID_NONE, GRID_LINES_ONLY, GRID_LINES_CHARS };
43 class SW_DLLPUBLIC SwTextGridItem : public SfxPoolItem
45 Color aColor;
46 sal_uInt16 nLines;
47 sal_uInt16 nBaseHeight, nRubyHeight;
48 SwTextGrid eGridType;
49 BOOL bRubyTextBelow;
50 BOOL bPrintGrid;
51 BOOL bDisplayGrid;
53 //for textgrid enhancement
54 sal_uInt16 nBaseWidth;
55 BOOL bSnapToChars;
56 BOOL bSquaredMode;
57 public:
58 SwTextGridItem();
59 virtual ~SwTextGridItem();
61 // "pure virtual Methoden" vom SfxPoolItem
62 virtual int operator==( const SfxPoolItem& ) const;
63 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
64 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
65 SfxMapUnit eCoreMetric,
66 SfxMapUnit ePresMetric,
67 String &rText,
68 const IntlWrapper* pIntl = 0 ) const;
69 virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const;
70 virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 );
72 SwTextGridItem& operator=( const SwTextGridItem& );
74 const Color& GetColor() const { return aColor; }
75 void SetColor( const Color& rCol ) { aColor = rCol; }
77 sal_uInt16 GetLines() const { return nLines; }
78 void SetLines( sal_uInt16 nNew ) { nLines = nNew; }
80 sal_uInt16 GetBaseHeight() const { return nBaseHeight; }
81 void SetBaseHeight( sal_uInt16 nNew ) { nBaseHeight = nNew; }
83 sal_uInt16 GetRubyHeight() const { return nRubyHeight; }
84 void SetRubyHeight( sal_uInt16 nNew ) { nRubyHeight = nNew; }
86 SwTextGrid GetGridType() const { return eGridType; }
87 void SetGridType( SwTextGrid eNew ) { eGridType = eNew; }
89 BOOL IsRubyTextBelow() const { return bRubyTextBelow; }
90 BOOL GetRubyTextBelow() const { return bRubyTextBelow; }
91 void SetRubyTextBelow( BOOL bNew ) { bRubyTextBelow = bNew; }
93 BOOL IsPrintGrid() const { return bPrintGrid; }
94 BOOL GetPrintGrid() const { return bPrintGrid; }
95 void SetPrintGrid( BOOL bNew ) { bPrintGrid = bNew; }
97 BOOL IsDisplayGrid() const { return bDisplayGrid; }
98 BOOL GetDisplayGrid() const { return bDisplayGrid; }
99 void SetDisplayGrid( BOOL bNew ) { bDisplayGrid = bNew; }
101 //for textgrid enhancement
102 sal_uInt16 GetBaseWidth() const { return nBaseWidth;}
103 void SetBaseWidth( sal_uInt16 nNew ) { nBaseWidth = nNew; }
105 BOOL IsSnapToChars() const { return bSnapToChars; }
106 BOOL GetSnapToChars() const { return bSnapToChars; }
107 void SetSnapToChars( BOOL bNew ) { bSnapToChars = bNew; }
109 BOOL IsSquaredMode() const { return bSquaredMode; }
110 BOOL GetSquaredMode() const { return bSquaredMode; }
111 void SetSquaredMode( BOOL bNew ) { bSquaredMode = bNew; }
112 void SwitchPaperMode(BOOL bNew );
114 void Init();
117 inline const SwTextGridItem &SwAttrSet::GetTextGrid(BOOL bInP) const
118 { return (const SwTextGridItem&)Get( RES_TEXTGRID, bInP ); }
119 inline const SwTextGridItem &SwFmt::GetTextGrid(BOOL bInP) const
120 { return (const SwTextGridItem&)aSet.Get( RES_TEXTGRID, bInP ); }
122 #endif