Line data Source code
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 _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"
28 :
29 : class SwWrtShell;
30 : class SwTableRep;
31 :
32 : struct TColumn
33 : {
34 : SwTwips nWidth;
35 : sal_Bool bVisible;
36 : };
37 :
38 0 : class SwFormatTablePage : public SfxTabPage
39 : {
40 : TableNameEdit* m_pNameED;
41 : FixedText* m_pWidthFT;
42 : PercentFieldWrap m_aWidthMF;
43 : CheckBox* m_pRelWidthCB;
44 :
45 : RadioButton* m_pFullBtn;
46 : RadioButton* m_pLeftBtn;
47 : RadioButton* m_pFromLeftBtn;
48 : RadioButton* m_pRightBtn;
49 : RadioButton* m_pCenterBtn;
50 : RadioButton* m_pFreeBtn;
51 :
52 : FixedText* m_pLeftFT;
53 : PercentFieldWrap m_aLeftMF;
54 : FixedText* m_pRightFT;
55 : PercentFieldWrap m_aRightMF;
56 : FixedText* m_pTopFT;
57 : MetricField* m_pTopMF;
58 : FixedText* m_pBottomFT;
59 : MetricField* m_pBottomMF;
60 :
61 : ListBox* m_pTextDirectionLB;
62 :
63 : SwTableRep* pTblData;
64 : SwTwips nSaveWidth;
65 : SwTwips nMinTableWidth;
66 : sal_uInt16 nOldAlign;
67 : sal_Bool bModified;
68 : sal_Bool bFull:1;
69 : sal_Bool bHtmlMode : 1;
70 :
71 : void Init();
72 : void ModifyHdl(const Edit* pEdit);
73 :
74 : DECL_LINK( AutoClickHdl, CheckBox * );
75 : DECL_LINK( RelWidthClickHdl, CheckBox * );
76 : void RightModify();
77 : DECL_LINK( UpDownLoseFocusHdl, MetricField * );
78 :
79 : using TabPage::ActivatePage;
80 : using TabPage::DeactivatePage;
81 :
82 : public:
83 : SwFormatTablePage( Window* pParent, const SfxItemSet& rSet );
84 :
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 );
90 : };
91 :
92 : // TabPage Format/Table/Columns
93 :
94 : #define MET_FIELDS 6 //Number of the used MetricFields
95 :
96 : class SwTableColumnPage : public SfxTabPage
97 : {
98 : CheckBox* m_pModifyTableCB;
99 : CheckBox* m_pProportionalCB;
100 : FixedText* m_pSpaceFT;
101 : MetricField* m_pSpaceED;
102 : PushButton* m_pUpBtn;
103 : PushButton* m_pDownBtn;
104 :
105 : SwTableRep* pTblData;
106 : PercentFieldWrap m_aFieldArr[MET_FIELDS];
107 : FixedText* m_pTextArr[MET_FIELDS];
108 : SwTwips nTableWidth;
109 : SwTwips nMinWidth;
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;
117 :
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);
128 :
129 : using TabPage::ActivatePage;
130 : using TabPage::DeactivatePage;
131 :
132 : public:
133 : SwTableColumnPage( Window* pParent, const SfxItemSet& rSet );
134 : ~SwTableColumnPage();
135 :
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 );
141 :
142 : };
143 :
144 : class SwTextFlowPage : public SfxTabPage
145 : {
146 : CheckBox* m_pPgBrkCB;
147 :
148 : RadioButton* m_pPgBrkRB;
149 : RadioButton* m_pColBrkRB;
150 :
151 : RadioButton* m_pPgBrkBeforeRB;
152 : RadioButton* m_pPgBrkAfterRB;
153 :
154 : CheckBox* m_pPageCollCB;
155 : ListBox* m_pPageCollLB;
156 : FixedText* m_pPageNoFT;
157 : NumericField* m_pPageNoNF;
158 : CheckBox* m_pSplitCB;
159 : TriStateBox* m_pSplitRowCB;
160 : CheckBox* m_pKeepCB;
161 : CheckBox* m_pHeadLineCB;
162 : NumericField* m_pRepeatHeaderNF;
163 : VclContainer* m_pRepeatHeaderCombo;
164 : ListBox* m_pTextDirectionLB;
165 :
166 : ListBox* m_pVertOrientLB;
167 :
168 : SwWrtShell* pShell;
169 :
170 : sal_Bool bPageBreak;
171 : sal_Bool bHtmlMode;
172 :
173 :
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 );
181 :
182 :
183 : SwTextFlowPage( Window* pParent, const SfxItemSet& rSet );
184 : ~SwTextFlowPage();
185 :
186 : public:
187 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
188 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
189 : virtual void Reset( const SfxItemSet& rSet );
190 :
191 : void SetShell(SwWrtShell* pSh);
192 :
193 : void DisablePageBreak();
194 : };
195 :
196 : #endif
197 :
198 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|