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 <prcntfld.hxx>
23 #include <swtypes.hxx>
24 #include <svx/frmdirlbox.hxx>
25 
26 class SwWrtShell;
27 class SwTableRep;
28 
29 struct TColumn
30 {
32  bool bVisible;
33 };
34 
36 {
40  bool bModified;
41  bool bFull:1;
42  bool bHtmlMode : 1;
43 
44  std::unique_ptr<weld::Entry> m_xNameED;
45  std::unique_ptr<weld::Label> m_xWidthFT;
46  std::unique_ptr<SwPercentField> m_xWidthMF;
47  std::unique_ptr<weld::CheckButton> m_xRelWidthCB;
48 
49  std::unique_ptr<weld::RadioButton> m_xFullBtn;
50  std::unique_ptr<weld::RadioButton> m_xLeftBtn;
51  std::unique_ptr<weld::RadioButton> m_xFromLeftBtn;
52  std::unique_ptr<weld::RadioButton> m_xRightBtn;
53  std::unique_ptr<weld::RadioButton> m_xCenterBtn;
54  std::unique_ptr<weld::RadioButton> m_xFreeBtn;
55 
56  std::unique_ptr<weld::Label> m_xLeftFT;
57  std::unique_ptr<SwPercentField> m_xLeftMF;
58  std::unique_ptr<weld::Label> m_xRightFT;
59  std::unique_ptr<SwPercentField> m_xRightMF;
60  std::unique_ptr<weld::Label> m_xTopFT;
61  std::unique_ptr<weld::MetricSpinButton> m_xTopMF;
62  std::unique_ptr<weld::Label> m_xBottomFT;
63  std::unique_ptr<weld::MetricSpinButton> m_xBottomMF;
64 
65  std::unique_ptr<svx::FrameDirectionListBox> m_xTextDirectionLB;
66  std::unique_ptr<weld::Widget> m_xProperties;
67 
68  void Init();
69  void ModifyHdl(const weld::MetricSpinButton& rEdit);
70 
71  DECL_LINK(AutoClickHdl, weld::ToggleButton&, void);
72  DECL_LINK(RelWidthClickHdl, weld::ToggleButton&, void);
73  void RightModify();
74  DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
75 
78 
79 public:
80  SwFormatTablePage(TabPageParent pParent, const SfxItemSet& rSet );
81  virtual ~SwFormatTablePage() override;
82 
83  static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet);
84  virtual bool FillItemSet( SfxItemSet* rSet ) override;
85  virtual void Reset( const SfxItemSet* rSet ) override;
86  virtual void ActivatePage( const SfxItemSet& rSet ) override;
87  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
88 };
89 
90 // TabPage Format/Table/Columns
91 #define MET_FIELDS 6 //Number of the used MetricFields
92 
94 {
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  DECL_LINK(SizeHdl, void*, void);
126 
127  using TabPage::ActivatePage;
129 
130 public:
131  SwTableColumnPage(TabPageParent pParent, const SfxItemSet& rSet);
132  virtual void dispose() override;
133  virtual ~SwTableColumnPage() override;
134 
135  static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet);
136  virtual bool FillItemSet( SfxItemSet* rSet ) override;
137  virtual void Reset( const SfxItemSet* rSet ) override;
138  virtual void ActivatePage( const SfxItemSet& rSet ) override;
139  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
140 
141 };
142 
144 {
147  bool bHtmlMode;
148 
149  std::unique_ptr<weld::CheckButton> m_xPgBrkCB;
150  std::unique_ptr<weld::RadioButton> m_xPgBrkRB;
151  std::unique_ptr<weld::RadioButton> m_xColBrkRB;
152  std::unique_ptr<weld::RadioButton> m_xPgBrkBeforeRB;
153  std::unique_ptr<weld::RadioButton> m_xPgBrkAfterRB;
154  std::unique_ptr<weld::CheckButton> m_xPageCollCB;
155  std::unique_ptr<weld::ComboBox> m_xPageCollLB;
156  std::unique_ptr<weld::CheckButton> m_xPageNoCB;
157  std::unique_ptr<weld::SpinButton> m_xPageNoNF;
158  std::unique_ptr<weld::CheckButton> m_xSplitCB;
159  std::unique_ptr<weld::CheckButton> m_xSplitRowCB;
160  std::unique_ptr<weld::CheckButton> m_xKeepCB;
161  std::unique_ptr<weld::CheckButton> m_xHeadLineCB;
162  std::unique_ptr<weld::Widget> m_xRepeatHeaderCombo;
163  std::unique_ptr<weld::SpinButton> m_xRepeatHeaderNF;
164  std::unique_ptr<weld::ComboBox> m_xTextDirectionLB;
165  std::unique_ptr<weld::ComboBox> m_xVertOrientLB;
166 
167  DECL_LINK(PageBreakHdl_Impl, weld::ToggleButton&, void);
168  DECL_LINK(ApplyCollClickHdl_Impl, weld::ToggleButton&, void);
169  DECL_LINK(PageBreakPosHdl_Impl, weld::ToggleButton&, void);
170  DECL_LINK(PageBreakTypeHdl_Impl, weld::ToggleButton&, void);
171  DECL_LINK(PageNoClickHdl_Impl, weld::ToggleButton&, void);
172  DECL_LINK(SplitHdl_Impl, weld::ToggleButton&, void);
173  DECL_LINK(HeadLineCBClickHdl, weld::ToggleButton&, void);
174 
175 public:
176  SwTextFlowPage(TabPageParent pParent, const SfxItemSet& rSet);
177  virtual ~SwTextFlowPage() override;
178  static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet);
179  virtual bool FillItemSet( SfxItemSet* rSet ) override;
180  virtual void Reset( const SfxItemSet* rSet ) override;
181 
182  void SetShell(SwWrtShell* pSh);
183 
184  void DisablePageBreak();
185 };
186 
187 #endif
188 
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xRightFT
Definition: tablepg.hxx:58
SwFormatTablePage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: tabledlg.cxx:67
std::unique_ptr< weld::Label > m_xSpaceFT
Definition: tablepg.hxx:112
SwTwips nWidth
Definition: tablepg.hxx:31
std::unique_ptr< weld::ComboBox > m_xVertOrientLB
Definition: tablepg.hxx:165
std::unique_ptr< weld::RadioButton > m_xFreeBtn
Definition: tablepg.hxx:54
sal_uInt16 nNoOfVisibleCols
Definition: tablepg.hxx:101
std::unique_ptr< weld::Label > m_xLeftFT
Definition: tablepg.hxx:56
const SfxItemSet * pSet
void UpdateCols(sal_uInt16 nCurrentPos)
Definition: tabledlg.cxx:947
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:1102
DECL_LINK(AutoClickHdl, weld::ToggleButton &, void)
std::unique_ptr< weld::RadioButton > m_xFullBtn
Definition: tablepg.hxx:49
long SwTwips
Definition: swtypes.hxx:49
std::unique_ptr< weld::SpinButton > m_xRepeatHeaderNF
Definition: tablepg.hxx:163
std::unique_ptr< weld::Label > m_xBottomFT
Definition: tablepg.hxx:62
sal_uInt16 aValueTable[MET_FIELDS]
Definition: tablepg.hxx:103
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:1409
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:783
std::unique_ptr< weld::Button > m_xDownBtn
Definition: tablepg.hxx:115
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
std::unique_ptr< weld::CheckButton > m_xSplitCB
Definition: tablepg.hxx:158
std::unique_ptr< SwPercentField > m_xRightMF
Definition: tablepg.hxx:59
std::unique_ptr< SwPercentField > m_xWidthMF
Definition: tablepg.hxx:46
std::unique_ptr< weld::CheckButton > m_xPageNoCB
Definition: tablepg.hxx:156
std::unique_ptr< weld::Label > m_xTopFT
Definition: tablepg.hxx:60
SwTwips nMinWidth
Definition: tablepg.hxx:98
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:559
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:904
std::unique_ptr< weld::Entry > m_xNameED
Definition: tablepg.hxx:44
std::unique_ptr< weld::CheckButton > m_xKeepCB
Definition: tablepg.hxx:160
std::unique_ptr< weld::Label > m_aTextArr[MET_FIELDS]
Definition: tablepg.hxx:109
std::unique_ptr< weld::Widget > m_xProperties
Definition: tablepg.hxx:66
DECL_LINK(AutoClickHdl, weld::Button &, void)
virtual void ActivatePage()
std::unique_ptr< weld::ComboBox > m_xPageCollLB
Definition: tablepg.hxx:155
std::unique_ptr< weld::CheckButton > m_xSplitRowCB
Definition: tablepg.hxx:159
void DisablePageBreak()
Definition: tabledlg.cxx:1734
virtual ~SwFormatTablePage() override
Definition: tabledlg.cxx:118
std::unique_ptr< weld::Widget > m_xRepeatHeaderCombo
Definition: tablepg.hxx:162
std::unique_ptr< weld::RadioButton > m_xPgBrkBeforeRB
Definition: tablepg.hxx:152
SwPercentField m_aFieldArr[MET_FIELDS]
Definition: tablepg.hxx:108
SwTwips nTableWidth
Definition: tablepg.hxx:97
std::unique_ptr< SwPercentField > m_xLeftMF
Definition: tablepg.hxx:57
sal_uInt16 nNoOfCols
Definition: tablepg.hxx:100
std::unique_ptr< weld::ComboBox > m_xTextDirectionLB
Definition: tablepg.hxx:164
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:1289
std::unique_ptr< weld::CheckButton > m_xPageCollCB
Definition: tablepg.hxx:154
std::unique_ptr< weld::MetricSpinButton > m_xSpaceED
Definition: tablepg.hxx:113
void ModifyHdl(const weld::MetricSpinButton &rEdit)
Definition: tabledlg.cxx:268
SwTwips nMinTableWidth
Definition: tablepg.hxx:39
std::unique_ptr< weld::RadioButton > m_xPgBrkRB
Definition: tablepg.hxx:150
SwTwips nSaveWidth
Definition: tablepg.hxx:38
#define MET_FIELDS
Definition: tablepg.hxx:91
void ModifyHdl(const weld::MetricSpinButton *pEdit)
Definition: tabledlg.cxx:922
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:788
std::unique_ptr< weld::SpinButton > m_xPageNoNF
Definition: tablepg.hxx:157
SwTextFlowPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: tabledlg.cxx:1233
std::unique_ptr< svx::FrameDirectionListBox > m_xTextDirectionLB
Definition: tablepg.hxx:65
std::unique_ptr< weld::RadioButton > m_xLeftBtn
Definition: tablepg.hxx:50
void SetShell(SwWrtShell *pSh)
Definition: tabledlg.cxx:1610
std::unique_ptr< weld::CheckButton > m_xHeadLineCB
Definition: tablepg.hxx:161
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: tablepg.hxx:63
SwWrtShell * pShell
Definition: tablepg.hxx:145
std::unique_ptr< weld::RadioButton > m_xFromLeftBtn
Definition: tablepg.hxx:51
void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
Definition: tabledlg.cxx:1182
std::unique_ptr< weld::RadioButton > m_xColBrkRB
Definition: tablepg.hxx:151
virtual ~SwTableColumnPage() override
Definition: tabledlg.cxx:768
virtual ~SwTextFlowPage() override
Definition: tabledlg.cxx:1285
DECL_LINK(PageBreakHdl_Impl, weld::ToggleButton &, void)
SwTableColumnPage(TabPageParent pParent, const SfxItemSet &rSet)
Definition: tabledlg.cxx:702
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: tablepg.hxx:61
SwTableRep * pTableData
Definition: tablepg.hxx:95
SwTwips GetVisibleWidth(sal_uInt16 nPos)
Definition: tabledlg.cxx:1164
DeactivateRC
std::unique_ptr< weld::Label > m_xWidthFT
Definition: tablepg.hxx:45
bool bVisible
Definition: tablepg.hxx:32
std::unique_ptr< weld::CheckButton > m_xProportionalCB
Definition: tablepg.hxx:111
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:369
virtual void DeactivatePage()
std::unique_ptr< weld::RadioButton > m_xPgBrkAfterRB
Definition: tablepg.hxx:153
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:1059
std::unique_ptr< weld::CheckButton > m_xPgBrkCB
Definition: tablepg.hxx:149
SwTableRep * pTableData
Definition: tablepg.hxx:37
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:374
std::unique_ptr< weld::RadioButton > m_xCenterBtn
Definition: tablepg.hxx:53
std::unique_ptr< weld::RadioButton > m_xRightBtn
Definition: tablepg.hxx:52
virtual void dispose() override
Definition: tabledlg.cxx:773
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:419
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:1295
std::unique_ptr< weld::CheckButton > m_xModifyTableCB
Definition: tablepg.hxx:110
ImplSVEvent * m_pSizeHdlEvent
Definition: tablepg.hxx:96
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:584
void Init(bool bWeb)
Definition: tabledlg.cxx:834
sal_uInt16 nMetFields
Definition: tablepg.hxx:99
std::unique_ptr< weld::CheckButton > m_xRelWidthCB
Definition: tablepg.hxx:47
std::unique_ptr< weld::Button > m_xUpBtn
Definition: tablepg.hxx:114