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 INCLUDED_SW_SOURCE_UI_TABLE_TABLEPG_HXX
20 : #define INCLUDED_SW_SOURCE_UI_TABLE_TABLEPG_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 : PercentField 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 : PercentField m_aLeftMF;
54 : FixedText* m_pRightFT;
55 : PercentField 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 bool FillItemSet( SfxItemSet& rSet ) SAL_OVERRIDE;
87 : virtual void Reset( const SfxItemSet& rSet ) SAL_OVERRIDE;
88 : virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
89 : virtual int DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
90 : };
91 :
92 : // TabPage Format/Table/Columns
93 : #define MET_FIELDS 6 //Number of the used MetricFields
94 :
95 : class SwTableColumnPage : public SfxTabPage
96 : {
97 : CheckBox* m_pModifyTableCB;
98 : CheckBox* m_pProportionalCB;
99 : FixedText* m_pSpaceFT;
100 : MetricField* m_pSpaceED;
101 : PushButton* m_pUpBtn;
102 : PushButton* m_pDownBtn;
103 :
104 : SwTableRep* pTblData;
105 : PercentField m_aFieldArr[MET_FIELDS];
106 : FixedText* m_pTextArr[MET_FIELDS];
107 : SwTwips nTableWidth;
108 : SwTwips nMinWidth;
109 : sal_uInt16 nNoOfCols;
110 : sal_uInt16 nNoOfVisibleCols;
111 : // Remember the width, when switching to autoalign
112 : sal_uInt16 aValueTbl[MET_FIELDS];// primary assignment of the MetricFields
113 : sal_Bool bModified:1;
114 : sal_Bool bModifyTbl:1;
115 : sal_Bool bPercentMode:1;
116 :
117 : void Init(sal_Bool bWeb);
118 : DECL_LINK( AutoClickHdl, CheckBox * );
119 : void ModifyHdl( MetricField* pEdit );
120 : DECL_LINK( UpHdl, MetricField * );
121 : DECL_LINK( DownHdl, MetricField * );
122 : DECL_LINK( LoseFocusHdl, MetricField * );
123 : DECL_LINK( ModeHdl, CheckBox * );
124 : void UpdateCols( sal_uInt16 nAktPos );
125 : SwTwips GetVisibleWidth(sal_uInt16 nPos);
126 : void SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth);
127 :
128 : using TabPage::ActivatePage;
129 : using TabPage::DeactivatePage;
130 :
131 : public:
132 : SwTableColumnPage( Window* pParent, const SfxItemSet& rSet );
133 : virtual ~SwTableColumnPage();
134 :
135 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
136 : virtual bool FillItemSet( SfxItemSet& rSet ) SAL_OVERRIDE;
137 : virtual void Reset( const SfxItemSet& rSet ) SAL_OVERRIDE;
138 : virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
139 : virtual int DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
140 :
141 : };
142 :
143 : class SwTextFlowPage : public SfxTabPage
144 : {
145 : CheckBox* m_pPgBrkCB;
146 :
147 : RadioButton* m_pPgBrkRB;
148 : RadioButton* m_pColBrkRB;
149 :
150 : RadioButton* m_pPgBrkBeforeRB;
151 : RadioButton* m_pPgBrkAfterRB;
152 :
153 : CheckBox* m_pPageCollCB;
154 : ListBox* m_pPageCollLB;
155 : FixedText* m_pPageNoFT;
156 : NumericField* m_pPageNoNF;
157 : CheckBox* m_pSplitCB;
158 : TriStateBox* m_pSplitRowCB;
159 : CheckBox* m_pKeepCB;
160 : CheckBox* m_pHeadLineCB;
161 : NumericField* m_pRepeatHeaderNF;
162 : VclContainer* m_pRepeatHeaderCombo;
163 : ListBox* m_pTextDirectionLB;
164 :
165 : ListBox* m_pVertOrientLB;
166 :
167 : SwWrtShell* pShell;
168 :
169 : sal_Bool bPageBreak;
170 : sal_Bool bHtmlMode;
171 :
172 : DECL_LINK(PageBreakHdl_Impl, void *);
173 : DECL_LINK(ApplyCollClickHdl_Impl, void *);
174 : DECL_LINK( PageBreakPosHdl_Impl, RadioButton* );
175 : DECL_LINK( PageBreakTypeHdl_Impl, RadioButton* );
176 : DECL_LINK( SplitHdl_Impl, CheckBox* );
177 : DECL_LINK( SplitRowHdl_Impl, TriStateBox* );
178 : DECL_LINK( HeadLineCBClickHdl, void* p = 0 );
179 :
180 : SwTextFlowPage( Window* pParent, const SfxItemSet& rSet );
181 : virtual ~SwTextFlowPage();
182 :
183 : public:
184 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet);
185 : virtual bool FillItemSet( SfxItemSet& rSet ) SAL_OVERRIDE;
186 : virtual void Reset( const SfxItemSet& rSet ) SAL_OVERRIDE;
187 :
188 : void SetShell(SwWrtShell* pSh);
189 :
190 : void DisablePageBreak();
191 : };
192 :
193 : #endif
194 :
195 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|