LibreOffice Module sw (master)  1
tablepg.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_SOURCE_UIBASE_TABLE_TABLEPG_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_TABLE_TABLEPG_HXX
21 #include <sfx2/tabdlg.hxx>
22 #include <actctrl.hxx>
23 #include <prcntfld.hxx>
24 #include <swtypes.hxx>
25 #include <svx/frmdirlbox.hxx>
26 
27 class SwWrtShell;
28 class SwTableRep;
29 
30 struct TColumn
31 {
33  bool bVisible;
34 };
35 
37 {
41  bool bModified;
42  bool bFull:1;
43  bool bHtmlMode : 1;
44 
45  std::unique_ptr<weld::Entry> m_xNameED;
46  std::unique_ptr<weld::Label> m_xWidthFT;
47  std::unique_ptr<SwPercentField> m_xWidthMF;
48  std::unique_ptr<weld::CheckButton> m_xRelWidthCB;
49 
50  std::unique_ptr<weld::RadioButton> m_xFullBtn;
51  std::unique_ptr<weld::RadioButton> m_xLeftBtn;
52  std::unique_ptr<weld::RadioButton> m_xFromLeftBtn;
53  std::unique_ptr<weld::RadioButton> m_xRightBtn;
54  std::unique_ptr<weld::RadioButton> m_xCenterBtn;
55  std::unique_ptr<weld::RadioButton> m_xFreeBtn;
56 
57  std::unique_ptr<weld::Label> m_xLeftFT;
58  std::unique_ptr<SwPercentField> m_xLeftMF;
59  std::unique_ptr<weld::Label> m_xRightFT;
60  std::unique_ptr<SwPercentField> m_xRightMF;
61  std::unique_ptr<weld::Label> m_xTopFT;
62  std::unique_ptr<weld::MetricSpinButton> m_xTopMF;
63  std::unique_ptr<weld::Label> m_xBottomFT;
64  std::unique_ptr<weld::MetricSpinButton> m_xBottomMF;
65 
66  std::unique_ptr<svx::FrameDirectionListBox> m_xTextDirectionLB;
67  std::unique_ptr<weld::Widget> m_xProperties;
68 
69  void Init();
70  void ModifyHdl(const weld::MetricSpinButton& rEdit);
71 
72  DECL_LINK(AutoClickHdl, weld::ToggleButton&, void);
73  DECL_LINK(RelWidthClickHdl, weld::ToggleButton&, void);
74  void RightModify();
75  DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
76 
79 
80 public:
81  SwFormatTablePage(TabPageParent pParent, const SfxItemSet& rSet );
82  virtual ~SwFormatTablePage() override;
83 
84  static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet);
85  virtual bool FillItemSet( SfxItemSet* rSet ) override;
86  virtual void Reset( const SfxItemSet* rSet ) override;
87  virtual void ActivatePage( const SfxItemSet& rSet ) override;
88  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
89 };
90 
91 // TabPage Format/Table/Columns
92 #define MET_FIELDS 6 //Number of the used MetricFields
93 
95 {
99  sal_uInt16 nMetFields;
100  sal_uInt16 nNoOfCols;
101  sal_uInt16 nNoOfVisibleCols;
102  // Remember the width, when switching to autoalign
103  sal_uInt16 aValueTable[MET_FIELDS];// primary assignment of the MetricFields
104  bool bModified:1;
105  bool bModifyTable:1;
106  bool bPercentMode:1;
107 
109  std::unique_ptr<weld::Label> m_aTextArr[MET_FIELDS];
110  std::unique_ptr<weld::CheckButton> m_xModifyTableCB;
111  std::unique_ptr<weld::CheckButton> m_xProportionalCB;
112  std::unique_ptr<weld::Label> m_xSpaceFT;
113  std::unique_ptr<weld::MetricSpinButton> m_xSpaceED;
114  std::unique_ptr<weld::Button> m_xUpBtn;
115  std::unique_ptr<weld::Button> m_xDownBtn;
116 
117  void Init(bool bWeb);
118  DECL_LINK(AutoClickHdl, weld::Button&, void);
119  void ModifyHdl(const weld::MetricSpinButton* pEdit);
120  DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
121  DECL_LINK(ModeHdl, weld::ToggleButton&, void);
122  void UpdateCols( sal_uInt16 nCurrentPos );
123  SwTwips GetVisibleWidth(sal_uInt16 nPos);
124  void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth);
125 
126  using TabPage::ActivatePage;
128 
129 public:
130  SwTableColumnPage(TabPageParent pParent, const SfxItemSet& rSet);
131  virtual ~SwTableColumnPage() override;
132 
133  static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet);
134  virtual bool FillItemSet( SfxItemSet* rSet ) override;
135  virtual void Reset( const SfxItemSet* rSet ) override;
136  virtual void ActivatePage( const SfxItemSet& rSet ) override;
137  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
138 
139 };
140 
142 {
145  bool bHtmlMode;
146 
147  std::unique_ptr<weld::CheckButton> m_xPgBrkCB;
148  std::unique_ptr<weld::RadioButton> m_xPgBrkRB;
149  std::unique_ptr<weld::RadioButton> m_xColBrkRB;
150  std::unique_ptr<weld::RadioButton> m_xPgBrkBeforeRB;
151  std::unique_ptr<weld::RadioButton> m_xPgBrkAfterRB;
152  std::unique_ptr<weld::CheckButton> m_xPageCollCB;
153  std::unique_ptr<weld::ComboBox> m_xPageCollLB;
154  std::unique_ptr<weld::CheckButton> m_xPageNoCB;
155  std::unique_ptr<weld::SpinButton> m_xPageNoNF;
156  std::unique_ptr<weld::CheckButton> m_xSplitCB;
157  std::unique_ptr<weld::CheckButton> m_xSplitRowCB;
158  std::unique_ptr<weld::CheckButton> m_xKeepCB;
159  std::unique_ptr<weld::CheckButton> m_xHeadLineCB;
160  std::unique_ptr<weld::Widget> m_xRepeatHeaderCombo;
161  std::unique_ptr<weld::SpinButton> m_xRepeatHeaderNF;
162  std::unique_ptr<weld::ComboBox> m_xTextDirectionLB;
163  std::unique_ptr<weld::ComboBox> m_xVertOrientLB;
164 
165  DECL_LINK(PageBreakHdl_Impl, weld::ToggleButton&, void);
166  DECL_LINK(ApplyCollClickHdl_Impl, weld::ToggleButton&, void);
167  DECL_LINK(PageBreakPosHdl_Impl, weld::ToggleButton&, void);
168  DECL_LINK(PageBreakTypeHdl_Impl, weld::ToggleButton&, void);
169  DECL_LINK(PageNoClickHdl_Impl, weld::ToggleButton&, void);
170  DECL_LINK(SplitHdl_Impl, weld::ToggleButton&, void);
171  DECL_LINK(HeadLineCBClickHdl, weld::ToggleButton&, void);
172 
173 public:
174  SwTextFlowPage(TabPageParent pParent, const SfxItemSet& rSet);
175  virtual ~SwTextFlowPage() override;
176  static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet);
177  virtual bool FillItemSet( SfxItemSet* rSet ) override;
178  virtual void Reset( const SfxItemSet* rSet ) override;
179 
180  void SetShell(SwWrtShell* pSh);
181 
182  void DisablePageBreak();
183 };
184 
185 #endif
186 
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xRightFT
Definition: tablepg.hxx:59
SwFormatTablePage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: tabledlg.cxx:65
std::unique_ptr< weld::Label > m_xSpaceFT
Definition: tablepg.hxx:112
SwTwips nWidth
Definition: tablepg.hxx:32
std::unique_ptr< weld::ComboBox > m_xVertOrientLB
Definition: tablepg.hxx:163
std::unique_ptr< weld::RadioButton > m_xFreeBtn
Definition: tablepg.hxx:55
sal_uInt16 nNoOfVisibleCols
Definition: tablepg.hxx:101
std::unique_ptr< weld::Label > m_xLeftFT
Definition: tablepg.hxx:57
const SfxItemSet * pSet
void UpdateCols(sal_uInt16 nCurrentPos)
Definition: tabledlg.cxx:923
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:1078
DECL_LINK(AutoClickHdl, weld::ToggleButton &, void)
std::unique_ptr< weld::RadioButton > m_xFullBtn
Definition: tablepg.hxx:50
long SwTwips
Definition: swtypes.hxx:49
std::unique_ptr< weld::SpinButton > m_xRepeatHeaderNF
Definition: tablepg.hxx:161
std::unique_ptr< weld::Label > m_xBottomFT
Definition: tablepg.hxx:63
sal_uInt16 aValueTable[MET_FIELDS]
Definition: tablepg.hxx:103
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:1385
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:759
std::unique_ptr< weld::Button > m_xDownBtn
Definition: tablepg.hxx:115
Used by the UI to modify the document model.
Definition: wrtsh.hxx:86
std::unique_ptr< weld::CheckButton > m_xSplitCB
Definition: tablepg.hxx:156
std::unique_ptr< SwPercentField > m_xRightMF
Definition: tablepg.hxx:60
std::unique_ptr< SwPercentField > m_xWidthMF
Definition: tablepg.hxx:47
std::unique_ptr< weld::CheckButton > m_xPageNoCB
Definition: tablepg.hxx:154
std::unique_ptr< weld::Label > m_xTopFT
Definition: tablepg.hxx:61
SwTwips nMinWidth
Definition: tablepg.hxx:98
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:557
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:880
std::unique_ptr< weld::Entry > m_xNameED
Definition: tablepg.hxx:45
std::unique_ptr< weld::CheckButton > m_xKeepCB
Definition: tablepg.hxx:158
std::unique_ptr< weld::Label > m_aTextArr[MET_FIELDS]
Definition: tablepg.hxx:109
std::unique_ptr< weld::Widget > m_xProperties
Definition: tablepg.hxx:67
DECL_LINK(AutoClickHdl, weld::Button &, void)
virtual void ActivatePage()
std::unique_ptr< weld::ComboBox > m_xPageCollLB
Definition: tablepg.hxx:153
std::unique_ptr< weld::CheckButton > m_xSplitRowCB
Definition: tablepg.hxx:157
void DisablePageBreak()
Definition: tabledlg.cxx:1710
virtual ~SwFormatTablePage() override
Definition: tabledlg.cxx:116
std::unique_ptr< weld::Widget > m_xRepeatHeaderCombo
Definition: tablepg.hxx:160
std::unique_ptr< weld::RadioButton > m_xPgBrkBeforeRB
Definition: tablepg.hxx:150
SwPercentField m_aFieldArr[MET_FIELDS]
Definition: tablepg.hxx:108
SwTwips nTableWidth
Definition: tablepg.hxx:97
std::unique_ptr< SwPercentField > m_xLeftMF
Definition: tablepg.hxx:58
sal_uInt16 nNoOfCols
Definition: tablepg.hxx:100
std::unique_ptr< weld::ComboBox > m_xTextDirectionLB
Definition: tablepg.hxx:162
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:1265
std::unique_ptr< weld::CheckButton > m_xPageCollCB
Definition: tablepg.hxx:152
std::unique_ptr< weld::MetricSpinButton > m_xSpaceED
Definition: tablepg.hxx:113
void ModifyHdl(const weld::MetricSpinButton &rEdit)
Definition: tabledlg.cxx:266
SwTwips nMinTableWidth
Definition: tablepg.hxx:40
std::unique_ptr< weld::RadioButton > m_xPgBrkRB
Definition: tablepg.hxx:148
SwTwips nSaveWidth
Definition: tablepg.hxx:39
#define MET_FIELDS
Definition: tablepg.hxx:92
void ModifyHdl(const weld::MetricSpinButton *pEdit)
Definition: tabledlg.cxx:898
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:764
std::unique_ptr< weld::SpinButton > m_xPageNoNF
Definition: tablepg.hxx:155
SwTextFlowPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: tabledlg.cxx:1209
std::unique_ptr< svx::FrameDirectionListBox > m_xTextDirectionLB
Definition: tablepg.hxx:66
std::unique_ptr< weld::RadioButton > m_xLeftBtn
Definition: tablepg.hxx:51
void SetShell(SwWrtShell *pSh)
Definition: tabledlg.cxx:1586
std::unique_ptr< weld::CheckButton > m_xHeadLineCB
Definition: tablepg.hxx:159
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: tablepg.hxx:64
SwWrtShell * pShell
Definition: tablepg.hxx:143
std::unique_ptr< weld::RadioButton > m_xFromLeftBtn
Definition: tablepg.hxx:52
void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
Definition: tabledlg.cxx:1158
std::unique_ptr< weld::RadioButton > m_xColBrkRB
Definition: tablepg.hxx:149
virtual ~SwTableColumnPage() override
Definition: tabledlg.cxx:755
virtual ~SwTextFlowPage() override
Definition: tabledlg.cxx:1261
DECL_LINK(PageBreakHdl_Impl, weld::ToggleButton &, void)
SwTableColumnPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: tabledlg.cxx:700
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: tablepg.hxx:62
SwTableRep * pTableData
Definition: tablepg.hxx:96
SwTwips GetVisibleWidth(sal_uInt16 nPos)
Definition: tabledlg.cxx:1140
DeactivateRC
std::unique_ptr< weld::Label > m_xWidthFT
Definition: tablepg.hxx:46
bool bVisible
Definition: tablepg.hxx:33
std::unique_ptr< weld::CheckButton > m_xProportionalCB
Definition: tablepg.hxx:111
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:367
virtual void DeactivatePage()
std::unique_ptr< weld::RadioButton > m_xPgBrkAfterRB
Definition: tablepg.hxx:151
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:1035
std::unique_ptr< weld::CheckButton > m_xPgBrkCB
Definition: tablepg.hxx:147
SwTableRep * pTableData
Definition: tablepg.hxx:38
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:372
std::unique_ptr< weld::RadioButton > m_xCenterBtn
Definition: tablepg.hxx:54
std::unique_ptr< weld::RadioButton > m_xRightBtn
Definition: tablepg.hxx:53
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:417
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:1271
std::unique_ptr< weld::CheckButton > m_xModifyTableCB
Definition: tablepg.hxx:110
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:582
void Init(bool bWeb)
Definition: tabledlg.cxx:810
sal_uInt16 nMetFields
Definition: tablepg.hxx:99
std::unique_ptr< weld::CheckButton > m_xRelWidthCB
Definition: tablepg.hxx:48
std::unique_ptr< weld::Button > m_xUpBtn
Definition: tablepg.hxx:114