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 
20 #pragma once
21 
22 #include <sfx2/tabdlg.hxx>
23 #include <prcntfld.hxx>
24 #include <swtypes.hxx>
25 #include <svx/frmdirlbox.hxx>
26 
27 class SwWrtShell;
28 class SwTableRep;
29 struct ImplSVEvent;
30 
32 {
34  std::unique_ptr<SwTableRep> m_xOrigTableData;
37  bool bModified;
38  bool bFull:1;
39  bool bHtmlMode : 1;
40 
41  std::unique_ptr<weld::Entry> m_xNameED;
42  std::unique_ptr<weld::Label> m_xWidthFT;
43  std::unique_ptr<SwPercentField> m_xWidthMF;
44  std::unique_ptr<weld::CheckButton> m_xRelWidthCB;
45 
46  std::unique_ptr<weld::RadioButton> m_xFullBtn;
47  std::unique_ptr<weld::RadioButton> m_xLeftBtn;
48  std::unique_ptr<weld::RadioButton> m_xFromLeftBtn;
49  std::unique_ptr<weld::RadioButton> m_xRightBtn;
50  std::unique_ptr<weld::RadioButton> m_xCenterBtn;
51  std::unique_ptr<weld::RadioButton> m_xFreeBtn;
52 
53  std::unique_ptr<weld::Label> m_xLeftFT;
54  std::unique_ptr<SwPercentField> m_xLeftMF;
55  std::unique_ptr<weld::Label> m_xRightFT;
56  std::unique_ptr<SwPercentField> m_xRightMF;
57  std::unique_ptr<weld::Label> m_xTopFT;
58  std::unique_ptr<weld::MetricSpinButton> m_xTopMF;
59  std::unique_ptr<weld::Label> m_xBottomFT;
60  std::unique_ptr<weld::MetricSpinButton> m_xBottomMF;
61 
62  std::unique_ptr<svx::FrameDirectionListBox> m_xTextDirectionLB;
63  std::unique_ptr<weld::Widget> m_xProperties;
64 
71 
72  void Init();
73  void ModifyHdl(const weld::MetricSpinButton& rEdit, bool bAllowInconsistencies = false);
74 
75  DECL_LINK(AutoClickHdl, weld::ToggleButton&, void);
76  DECL_LINK(RelWidthClickHdl, weld::ToggleButton&, void);
77  void RightModify();
78  DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
79 
80 public:
81  SwFormatTablePage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet );
82  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
83  virtual ~SwFormatTablePage() override;
84 
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 {
97  std::unique_ptr<SwTableRep> m_xOrigTableData;
101  sal_uInt16 m_nMetFields;
102  sal_uInt16 m_nNoOfCols;
103  sal_uInt16 m_nNoOfVisibleCols;
104  // Remember the width, when switching to autoalign
105  sal_uInt16 m_aValueTable[MET_FIELDS];// primary assignment of the MetricFields
106  bool m_bModified:1;
109 
111  std::unique_ptr<weld::Label> m_aTextArr[MET_FIELDS];
112  std::unique_ptr<weld::CheckButton> m_xModifyTableCB;
113  std::unique_ptr<weld::CheckButton> m_xProportionalCB;
114  std::unique_ptr<weld::Label> m_xSpaceFT;
115  std::unique_ptr<weld::Label> m_xSpaceSFT;
116  std::unique_ptr<weld::MetricSpinButton> m_xSpaceED;
117  std::unique_ptr<weld::Button> m_xUpBtn;
118  std::unique_ptr<weld::Button> m_xDownBtn;
119 
120  void Init(bool bWeb);
121  DECL_LINK(AutoClickHdl, weld::Button&, void);
122  void ModifyHdl(const weld::MetricSpinButton* pEdit);
123  DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
124  DECL_LINK(ModeHdl, weld::ToggleButton&, void);
125  void UpdateCols( sal_uInt16 nCurrentPos );
126  SwTwips GetVisibleWidth(sal_uInt16 nPos);
127  void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth);
128  DECL_LINK(SizeHdl, void*, void);
129 
130 public:
131  SwTableColumnPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
132  static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
133  virtual ~SwTableColumnPage() override;
134 
135  virtual bool FillItemSet( SfxItemSet* rSet ) override;
136  virtual void Reset( const SfxItemSet* rSet ) override;
137  virtual void ActivatePage( const SfxItemSet& rSet ) override;
138  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
139 
140 };
141 
143 {
146  bool bHtmlMode;
147 
148  std::unique_ptr<weld::CheckButton> m_xPgBrkCB;
149  std::unique_ptr<weld::RadioButton> m_xPgBrkRB;
150  std::unique_ptr<weld::RadioButton> m_xColBrkRB;
151  std::unique_ptr<weld::RadioButton> m_xPgBrkBeforeRB;
152  std::unique_ptr<weld::RadioButton> m_xPgBrkAfterRB;
153  std::unique_ptr<weld::CheckButton> m_xPageCollCB;
154  std::unique_ptr<weld::ComboBox> m_xPageCollLB;
155  std::unique_ptr<weld::CheckButton> m_xPageNoCB;
156  std::unique_ptr<weld::SpinButton> m_xPageNoNF;
157  std::unique_ptr<weld::CheckButton> m_xSplitCB;
158  std::unique_ptr<weld::CheckButton> m_xSplitRowCB;
159  std::unique_ptr<weld::CheckButton> m_xKeepCB;
160  std::unique_ptr<weld::CheckButton> m_xHeadLineCB;
161  std::unique_ptr<weld::Widget> m_xRepeatHeaderCombo;
162  std::unique_ptr<weld::SpinButton> m_xRepeatHeaderNF;
163  std::unique_ptr<weld::ComboBox> m_xTextDirectionLB;
164  std::unique_ptr<weld::ComboBox> m_xVertOrientLB;
165 
166  DECL_LINK(PageBreakHdl_Impl, weld::ToggleButton&, void);
167  DECL_LINK(ApplyCollClickHdl_Impl, weld::ToggleButton&, void);
168  DECL_LINK(PageBreakPosHdl_Impl, weld::ToggleButton&, void);
169  DECL_LINK(PageBreakTypeHdl_Impl, weld::ToggleButton&, void);
170  DECL_LINK(PageNoClickHdl_Impl, weld::ToggleButton&, void);
171  DECL_LINK(SplitHdl_Impl, weld::ToggleButton&, void);
172  DECL_LINK(HeadLineCBClickHdl, weld::ToggleButton&, void);
173 
174 public:
175  SwTextFlowPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
176  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
177  virtual ~SwTextFlowPage() override;
178  virtual bool FillItemSet( SfxItemSet* rSet ) override;
179  virtual void Reset( const SfxItemSet* rSet ) override;
180 
181  void SetShell(SwWrtShell* pSh);
182 
183  void DisablePageBreak();
184 };
185 
186 
187 
188 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xRightFT
Definition: tablepg.hxx:55
std::unique_ptr< weld::Label > m_xSpaceFT
Definition: tablepg.hxx:114
sal_uInt16 m_nNoOfVisibleCols
Definition: tablepg.hxx:103
std::unique_ptr< SwTableRep > m_xOrigTableData
Definition: tablepg.hxx:97
std::unique_ptr< weld::ComboBox > m_xVertOrientLB
Definition: tablepg.hxx:164
SwFormatTablePage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:65
SwTableColumnPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:728
std::unique_ptr< weld::RadioButton > m_xFreeBtn
Definition: tablepg.hxx:51
SwTextFlowPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:1264
std::unique_ptr< weld::Label > m_xLeftFT
Definition: tablepg.hxx:53
const SfxItemSet * pSet
sal_uInt16 m_aValueTable[MET_FIELDS]
Definition: tablepg.hxx:105
void UpdateCols(sal_uInt16 nCurrentPos)
Definition: tabledlg.cxx:972
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:1133
SwTwips m_nMinWidth
Definition: tablepg.hxx:100
DECL_LINK(AutoClickHdl, weld::ToggleButton &, void)
void ModifyHdl(const weld::MetricSpinButton &rEdit, bool bAllowInconsistencies=false)
Definition: tabledlg.cxx:270
std::unique_ptr< weld::RadioButton > m_xFullBtn
Definition: tablepg.hxx:46
std::unique_ptr< weld::SpinButton > m_xRepeatHeaderNF
Definition: tablepg.hxx:162
std::unique_ptr< weld::Label > m_xBottomFT
Definition: tablepg.hxx:59
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:1440
std::unique_ptr< weld::Button > m_xDownBtn
Definition: tablepg.hxx:118
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
std::unique_ptr< weld::CheckButton > m_xSplitCB
Definition: tablepg.hxx:157
std::unique_ptr< SwPercentField > m_xRightMF
Definition: tablepg.hxx:56
std::unique_ptr< SwPercentField > m_xWidthMF
Definition: tablepg.hxx:43
std::unique_ptr< weld::CheckButton > m_xPageNoCB
Definition: tablepg.hxx:155
std::unique_ptr< weld::Label > m_xTopFT
Definition: tablepg.hxx:57
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:588
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:929
std::unique_ptr< weld::Entry > m_xNameED
Definition: tablepg.hxx:41
std::unique_ptr< weld::CheckButton > m_xKeepCB
Definition: tablepg.hxx:159
std::unique_ptr< weld::Label > m_aTextArr[MET_FIELDS]
Definition: tablepg.hxx:111
std::unique_ptr< weld::Widget > m_xProperties
Definition: tablepg.hxx:63
DECL_LINK(AutoClickHdl, weld::Button &, void)
std::unique_ptr< weld::ComboBox > m_xPageCollLB
Definition: tablepg.hxx:154
std::unique_ptr< weld::CheckButton > m_xSplitRowCB
Definition: tablepg.hxx:158
void DisablePageBreak()
Definition: tabledlg.cxx:1764
virtual ~SwFormatTablePage() override
Definition: tabledlg.cxx:120
std::unique_ptr< weld::Widget > m_xRepeatHeaderCombo
Definition: tablepg.hxx:161
std::unique_ptr< weld::RadioButton > m_xPgBrkBeforeRB
Definition: tablepg.hxx:151
SwPercentField m_aFieldArr[MET_FIELDS]
Definition: tablepg.hxx:110
sal_uInt16 m_nMetFields
Definition: tablepg.hxx:101
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:804
std::unique_ptr< SwPercentField > m_xLeftMF
Definition: tablepg.hxx:54
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:383
std::unique_ptr< weld::ComboBox > m_xTextDirectionLB
Definition: tablepg.hxx:163
std::unique_ptr< weld::CheckButton > m_xPageCollCB
Definition: tablepg.hxx:153
std::unique_ptr< weld::MetricSpinButton > m_xSpaceED
Definition: tablepg.hxx:116
tools::Long SwTwips
Definition: swtypes.hxx:49
SwTwips nMinTableWidth
Definition: tablepg.hxx:36
std::unique_ptr< weld::RadioButton > m_xPgBrkRB
Definition: tablepg.hxx:149
SwTwips nSaveWidth
Definition: tablepg.hxx:35
#define MET_FIELDS
Definition: tablepg.hxx:92
void ModifyHdl(const weld::MetricSpinButton *pEdit)
Definition: tabledlg.cxx:947
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:809
std::unique_ptr< weld::SpinButton > m_xPageNoNF
Definition: tablepg.hxx:156
std::unique_ptr< svx::FrameDirectionListBox > m_xTextDirectionLB
Definition: tablepg.hxx:62
std::unique_ptr< weld::RadioButton > m_xLeftBtn
Definition: tablepg.hxx:47
void SetShell(SwWrtShell *pSh)
Definition: tabledlg.cxx:1640
std::unique_ptr< weld::CheckButton > m_xHeadLineCB
Definition: tablepg.hxx:160
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: tablepg.hxx:60
sal_uInt16 m_nNoOfCols
Definition: tablepg.hxx:102
SwWrtShell * pShell
Definition: tablepg.hxx:144
std::unique_ptr< weld::RadioButton > m_xFromLeftBtn
Definition: tablepg.hxx:48
void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
Definition: tabledlg.cxx:1213
std::unique_ptr< weld::RadioButton > m_xColBrkRB
Definition: tablepg.hxx:150
virtual ~SwTableColumnPage() override
Definition: tabledlg.cxx:795
virtual ~SwTextFlowPage() override
Definition: tabledlg.cxx:1316
DECL_LINK(PageBreakHdl_Impl, weld::ToggleButton &, void)
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: tablepg.hxx:58
SwTwips GetVisibleWidth(sal_uInt16 nPos)
Definition: tabledlg.cxx:1195
DeactivateRC
std::unique_ptr< weld::Label > m_xSpaceSFT
Definition: tablepg.hxx:115
std::unique_ptr< weld::Label > m_xWidthFT
Definition: tablepg.hxx:42
std::unique_ptr< weld::CheckButton > m_xProportionalCB
Definition: tablepg.hxx:113
std::unique_ptr< SwTableRep > m_xOrigTableData
Definition: tablepg.hxx:34
std::unique_ptr< weld::RadioButton > m_xPgBrkAfterRB
Definition: tablepg.hxx:152
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:1089
std::unique_ptr< weld::CheckButton > m_xPgBrkCB
Definition: tablepg.hxx:148
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:1320
SwTableRep * pTableData
Definition: tablepg.hxx:33
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:388
std::unique_ptr< weld::RadioButton > m_xCenterBtn
Definition: tablepg.hxx:50
std::unique_ptr< weld::RadioButton > m_xRightBtn
Definition: tablepg.hxx:49
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:433
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:1326
std::unique_ptr< weld::CheckButton > m_xModifyTableCB
Definition: tablepg.hxx:112
SwTableRep * m_pTableData
Definition: tablepg.hxx:96
ImplSVEvent * m_pSizeHdlEvent
Definition: tablepg.hxx:98
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:613
void Init(bool bWeb)
Definition: tabledlg.cxx:859
std::unique_ptr< weld::CheckButton > m_xRelWidthCB
Definition: tablepg.hxx:44
SwTwips m_nTableWidth
Definition: tablepg.hxx:99
std::unique_ptr< weld::Button > m_xUpBtn
Definition: tablepg.hxx:117