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 
76 public:
77  SwFormatTablePage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet );
78  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
79  virtual ~SwFormatTablePage() override;
80 
81  virtual bool FillItemSet( SfxItemSet* rSet ) override;
82  virtual void Reset( const SfxItemSet* rSet ) override;
83  virtual void ActivatePage( const SfxItemSet& rSet ) override;
84  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
85 };
86 
87 // TabPage Format/Table/Columns
88 #define MET_FIELDS 6 //Number of the used MetricFields
89 
91 {
96  sal_uInt16 m_nMetFields;
97  sal_uInt16 m_nNoOfCols;
98  sal_uInt16 m_nNoOfVisibleCols;
99  // Remember the width, when switching to autoalign
100  sal_uInt16 m_aValueTable[MET_FIELDS];// primary assignment of the MetricFields
101  bool m_bModified:1;
104 
106  std::unique_ptr<weld::Label> m_aTextArr[MET_FIELDS];
107  std::unique_ptr<weld::CheckButton> m_xModifyTableCB;
108  std::unique_ptr<weld::CheckButton> m_xProportionalCB;
109  std::unique_ptr<weld::Label> m_xSpaceFT;
110  std::unique_ptr<weld::MetricSpinButton> m_xSpaceED;
111  std::unique_ptr<weld::Button> m_xUpBtn;
112  std::unique_ptr<weld::Button> m_xDownBtn;
113 
114  void Init(bool bWeb);
115  DECL_LINK(AutoClickHdl, weld::Button&, void);
116  void ModifyHdl(const weld::MetricSpinButton* pEdit);
117  DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
118  DECL_LINK(ModeHdl, weld::ToggleButton&, void);
119  void UpdateCols( sal_uInt16 nCurrentPos );
120  SwTwips GetVisibleWidth(sal_uInt16 nPos);
121  void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth);
122  DECL_LINK(SizeHdl, void*, void);
123 
124 public:
125  SwTableColumnPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
126  static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
127  virtual ~SwTableColumnPage() override;
128 
129  virtual bool FillItemSet( SfxItemSet* rSet ) override;
130  virtual void Reset( const SfxItemSet* rSet ) override;
131  virtual void ActivatePage( const SfxItemSet& rSet ) override;
132  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
133 
134 };
135 
137 {
140  bool bHtmlMode;
141 
142  std::unique_ptr<weld::CheckButton> m_xPgBrkCB;
143  std::unique_ptr<weld::RadioButton> m_xPgBrkRB;
144  std::unique_ptr<weld::RadioButton> m_xColBrkRB;
145  std::unique_ptr<weld::RadioButton> m_xPgBrkBeforeRB;
146  std::unique_ptr<weld::RadioButton> m_xPgBrkAfterRB;
147  std::unique_ptr<weld::CheckButton> m_xPageCollCB;
148  std::unique_ptr<weld::ComboBox> m_xPageCollLB;
149  std::unique_ptr<weld::CheckButton> m_xPageNoCB;
150  std::unique_ptr<weld::SpinButton> m_xPageNoNF;
151  std::unique_ptr<weld::CheckButton> m_xSplitCB;
152  std::unique_ptr<weld::CheckButton> m_xSplitRowCB;
153  std::unique_ptr<weld::CheckButton> m_xKeepCB;
154  std::unique_ptr<weld::CheckButton> m_xHeadLineCB;
155  std::unique_ptr<weld::Widget> m_xRepeatHeaderCombo;
156  std::unique_ptr<weld::SpinButton> m_xRepeatHeaderNF;
157  std::unique_ptr<weld::ComboBox> m_xTextDirectionLB;
158  std::unique_ptr<weld::ComboBox> m_xVertOrientLB;
159 
160  DECL_LINK(PageBreakHdl_Impl, weld::ToggleButton&, void);
161  DECL_LINK(ApplyCollClickHdl_Impl, weld::ToggleButton&, void);
162  DECL_LINK(PageBreakPosHdl_Impl, weld::ToggleButton&, void);
163  DECL_LINK(PageBreakTypeHdl_Impl, weld::ToggleButton&, void);
164  DECL_LINK(PageNoClickHdl_Impl, weld::ToggleButton&, void);
165  DECL_LINK(SplitHdl_Impl, weld::ToggleButton&, void);
166  DECL_LINK(HeadLineCBClickHdl, weld::ToggleButton&, void);
167 
168 public:
169  SwTextFlowPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
170  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
171  virtual ~SwTextFlowPage() override;
172  virtual bool FillItemSet( SfxItemSet* rSet ) override;
173  virtual void Reset( const SfxItemSet* rSet ) override;
174 
175  void SetShell(SwWrtShell* pSh);
176 
177  void DisablePageBreak();
178 };
179 
180 #endif
181 
182 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xRightFT
Definition: tablepg.hxx:58
std::unique_ptr< weld::Label > m_xSpaceFT
Definition: tablepg.hxx:109
SwTwips nWidth
Definition: tablepg.hxx:31
sal_uInt16 m_nNoOfVisibleCols
Definition: tablepg.hxx:98
std::unique_ptr< weld::ComboBox > m_xVertOrientLB
Definition: tablepg.hxx:158
SwFormatTablePage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:67
SwTableColumnPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:702
std::unique_ptr< weld::RadioButton > m_xFreeBtn
Definition: tablepg.hxx:54
SwTextFlowPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:1227
std::unique_ptr< weld::Label > m_xLeftFT
Definition: tablepg.hxx:56
const SfxItemSet * pSet
sal_uInt16 m_aValueTable[MET_FIELDS]
Definition: tablepg.hxx:100
void UpdateCols(sal_uInt16 nCurrentPos)
Definition: tabledlg.cxx:941
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:1096
SwTwips m_nMinWidth
Definition: tablepg.hxx:95
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:156
std::unique_ptr< weld::Label > m_xBottomFT
Definition: tablepg.hxx:62
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:1403
std::unique_ptr< weld::Button > m_xDownBtn
Definition: tablepg.hxx:112
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
std::unique_ptr< weld::CheckButton > m_xSplitCB
Definition: tablepg.hxx:151
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:149
std::unique_ptr< weld::Label > m_xTopFT
Definition: tablepg.hxx:60
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:559
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:898
std::unique_ptr< weld::Entry > m_xNameED
Definition: tablepg.hxx:44
std::unique_ptr< weld::CheckButton > m_xKeepCB
Definition: tablepg.hxx:153
std::unique_ptr< weld::Label > m_aTextArr[MET_FIELDS]
Definition: tablepg.hxx:106
std::unique_ptr< weld::Widget > m_xProperties
Definition: tablepg.hxx:66
DECL_LINK(AutoClickHdl, weld::Button &, void)
std::unique_ptr< weld::ComboBox > m_xPageCollLB
Definition: tablepg.hxx:148
std::unique_ptr< weld::CheckButton > m_xSplitRowCB
Definition: tablepg.hxx:152
void DisablePageBreak()
Definition: tabledlg.cxx:1728
virtual ~SwFormatTablePage() override
Definition: tabledlg.cxx:118
std::unique_ptr< weld::Widget > m_xRepeatHeaderCombo
Definition: tablepg.hxx:155
std::unique_ptr< weld::RadioButton > m_xPgBrkBeforeRB
Definition: tablepg.hxx:145
SwPercentField m_aFieldArr[MET_FIELDS]
Definition: tablepg.hxx:105
sal_uInt16 m_nMetFields
Definition: tablepg.hxx:96
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:777
std::unique_ptr< SwPercentField > m_xLeftMF
Definition: tablepg.hxx:57
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:369
std::unique_ptr< weld::ComboBox > m_xTextDirectionLB
Definition: tablepg.hxx:157
std::unique_ptr< weld::CheckButton > m_xPageCollCB
Definition: tablepg.hxx:147
std::unique_ptr< weld::MetricSpinButton > m_xSpaceED
Definition: tablepg.hxx:110
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:143
SwTwips nSaveWidth
Definition: tablepg.hxx:38
#define MET_FIELDS
Definition: tablepg.hxx:88
void ModifyHdl(const weld::MetricSpinButton *pEdit)
Definition: tabledlg.cxx:916
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:782
std::unique_ptr< weld::SpinButton > m_xPageNoNF
Definition: tablepg.hxx:150
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:1604
std::unique_ptr< weld::CheckButton > m_xHeadLineCB
Definition: tablepg.hxx:154
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: tablepg.hxx:63
sal_uInt16 m_nNoOfCols
Definition: tablepg.hxx:97
SwWrtShell * pShell
Definition: tablepg.hxx:138
std::unique_ptr< weld::RadioButton > m_xFromLeftBtn
Definition: tablepg.hxx:51
void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
Definition: tabledlg.cxx:1176
std::unique_ptr< weld::RadioButton > m_xColBrkRB
Definition: tablepg.hxx:144
virtual ~SwTableColumnPage() override
Definition: tabledlg.cxx:768
virtual ~SwTextFlowPage() override
Definition: tabledlg.cxx:1279
DECL_LINK(PageBreakHdl_Impl, weld::ToggleButton &, void)
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: tablepg.hxx:61
SwTwips GetVisibleWidth(sal_uInt16 nPos)
Definition: tabledlg.cxx:1158
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:108
std::unique_ptr< weld::RadioButton > m_xPgBrkAfterRB
Definition: tablepg.hxx:146
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:1053
std::unique_ptr< weld::CheckButton > m_xPgBrkCB
Definition: tablepg.hxx:142
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:1283
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 Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:419
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:1289
std::unique_ptr< weld::CheckButton > m_xModifyTableCB
Definition: tablepg.hxx:107
SwTableRep * m_pTableData
Definition: tablepg.hxx:92
ImplSVEvent * m_pSizeHdlEvent
Definition: tablepg.hxx:93
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:584
void Init(bool bWeb)
Definition: tabledlg.cxx:828
std::unique_ptr< weld::CheckButton > m_xRelWidthCB
Definition: tablepg.hxx:47
SwTwips m_nTableWidth
Definition: tablepg.hxx:94
std::unique_ptr< weld::Button > m_xUpBtn
Definition: tablepg.hxx:111