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 #pragma once
20 
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 struct ImplSVEvent;
29 
31 {
33  std::unique_ptr<SwTableRep> m_xOrigTableData;
36  bool bModified;
37  bool bFull:1;
38  bool bHtmlMode : 1;
39 
40  std::unique_ptr<weld::Entry> m_xNameED;
41  std::unique_ptr<weld::Label> m_xWidthFT;
42  std::unique_ptr<SwPercentField> m_xWidthMF;
43  std::unique_ptr<weld::CheckButton> m_xRelWidthCB;
44 
45  std::unique_ptr<weld::RadioButton> m_xFullBtn;
46  std::unique_ptr<weld::RadioButton> m_xLeftBtn;
47  std::unique_ptr<weld::RadioButton> m_xFromLeftBtn;
48  std::unique_ptr<weld::RadioButton> m_xRightBtn;
49  std::unique_ptr<weld::RadioButton> m_xCenterBtn;
50  std::unique_ptr<weld::RadioButton> m_xFreeBtn;
51 
52  std::unique_ptr<weld::Label> m_xLeftFT;
53  std::unique_ptr<SwPercentField> m_xLeftMF;
54  std::unique_ptr<weld::Label> m_xRightFT;
55  std::unique_ptr<SwPercentField> m_xRightMF;
56  std::unique_ptr<weld::Label> m_xTopFT;
57  std::unique_ptr<weld::MetricSpinButton> m_xTopMF;
58  std::unique_ptr<weld::Label> m_xBottomFT;
59  std::unique_ptr<weld::MetricSpinButton> m_xBottomMF;
60 
61  std::unique_ptr<svx::FrameDirectionListBox> m_xTextDirectionLB;
62  std::unique_ptr<weld::Widget> m_xProperties;
63 
70 
71  void Init();
72  void ModifyHdl(const weld::MetricSpinButton& rEdit, bool bAllowInconsistencies = false);
73 
74  DECL_LINK(AutoClickHdl, weld::Toggleable&, void);
75  DECL_LINK(RelWidthClickHdl, weld::Toggleable&, void);
76  void RightModify();
77  DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
78 
79 public:
80  SwFormatTablePage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet );
81  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
82  virtual ~SwFormatTablePage() override;
83 
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 5 //Number of the used MetricFields
92 
94 {
96  std::unique_ptr<SwTableRep> m_xOrigTableData;
100  sal_uInt16 m_nMetFields;
101  sal_uInt16 m_nNoOfCols;
102  sal_uInt16 m_nNoOfVisibleCols;
103  // Remember the width, when switching to autoalign
104  sal_uInt16 m_aValueTable[MET_FIELDS];// primary assignment of the MetricFields
105  bool m_bModified:1;
108 
110  std::unique_ptr<weld::Label> m_aTextArr[MET_FIELDS];
111  std::unique_ptr<weld::CheckButton> m_xModifyTableCB;
112  std::unique_ptr<weld::CheckButton> m_xProportionalCB;
113  std::unique_ptr<weld::Label> m_xSpaceFT;
114  std::unique_ptr<weld::Label> m_xSpaceSFT;
115  std::unique_ptr<weld::MetricSpinButton> m_xSpaceED;
116  std::unique_ptr<weld::Button> m_xUpBtn;
117  std::unique_ptr<weld::Button> m_xDownBtn;
118 
119  void Init(bool bWeb);
120  DECL_LINK(AutoClickHdl, weld::Button&, void);
121  void ModifyHdl(const weld::MetricSpinButton* pEdit);
122  DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
123  DECL_LINK(ModeHdl, weld::Toggleable&, void);
124  void UpdateCols( sal_uInt16 nCurrentPos );
125  SwTwips GetVisibleWidth(sal_uInt16 nPos);
126  void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth);
127  DECL_LINK(SizeHdl, void*, void);
128 
129 public:
130  SwTableColumnPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
131  static std::unique_ptr<SfxTabPage> Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
132  virtual ~SwTableColumnPage() override;
133 
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::Toggleable&, void);
166  DECL_LINK(ApplyCollClickHdl_Impl, weld::Toggleable&, void);
167  DECL_LINK(PageBreakPosHdl_Impl, weld::Toggleable&, void);
168  DECL_LINK(PageBreakTypeHdl_Impl, weld::Toggleable&, void);
169  DECL_LINK(PageNoClickHdl_Impl, weld::Toggleable&, void);
170  DECL_LINK(SplitHdl_Impl, weld::Toggleable&, void);
171  DECL_LINK(HeadLineCBClickHdl, weld::Toggleable&, void);
172 
173 public:
174  SwTextFlowPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet);
175  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet);
176  virtual ~SwTextFlowPage() override;
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 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > m_xRightFT
Definition: tablepg.hxx:54
std::unique_ptr< weld::Label > m_xSpaceFT
Definition: tablepg.hxx:113
sal_uInt16 m_nNoOfVisibleCols
Definition: tablepg.hxx:102
std::unique_ptr< SwTableRep > m_xOrigTableData
Definition: tablepg.hxx:96
std::unique_ptr< weld::ComboBox > m_xVertOrientLB
Definition: tablepg.hxx:163
SwFormatTablePage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:66
SwTableColumnPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:729
std::unique_ptr< weld::RadioButton > m_xFreeBtn
Definition: tablepg.hxx:50
SwTextFlowPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:1250
std::unique_ptr< weld::Label > m_xLeftFT
Definition: tablepg.hxx:52
const SfxItemSet * pSet
sal_uInt16 m_aValueTable[MET_FIELDS]
Definition: tablepg.hxx:104
void UpdateCols(sal_uInt16 nCurrentPos)
Definition: tabledlg.cxx:971
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:1119
SwTwips m_nMinWidth
Definition: tablepg.hxx:99
void ModifyHdl(const weld::MetricSpinButton &rEdit, bool bAllowInconsistencies=false)
Definition: tabledlg.cxx:271
std::unique_ptr< weld::RadioButton > m_xFullBtn
Definition: tablepg.hxx:45
std::unique_ptr< weld::SpinButton > m_xRepeatHeaderNF
Definition: tablepg.hxx:161
std::unique_ptr< weld::Label > m_xBottomFT
Definition: tablepg.hxx:58
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:1426
std::unique_ptr< weld::Button > m_xDownBtn
Definition: tablepg.hxx:117
Used by the UI to modify the document model.
Definition: wrtsh.hxx:93
std::unique_ptr< weld::CheckButton > m_xSplitCB
Definition: tablepg.hxx:156
std::unique_ptr< SwPercentField > m_xRightMF
Definition: tablepg.hxx:55
std::unique_ptr< SwPercentField > m_xWidthMF
Definition: tablepg.hxx:42
std::unique_ptr< weld::CheckButton > m_xPageNoCB
Definition: tablepg.hxx:154
std::unique_ptr< weld::Label > m_xTopFT
Definition: tablepg.hxx:56
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:589
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:928
std::unique_ptr< weld::Entry > m_xNameED
Definition: tablepg.hxx:40
std::unique_ptr< weld::CheckButton > m_xKeepCB
Definition: tablepg.hxx:158
std::unique_ptr< weld::Label > m_aTextArr[MET_FIELDS]
Definition: tablepg.hxx:110
std::unique_ptr< weld::Widget > m_xProperties
Definition: tablepg.hxx:62
DECL_LINK(AutoClickHdl, weld::Button &, void)
DECL_LINK(PageBreakHdl_Impl, weld::Toggleable &, void)
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:1749
virtual ~SwFormatTablePage() override
Definition: tabledlg.cxx:121
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:109
DECL_LINK(AutoClickHdl, weld::Toggleable &, void)
sal_uInt16 m_nMetFields
Definition: tablepg.hxx:100
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:803
std::unique_ptr< SwPercentField > m_xLeftMF
Definition: tablepg.hxx:53
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:384
std::unique_ptr< weld::ComboBox > m_xTextDirectionLB
Definition: tablepg.hxx:162
std::unique_ptr< weld::CheckButton > m_xPageCollCB
Definition: tablepg.hxx:152
std::unique_ptr< weld::MetricSpinButton > m_xSpaceED
Definition: tablepg.hxx:115
tools::Long SwTwips
Definition: swtypes.hxx:52
SwTwips nMinTableWidth
Definition: tablepg.hxx:35
std::unique_ptr< weld::RadioButton > m_xPgBrkRB
Definition: tablepg.hxx:148
SwTwips nSaveWidth
Definition: tablepg.hxx:34
#define MET_FIELDS
Definition: tablepg.hxx:91
void ModifyHdl(const weld::MetricSpinButton *pEdit)
Definition: tabledlg.cxx:946
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:808
std::unique_ptr< weld::SpinButton > m_xPageNoNF
Definition: tablepg.hxx:155
std::unique_ptr< svx::FrameDirectionListBox > m_xTextDirectionLB
Definition: tablepg.hxx:61
std::unique_ptr< weld::RadioButton > m_xLeftBtn
Definition: tablepg.hxx:46
void SetShell(SwWrtShell *pSh)
Definition: tabledlg.cxx:1625
std::unique_ptr< weld::CheckButton > m_xHeadLineCB
Definition: tablepg.hxx:159
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: tablepg.hxx:59
sal_uInt16 m_nNoOfCols
Definition: tablepg.hxx:101
SwWrtShell * pShell
Definition: tablepg.hxx:143
std::unique_ptr< weld::RadioButton > m_xFromLeftBtn
Definition: tablepg.hxx:47
void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
Definition: tabledlg.cxx:1199
std::unique_ptr< weld::RadioButton > m_xColBrkRB
Definition: tablepg.hxx:149
virtual ~SwTableColumnPage() override
Definition: tabledlg.cxx:794
virtual ~SwTextFlowPage() override
Definition: tabledlg.cxx:1302
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: tablepg.hxx:57
SwTwips GetVisibleWidth(sal_uInt16 nPos)
Definition: tabledlg.cxx:1181
DeactivateRC
std::unique_ptr< weld::Label > m_xSpaceSFT
Definition: tablepg.hxx:114
std::unique_ptr< weld::Label > m_xWidthFT
Definition: tablepg.hxx:41
std::unique_ptr< weld::CheckButton > m_xProportionalCB
Definition: tablepg.hxx:112
std::unique_ptr< SwTableRep > m_xOrigTableData
Definition: tablepg.hxx:33
std::unique_ptr< weld::RadioButton > m_xPgBrkAfterRB
Definition: tablepg.hxx:151
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:1075
std::unique_ptr< weld::CheckButton > m_xPgBrkCB
Definition: tablepg.hxx:147
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:1306
SwTableRep * pTableData
Definition: tablepg.hxx:32
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:389
std::unique_ptr< weld::RadioButton > m_xCenterBtn
Definition: tablepg.hxx:49
std::unique_ptr< weld::RadioButton > m_xRightBtn
Definition: tablepg.hxx:48
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:434
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:1312
std::unique_ptr< weld::CheckButton > m_xModifyTableCB
Definition: tablepg.hxx:111
SwTableRep * m_pTableData
Definition: tablepg.hxx:95
ImplSVEvent * m_pSizeHdlEvent
Definition: tablepg.hxx:97
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:614
void Init(bool bWeb)
Definition: tabledlg.cxx:858
std::unique_ptr< weld::CheckButton > m_xRelWidthCB
Definition: tablepg.hxx:43
SwTwips m_nTableWidth
Definition: tablepg.hxx:98
std::unique_ptr< weld::Button > m_xUpBtn
Definition: tablepg.hxx:116