1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _SWTABLEPG_HXX
20 #define _SWTABLEPG_HXX
21 #include <sfx2/tabdlg.hxx>
22 #include <vcl/fixed.hxx>
23 #include <vcl/button.hxx>
24 #include <vcl/lstbox.hxx>
25 #include <actctrl.hxx>
26 #include "prcntfld.hxx"
27 #include "swtypes.hxx"
38 class SwFormatTablePage
: public SfxTabPage
40 TableNameEdit
* m_pNameED
;
41 FixedText
* m_pWidthFT
;
42 PercentFieldWrap m_aWidthMF
;
43 CheckBox
* m_pRelWidthCB
;
45 RadioButton
* m_pFullBtn
;
46 RadioButton
* m_pLeftBtn
;
47 RadioButton
* m_pFromLeftBtn
;
48 RadioButton
* m_pRightBtn
;
49 RadioButton
* m_pCenterBtn
;
50 RadioButton
* m_pFreeBtn
;
53 PercentFieldWrap m_aLeftMF
;
54 FixedText
* m_pRightFT
;
55 PercentFieldWrap m_aRightMF
;
57 MetricField
* m_pTopMF
;
58 FixedText
* m_pBottomFT
;
59 MetricField
* m_pBottomMF
;
61 ListBox
* m_pTextDirectionLB
;
65 SwTwips nMinTableWidth
;
69 sal_Bool bHtmlMode
: 1;
72 void ModifyHdl(const Edit
* pEdit
);
74 DECL_LINK( AutoClickHdl
, CheckBox
* );
75 DECL_LINK( RelWidthClickHdl
, CheckBox
* );
77 DECL_LINK( UpDownLoseFocusHdl
, MetricField
* );
79 using TabPage::ActivatePage
;
80 using TabPage::DeactivatePage
;
83 SwFormatTablePage( Window
* pParent
, const SfxItemSet
& rSet
);
85 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
86 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
87 virtual void Reset( const SfxItemSet
& rSet
);
88 virtual void ActivatePage( const SfxItemSet
& rSet
);
89 virtual int DeactivatePage( SfxItemSet
* pSet
= 0 );
92 // TabPage Format/Table/Columns
94 #define MET_FIELDS 6 //Number of the used MetricFields
96 class SwTableColumnPage
: public SfxTabPage
98 CheckBox
* m_pModifyTableCB
;
99 CheckBox
* m_pProportionalCB
;
100 FixedText
* m_pSpaceFT
;
101 MetricField
* m_pSpaceED
;
102 PushButton
* m_pUpBtn
;
103 PushButton
* m_pDownBtn
;
105 SwTableRep
* pTblData
;
106 PercentFieldWrap m_aFieldArr
[MET_FIELDS
];
107 FixedText
* m_pTextArr
[MET_FIELDS
];
110 sal_uInt16 nNoOfCols
;
111 sal_uInt16 nNoOfVisibleCols
;
112 //Remember the width, when switching to autoalign
113 sal_uInt16 aValueTbl
[MET_FIELDS
];//primary assignment of the MetricFields
114 sal_Bool bModified
:1;
115 sal_Bool bModifyTbl
:1;
116 sal_Bool bPercentMode
:1;
118 void Init(sal_Bool bWeb
);
119 DECL_LINK( AutoClickHdl
, CheckBox
* );
120 void ModifyHdl( MetricField
* pEdit
);
121 DECL_LINK( UpHdl
, MetricField
* );
122 DECL_LINK( DownHdl
, MetricField
* );
123 DECL_LINK( LoseFocusHdl
, MetricField
* );
124 DECL_LINK( ModeHdl
, CheckBox
* );
125 void UpdateCols( sal_uInt16 nAktPos
);
126 SwTwips
GetVisibleWidth(sal_uInt16 nPos
);
127 void SetVisibleWidth(sal_uInt16 nPos
, SwTwips nNewWidth
);
129 using TabPage::ActivatePage
;
130 using TabPage::DeactivatePage
;
133 SwTableColumnPage( Window
* pParent
, const SfxItemSet
& rSet
);
134 ~SwTableColumnPage();
136 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
137 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
138 virtual void Reset( const SfxItemSet
& rSet
);
139 virtual void ActivatePage( const SfxItemSet
& rSet
);
140 virtual int DeactivatePage( SfxItemSet
* pSet
= 0 );
144 class SwTextFlowPage
: public SfxTabPage
146 CheckBox
* m_pPgBrkCB
;
148 RadioButton
* m_pPgBrkRB
;
149 RadioButton
* m_pColBrkRB
;
151 RadioButton
* m_pPgBrkBeforeRB
;
152 RadioButton
* m_pPgBrkAfterRB
;
154 CheckBox
* m_pPageCollCB
;
155 ListBox
* m_pPageCollLB
;
156 FixedText
* m_pPageNoFT
;
157 NumericField
* m_pPageNoNF
;
158 CheckBox
* m_pSplitCB
;
159 TriStateBox
* m_pSplitRowCB
;
161 CheckBox
* m_pHeadLineCB
;
162 NumericField
* m_pRepeatHeaderNF
;
163 VclContainer
* m_pRepeatHeaderCombo
;
164 ListBox
* m_pTextDirectionLB
;
166 ListBox
* m_pVertOrientLB
;
174 DECL_LINK(PageBreakHdl_Impl
, void *);
175 DECL_LINK(ApplyCollClickHdl_Impl
, void *);
176 DECL_LINK( PageBreakPosHdl_Impl
, RadioButton
* );
177 DECL_LINK( PageBreakTypeHdl_Impl
, RadioButton
* );
178 DECL_LINK( SplitHdl_Impl
, CheckBox
* );
179 DECL_LINK( SplitRowHdl_Impl
, TriStateBox
* );
180 DECL_LINK( HeadLineCBClickHdl
, void* p
= 0 );
183 SwTextFlowPage( Window
* pParent
, const SfxItemSet
& rSet
);
187 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rAttrSet
);
188 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
189 virtual void Reset( const SfxItemSet
& rSet
);
191 void SetShell(SwWrtShell
* pSh
);
193 void DisablePageBreak();
198 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */