LibreOffice Module sw (master) 1
tgrditem.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SW_INC_TGRDITEM_HXX
20#define INCLUDED_SW_INC_TGRDITEM_HXX
21
22#include <tools/color.hxx>
23#include <svl/poolitem.hxx>
24#include "swdllapi.h"
25#include "hintids.hxx"
26#include "format.hxx"
27
28class IntlWrapper;
29
31
33{
34private:
36 sal_Int32 m_nLines;
37 sal_uInt16 m_nBaseHeight;
38 sal_uInt16 m_nRubyHeight;
43
44 //for textgrid enhancement
45 sal_uInt16 m_nBaseWidth;
48
49public:
51 virtual ~SwTextGridItem() override;
52
53 SwTextGridItem(SwTextGridItem const &) = default;
55 SwTextGridItem & operator =(SwTextGridItem const &) = delete; // due to SfxPoolItem
56 SwTextGridItem & operator =(SwTextGridItem &&) = delete; // due to SfxPoolItem
57
58 // "pure virtual methods" of SfxPoolItem
59 virtual bool operator==( const SfxPoolItem& ) const override;
60 virtual SwTextGridItem* Clone( SfxItemPool* pPool = nullptr ) const override;
61 virtual bool GetPresentation( SfxItemPresentation ePres,
62 MapUnit eCoreMetric,
63 MapUnit ePresMetric,
64 OUString &rText,
65 const IntlWrapper& rIntl ) const override;
66 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
67 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
68
69 const Color& GetColor() const { return m_aColor; }
70 void SetColor( const Color& rCol ) { m_aColor = rCol; }
71
72 sal_Int32 GetLines() const { return m_nLines; }
73 void SetLines( sal_Int32 nNew ) { m_nLines = nNew; }
74
75 sal_uInt16 GetBaseHeight() const { return m_nBaseHeight; }
76 void SetBaseHeight( sal_uInt16 nNew ) { m_nBaseHeight = nNew; }
77
78 sal_uInt16 GetRubyHeight() const { return m_nRubyHeight; }
79 void SetRubyHeight( sal_uInt16 nNew ) { m_nRubyHeight = nNew; }
80
81 SwTextGrid GetGridType() const { return m_eGridType; }
82 void SetGridType( SwTextGrid eNew ) { m_eGridType = eNew; }
83
84 bool IsRubyTextBelow() const { return m_bRubyTextBelow; }
85 bool GetRubyTextBelow() const { return m_bRubyTextBelow; }
86 void SetRubyTextBelow( bool bNew ) { m_bRubyTextBelow = bNew; }
87
88 bool IsPrintGrid() const { return m_bPrintGrid; }
89 bool GetPrintGrid() const { return m_bPrintGrid; }
90 void SetPrintGrid( bool bNew ) { m_bPrintGrid = bNew; }
91
92 bool IsDisplayGrid() const { return m_bDisplayGrid; }
93 bool GetDisplayGrid() const { return m_bDisplayGrid; }
94 void SetDisplayGrid( bool bNew ) { m_bDisplayGrid = bNew; }
95
96 //for textgrid enhancement
97 sal_uInt16 GetBaseWidth() const { return m_nBaseWidth;}
98 void SetBaseWidth( sal_uInt16 nNew ) { m_nBaseWidth = nNew; }
99
100 bool IsSnapToChars() const { return m_bSnapToChars; }
101 bool GetSnapToChars() const { return m_bSnapToChars; }
102 void SetSnapToChars( bool bNew ) { m_bSnapToChars = bNew; }
103
104 bool IsSquaredMode() const { return m_bSquaredMode; }
105 bool GetSquaredMode() const { return m_bSquaredMode; }
106 void SetSquaredMode( bool bNew ) { m_bSquaredMode = bNew; }
107 void SwitchPaperMode(bool bNew );
108
109 void Init();
110};
111
112inline const SwTextGridItem &SwFormat::GetTextGrid(bool bInP) const
113 { return m_aSet.Get( RES_TEXTGRID, bInP ); }
114
115#endif
116
117/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
SfxPoolItem & operator=(const SfxPoolItem &)=delete
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
const SwTextGridItem & GetTextGrid(bool=true) const
Definition: tgrditem.hxx:112
SwAttrSet m_aSet
Definition: format.hxx:51
bool m_bSnapToChars
Definition: tgrditem.hxx:46
bool GetSnapToChars() const
Definition: tgrditem.hxx:101
SwTextGridItem(SwTextGridItem &&)=default
sal_uInt16 GetBaseHeight() const
Definition: tgrditem.hxx:75
SwTextGridItem(SwTextGridItem const &)=default
void SetSnapToChars(bool bNew)
Definition: tgrditem.hxx:102
bool m_bDisplayGrid
Definition: tgrditem.hxx:42
void SetRubyHeight(sal_uInt16 nNew)
Definition: tgrditem.hxx:79
Color m_aColor
Definition: tgrditem.hxx:35
sal_uInt16 GetBaseWidth() const
Definition: tgrditem.hxx:97
sal_uInt16 m_nBaseWidth
Definition: tgrditem.hxx:45
bool m_bPrintGrid
Definition: tgrditem.hxx:41
bool m_bSquaredMode
Definition: tgrditem.hxx:47
void SetBaseHeight(sal_uInt16 nNew)
Definition: tgrditem.hxx:76
bool m_bRubyTextBelow
Definition: tgrditem.hxx:40
void SetSquaredMode(bool bNew)
Definition: tgrditem.hxx:106
void SetPrintGrid(bool bNew)
Definition: tgrditem.hxx:90
bool GetRubyTextBelow() const
Definition: tgrditem.hxx:85
bool GetSquaredMode() const
Definition: tgrditem.hxx:105
bool IsSquaredMode() const
Definition: tgrditem.hxx:104
sal_uInt16 GetRubyHeight() const
Definition: tgrditem.hxx:78
void SetColor(const Color &rCol)
Definition: tgrditem.hxx:70
bool GetPrintGrid() const
Definition: tgrditem.hxx:89
void SetBaseWidth(sal_uInt16 nNew)
Definition: tgrditem.hxx:98
sal_Int32 m_nLines
Definition: tgrditem.hxx:36
void SetGridType(SwTextGrid eNew)
Definition: tgrditem.hxx:82
SwTextGrid GetGridType() const
Definition: tgrditem.hxx:81
bool GetDisplayGrid() const
Definition: tgrditem.hxx:93
bool IsRubyTextBelow() const
Definition: tgrditem.hxx:84
sal_uInt16 m_nRubyHeight
Definition: tgrditem.hxx:38
const Color & GetColor() const
Definition: tgrditem.hxx:69
bool IsDisplayGrid() const
Definition: tgrditem.hxx:92
void SetRubyTextBelow(bool bNew)
Definition: tgrditem.hxx:86
void SetDisplayGrid(bool bNew)
Definition: tgrditem.hxx:94
void SetLines(sal_Int32 nNew)
Definition: tgrditem.hxx:73
SwTextGrid m_eGridType
Definition: tgrditem.hxx:39
sal_uInt16 m_nBaseHeight
Definition: tgrditem.hxx:37
sal_Int32 GetLines() const
Definition: tgrditem.hxx:72
bool IsPrintGrid() const
Definition: tgrditem.hxx:88
bool IsSnapToChars() const
Definition: tgrditem.hxx:100
Color m_aColor
void Init()
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(121)
MapUnit
SfxItemPresentation
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
SwTextGrid
Definition: tgrditem.hxx:30
@ GRID_LINES_ONLY
Definition: tgrditem.hxx:30
@ GRID_LINES_CHARS
Definition: tgrditem.hxx:30
@ GRID_NONE
Definition: tgrditem.hxx:30
unsigned char sal_uInt8