Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef SW_TGRDITEM_HXX
29 : : #define SW_TGRDITEM_HXX
30 : :
31 : : #include <tools/color.hxx>
32 : : #include <svl/poolitem.hxx>
33 : : #include "swdllapi.h"
34 : : #include <hintids.hxx>
35 : : #include <format.hxx>
36 : :
37 : : class IntlWrapper;
38 : :
39 : : enum SwTextGrid { GRID_NONE, GRID_LINES_ONLY, GRID_LINES_CHARS };
40 : :
41 : 7011 : class SW_DLLPUBLIC SwTextGridItem : public SfxPoolItem
42 : : {
43 : : Color aColor;
44 : : sal_uInt16 nLines;
45 : : sal_uInt16 nBaseHeight, nRubyHeight;
46 : : SwTextGrid eGridType;
47 : : sal_Bool bRubyTextBelow;
48 : : sal_Bool bPrintGrid;
49 : : sal_Bool bDisplayGrid;
50 : :
51 : : //for textgrid enhancement
52 : : sal_uInt16 nBaseWidth;
53 : : sal_Bool bSnapToChars;
54 : : sal_Bool bSquaredMode;
55 : : public:
56 : : SwTextGridItem();
57 : : virtual ~SwTextGridItem();
58 : :
59 : : // "pure virtual methods" of SfxPoolItem
60 : : virtual int operator==( const SfxPoolItem& ) const;
61 : : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
62 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
63 : : SfxMapUnit eCoreMetric,
64 : : SfxMapUnit ePresMetric,
65 : : String &rText,
66 : : const IntlWrapper* pIntl = 0 ) const;
67 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
68 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
69 : :
70 : : SwTextGridItem& operator=( const SwTextGridItem& );
71 : :
72 : 1815 : const Color& GetColor() const { return aColor; }
73 : 24 : void SetColor( const Color& rCol ) { aColor = rCol; }
74 : :
75 : 7342 : sal_uInt16 GetLines() const { return nLines; }
76 : 854 : void SetLines( sal_uInt16 nNew ) { nLines = nNew; }
77 : :
78 : 5207 : sal_uInt16 GetBaseHeight() const { return nBaseHeight; }
79 : 854 : void SetBaseHeight( sal_uInt16 nNew ) { nBaseHeight = nNew; }
80 : :
81 : 5159 : sal_uInt16 GetRubyHeight() const { return nRubyHeight; }
82 : 863 : void SetRubyHeight( sal_uInt16 nNew ) { nRubyHeight = nNew; }
83 : :
84 : 8818 : SwTextGrid GetGridType() const { return eGridType; }
85 : 863 : void SetGridType( SwTextGrid eNew ) { eGridType = eNew; }
86 : :
87 : 0 : sal_Bool IsRubyTextBelow() const { return bRubyTextBelow; }
88 : 3949 : sal_Bool GetRubyTextBelow() const { return bRubyTextBelow; }
89 : 24 : void SetRubyTextBelow( sal_Bool bNew ) { bRubyTextBelow = bNew; }
90 : :
91 : 0 : sal_Bool IsPrintGrid() const { return bPrintGrid; }
92 : 2877 : sal_Bool GetPrintGrid() const { return bPrintGrid; }
93 : 863 : void SetPrintGrid( sal_Bool bNew ) { bPrintGrid = bNew; }
94 : :
95 : 0 : sal_Bool IsDisplayGrid() const { return bDisplayGrid; }
96 : 3949 : sal_Bool GetDisplayGrid() const { return bDisplayGrid; }
97 : 863 : void SetDisplayGrid( sal_Bool bNew ) { bDisplayGrid = bNew; }
98 : :
99 : : //for textgrid enhancement
100 : 1814 : sal_uInt16 GetBaseWidth() const { return nBaseWidth;}
101 : 333 : void SetBaseWidth( sal_uInt16 nNew ) { nBaseWidth = nNew; }
102 : :
103 : 0 : sal_Bool IsSnapToChars() const { return bSnapToChars; }
104 : 1787 : sal_Bool GetSnapToChars() const { return bSnapToChars; }
105 : 18 : void SetSnapToChars( sal_Bool bNew ) { bSnapToChars = bNew; }
106 : :
107 : 18283 : sal_Bool IsSquaredMode() const { return bSquaredMode; }
108 : 1787 : sal_Bool GetSquaredMode() const { return bSquaredMode; }
109 : 432 : void SetSquaredMode( sal_Bool bNew ) { bSquaredMode = bNew; }
110 : : void SwitchPaperMode(sal_Bool bNew );
111 : :
112 : : void Init();
113 : : };
114 : :
115 : : inline const SwTextGridItem &SwAttrSet::GetTextGrid(sal_Bool bInP) const
116 : : { return (const SwTextGridItem&)Get( RES_TEXTGRID, bInP ); }
117 : : inline const SwTextGridItem &SwFmt::GetTextGrid(sal_Bool bInP) const
118 : : { return (const SwTextGridItem&)aSet.Get( RES_TEXTGRID, bInP ); }
119 : :
120 : : #endif
121 : :
122 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|