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