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
26class SwWrtShell;
27class SwTableRep;
28struct ImplSVEvent;
29
31{
33 std::unique_ptr<SwTableRep> m_xOrigTableData;
37 bool m_bFull:1;
38 bool m_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
64 sal_Int64 m_nOrigWidthMin;
65 sal_Int64 m_nOrigWidthMax;
66 sal_Int64 m_nOrigLeftMin;
67 sal_Int64 m_nOrigLeftMax;
68 sal_Int64 m_nOrigRightMin;
69 sal_Int64 m_nOrigRightMax;
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
79public:
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;
103 // Remember the width, when switching to autoalign
104 sal_uInt16 m_aValueTable[MET_FIELDS];// primary assignment of the MetricFields
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
129public:
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{
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
173public:
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< SwPercentField > m_xRightMF
Definition: tablepg.hxx:55
std::unique_ptr< SwPercentField > m_xLeftMF
Definition: tablepg.hxx:53
std::unique_ptr< SwTableRep > m_xOrigTableData
Definition: tablepg.hxx:33
SwFormatTablePage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:66
void ModifyHdl(const weld::MetricSpinButton &rEdit, bool bAllowInconsistencies=false)
Definition: tabledlg.cxx:270
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:433
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:612
std::unique_ptr< weld::Label > m_xRightFT
Definition: tablepg.hxx:54
sal_Int64 m_nOrigWidthMin
Definition: tablepg.hxx:64
std::unique_ptr< weld::Label > m_xWidthFT
Definition: tablepg.hxx:41
std::unique_ptr< weld::RadioButton > m_xFreeBtn
Definition: tablepg.hxx:50
std::unique_ptr< weld::RadioButton > m_xFromLeftBtn
Definition: tablepg.hxx:47
SwTableRep * m_pTableData
Definition: tablepg.hxx:32
DECL_LINK(ValueChangedHdl, weld::MetricSpinButton &, void)
sal_Int64 m_nOrigRightMax
Definition: tablepg.hxx:69
sal_Int64 m_nOrigRightMin
Definition: tablepg.hxx:68
std::unique_ptr< weld::RadioButton > m_xRightBtn
Definition: tablepg.hxx:48
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: tablepg.hxx:59
virtual ~SwFormatTablePage() override
Definition: tabledlg.cxx:120
DECL_LINK(AutoClickHdl, weld::Toggleable &, void)
std::unique_ptr< weld::Widget > m_xProperties
Definition: tablepg.hxx:62
sal_Int64 m_nOrigWidthMax
Definition: tablepg.hxx:65
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: tablepg.hxx:57
std::unique_ptr< weld::RadioButton > m_xCenterBtn
Definition: tablepg.hxx:49
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:388
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:587
std::unique_ptr< weld::Label > m_xBottomFT
Definition: tablepg.hxx:58
std::unique_ptr< weld::Label > m_xTopFT
Definition: tablepg.hxx:56
std::unique_ptr< weld::Entry > m_xNameED
Definition: tablepg.hxx:40
std::unique_ptr< weld::RadioButton > m_xFullBtn
Definition: tablepg.hxx:45
std::unique_ptr< SwPercentField > m_xWidthMF
Definition: tablepg.hxx:42
DECL_LINK(RelWidthClickHdl, weld::Toggleable &, void)
std::unique_ptr< weld::Label > m_xLeftFT
Definition: tablepg.hxx:52
std::unique_ptr< svx::FrameDirectionListBox > m_xTextDirectionLB
Definition: tablepg.hxx:61
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:383
SwTwips m_nSaveWidth
Definition: tablepg.hxx:34
SwTwips m_nMinTableWidth
Definition: tablepg.hxx:35
std::unique_ptr< weld::CheckButton > m_xRelWidthCB
Definition: tablepg.hxx:43
sal_Int64 m_nOrigLeftMin
Definition: tablepg.hxx:66
sal_Int64 m_nOrigLeftMax
Definition: tablepg.hxx:67
std::unique_ptr< weld::RadioButton > m_xLeftBtn
Definition: tablepg.hxx:46
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:807
SwPercentField m_aFieldArr[MET_FIELDS]
Definition: tablepg.hxx:109
virtual ~SwTableColumnPage() override
Definition: tabledlg.cxx:798
SwTwips GetVisibleWidth(sal_uInt16 nPos)
Definition: tabledlg.cxx:1184
sal_uInt16 m_nNoOfCols
Definition: tablepg.hxx:101
std::unique_ptr< SwTableRep > m_xOrigTableData
Definition: tablepg.hxx:96
ImplSVEvent * m_pSizeHdlEvent
Definition: tablepg.hxx:97
SwTwips m_nTableWidth
Definition: tablepg.hxx:98
std::unique_ptr< weld::Label > m_aTextArr[MET_FIELDS]
Definition: tablepg.hxx:110
SwTableColumnPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:727
DECL_LINK(AutoClickHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xUpBtn
Definition: tablepg.hxx:116
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tabledlg.cxx:1078
void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
Definition: tabledlg.cxx:1202
std::unique_ptr< weld::Label > m_xSpaceSFT
Definition: tablepg.hxx:114
std::unique_ptr< weld::CheckButton > m_xProportionalCB
Definition: tablepg.hxx:112
std::unique_ptr< weld::CheckButton > m_xModifyTableCB
Definition: tablepg.hxx:111
sal_uInt16 m_aValueTable[MET_FIELDS]
Definition: tablepg.hxx:104
std::unique_ptr< weld::Label > m_xSpaceFT
Definition: tablepg.hxx:113
SwTwips m_nMinWidth
Definition: tablepg.hxx:99
void Init(bool bWeb)
Definition: tabledlg.cxx:861
std::unique_ptr< weld::Button > m_xDownBtn
Definition: tablepg.hxx:117
std::unique_ptr< weld::MetricSpinButton > m_xSpaceED
Definition: tablepg.hxx:115
sal_uInt16 m_nNoOfVisibleCols
Definition: tablepg.hxx:102
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:931
DECL_LINK(ModeHdl, weld::Toggleable &, void)
void UpdateCols(sal_uInt16 nCurrentPos)
Definition: tabledlg.cxx:974
SwTableRep * m_pTableData
Definition: tablepg.hxx:95
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tabledlg.cxx:1122
DECL_LINK(SizeHdl, void *, void)
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:812
DECL_LINK(ValueChangedHdl, weld::MetricSpinButton &, void)
void ModifyHdl(const weld::MetricSpinButton *pEdit)
Definition: tabledlg.cxx:949
std::unique_ptr< weld::RadioButton > m_xPgBrkBeforeRB
Definition: tablepg.hxx:150
std::unique_ptr< weld::RadioButton > m_xPgBrkAfterRB
Definition: tablepg.hxx:151
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: tabledlg.cxx:1308
std::unique_ptr< weld::ComboBox > m_xTextDirectionLB
Definition: tablepg.hxx:162
SwTextFlowPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: tabledlg.cxx:1253
std::unique_ptr< weld::CheckButton > m_xSplitCB
Definition: tablepg.hxx:156
DECL_LINK(PageBreakTypeHdl_Impl, weld::Toggleable &, void)
DECL_LINK(SplitHdl_Impl, weld::Toggleable &, void)
std::unique_ptr< weld::ComboBox > m_xPageCollLB
Definition: tablepg.hxx:153
virtual void Reset(const SfxItemSet *rSet) override
Definition: tabledlg.cxx:1428
std::unique_ptr< weld::SpinButton > m_xRepeatHeaderNF
Definition: tablepg.hxx:161
DECL_LINK(HeadLineCBClickHdl, weld::Toggleable &, void)
virtual ~SwTextFlowPage() override
Definition: tabledlg.cxx:1304
DECL_LINK(ApplyCollClickHdl_Impl, weld::Toggleable &, void)
bool m_bHtmlMode
Definition: tablepg.hxx:145
std::unique_ptr< weld::CheckButton > m_xHeadLineCB
Definition: tablepg.hxx:159
std::unique_ptr< weld::ComboBox > m_xVertOrientLB
Definition: tablepg.hxx:163
DECL_LINK(PageNoClickHdl_Impl, weld::Toggleable &, void)
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: tabledlg.cxx:1314
std::unique_ptr< weld::CheckButton > m_xPageNoCB
Definition: tablepg.hxx:154
std::unique_ptr< weld::CheckButton > m_xPageCollCB
Definition: tablepg.hxx:152
DECL_LINK(PageBreakHdl_Impl, weld::Toggleable &, void)
std::unique_ptr< weld::RadioButton > m_xColBrkRB
Definition: tablepg.hxx:149
SwWrtShell * m_pShell
Definition: tablepg.hxx:143
std::unique_ptr< weld::SpinButton > m_xPageNoNF
Definition: tablepg.hxx:155
DECL_LINK(PageBreakPosHdl_Impl, weld::Toggleable &, void)
std::unique_ptr< weld::CheckButton > m_xKeepCB
Definition: tablepg.hxx:158
void SetShell(SwWrtShell *pSh)
Definition: tabledlg.cxx:1624
std::unique_ptr< weld::RadioButton > m_xPgBrkRB
Definition: tablepg.hxx:148
void DisablePageBreak()
Definition: tabledlg.cxx:1748
std::unique_ptr< weld::CheckButton > m_xSplitRowCB
Definition: tablepg.hxx:157
std::unique_ptr< weld::CheckButton > m_xPgBrkCB
Definition: tablepg.hxx:147
bool m_bPageBreak
Definition: tablepg.hxx:144
std::unique_ptr< weld::Widget > m_xRepeatHeaderCombo
Definition: tablepg.hxx:160
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
tools::Long SwTwips
Definition: swtypes.hxx:51
DeactivateRC
#define MET_FIELDS
Definition: tablepg.hxx:91