bump product version to 4.1.6.2
[LibreOffice.git] / sw / inc / tgrditem.hxx
blob24b3a5f3ffae9134460202fc9923c10bdd4b62ec
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef SW_TGRDITEM_HXX
20 #define SW_TGRDITEM_HXX
22 #include <tools/color.hxx>
23 #include <svl/poolitem.hxx>
24 #include "swdllapi.h"
25 #include <hintids.hxx>
26 #include <format.hxx>
28 class IntlWrapper;
30 enum SwTextGrid { GRID_NONE, GRID_LINES_ONLY, GRID_LINES_CHARS };
32 class SW_DLLPUBLIC SwTextGridItem : public SfxPoolItem
34 Color aColor;
35 sal_uInt16 nLines;
36 sal_uInt16 nBaseHeight, nRubyHeight;
37 SwTextGrid eGridType;
38 sal_Bool bRubyTextBelow;
39 sal_Bool bPrintGrid;
40 sal_Bool bDisplayGrid;
42 //for textgrid enhancement
43 sal_uInt16 nBaseWidth;
44 sal_Bool bSnapToChars;
45 sal_Bool bSquaredMode;
46 public:
47 SwTextGridItem();
48 virtual ~SwTextGridItem();
50 // "pure virtual methods" of SfxPoolItem
51 virtual int operator==( const SfxPoolItem& ) const;
52 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
53 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
54 SfxMapUnit eCoreMetric,
55 SfxMapUnit ePresMetric,
56 OUString &rText,
57 const IntlWrapper* pIntl = 0 ) const;
58 virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
59 virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
61 SwTextGridItem& operator=( const SwTextGridItem& );
63 const Color& GetColor() const { return aColor; }
64 void SetColor( const Color& rCol ) { aColor = rCol; }
66 sal_uInt16 GetLines() const { return nLines; }
67 void SetLines( sal_uInt16 nNew ) { nLines = nNew; }
69 sal_uInt16 GetBaseHeight() const { return nBaseHeight; }
70 void SetBaseHeight( sal_uInt16 nNew ) { nBaseHeight = nNew; }
72 sal_uInt16 GetRubyHeight() const { return nRubyHeight; }
73 void SetRubyHeight( sal_uInt16 nNew ) { nRubyHeight = nNew; }
75 SwTextGrid GetGridType() const { return eGridType; }
76 void SetGridType( SwTextGrid eNew ) { eGridType = eNew; }
78 sal_Bool IsRubyTextBelow() const { return bRubyTextBelow; }
79 sal_Bool GetRubyTextBelow() const { return bRubyTextBelow; }
80 void SetRubyTextBelow( sal_Bool bNew ) { bRubyTextBelow = bNew; }
82 sal_Bool IsPrintGrid() const { return bPrintGrid; }
83 sal_Bool GetPrintGrid() const { return bPrintGrid; }
84 void SetPrintGrid( sal_Bool bNew ) { bPrintGrid = bNew; }
86 sal_Bool IsDisplayGrid() const { return bDisplayGrid; }
87 sal_Bool GetDisplayGrid() const { return bDisplayGrid; }
88 void SetDisplayGrid( sal_Bool bNew ) { bDisplayGrid = bNew; }
90 //for textgrid enhancement
91 sal_uInt16 GetBaseWidth() const { return nBaseWidth;}
92 void SetBaseWidth( sal_uInt16 nNew ) { nBaseWidth = nNew; }
94 sal_Bool IsSnapToChars() const { return bSnapToChars; }
95 sal_Bool GetSnapToChars() const { return bSnapToChars; }
96 void SetSnapToChars( sal_Bool bNew ) { bSnapToChars = bNew; }
98 sal_Bool IsSquaredMode() const { return bSquaredMode; }
99 sal_Bool GetSquaredMode() const { return bSquaredMode; }
100 void SetSquaredMode( sal_Bool bNew ) { bSquaredMode = bNew; }
101 void SwitchPaperMode(sal_Bool bNew );
103 void Init();
106 inline const SwTextGridItem &SwAttrSet::GetTextGrid(sal_Bool bInP) const
107 { return (const SwTextGridItem&)Get( RES_TEXTGRID, bInP ); }
108 inline const SwTextGridItem &SwFmt::GetTextGrid(sal_Bool bInP) const
109 { return (const SwTextGridItem&)aSet.Get( RES_TEXTGRID, bInP ); }
111 #endif
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */