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 _OPTPAGE_HXX
20 : #define _OPTPAGE_HXX
21 : #include <sfx2/tabdlg.hxx>
22 :
23 : #include <vcl/group.hxx>
24 :
25 : #include <vcl/button.hxx>
26 :
27 : #include <vcl/lstbox.hxx>
28 :
29 : #include <vcl/field.hxx>
30 :
31 : #include <vcl/fixed.hxx>
32 : #include <svtools/ctrlbox.hxx>
33 : #include <svx/fntctrl.hxx>
34 : #include <fontcfg.hxx>
35 : class SfxPrinter;
36 : class SwStdFontConfig;
37 : class SwWrtShell;
38 : class FontList;
39 :
40 : /*--------------------------------------------------------
41 : Tools->Options->Writer->View
42 : Tools->Options->Writer/Web->View
43 : --------------------------------------------------------- */
44 : class SwContentOptPage : public SfxTabPage
45 : {
46 : CheckBox* m_pCrossCB;
47 :
48 : CheckBox* m_pHScrollBox;
49 : CheckBox* m_pVScrollBox;
50 : CheckBox* m_pAnyRulerCB;
51 : CheckBox* m_pHRulerCBox;
52 : ListBox* m_pHMetric;
53 : CheckBox* m_pVRulerCBox;
54 : CheckBox* m_pVRulerRightCBox;
55 : ListBox* m_pVMetric;
56 : CheckBox* m_pSmoothCBox;
57 :
58 : CheckBox* m_pGrfCB;
59 : CheckBox* m_pTblCB;
60 : CheckBox* m_pDrwCB;
61 : CheckBox* m_pFldNameCB;
62 : CheckBox* m_pPostItCB;
63 :
64 : VclFrame* m_pSettingsFrame;
65 : FixedText* m_pSettingsLabel;
66 : FixedText* m_pMetricLabel;
67 : ListBox* m_pMetricLB;
68 :
69 : DECL_LINK(VertRulerHdl, CheckBox*);
70 : DECL_LINK(AnyRulerHdl, CheckBox*);
71 : public:
72 : SwContentOptPage( Window* pParent,
73 : const SfxItemSet& rSet );
74 : ~SwContentOptPage();
75 :
76 : static SfxTabPage* Create( Window* pParent,
77 : const SfxItemSet& rAttrSet);
78 :
79 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
80 : virtual void Reset( const SfxItemSet& rSet );
81 :
82 : };
83 :
84 : /*--------------------------------------------------------
85 : TabPage printer settings additions
86 : --------------------------------------------------------- */
87 0 : class SwAddPrinterTabPage : public SfxTabPage
88 : {
89 : CheckBox* m_pGrfCB;
90 : CheckBox* m_pCtrlFldCB;
91 : CheckBox* m_pBackgroundCB;
92 : CheckBox* m_pBlackFontCB;
93 : CheckBox* m_pPrintHiddenTextCB;
94 : CheckBox* m_pPrintTextPlaceholderCB;
95 :
96 : VclFrame* m_pPagesFrame;
97 : CheckBox* m_pLeftPageCB;
98 : CheckBox* m_pRightPageCB;
99 : CheckBox* m_pProspectCB;
100 : CheckBox* m_pProspectCB_RTL;
101 :
102 : VclFrame* m_pCommentsFrame;
103 : RadioButton* m_pNoRB;
104 : RadioButton* m_pOnlyRB;
105 : RadioButton* m_pEndRB;
106 : RadioButton* m_pEndPageRB;
107 :
108 : CheckBox* m_pPrintEmptyPagesCB;
109 : CheckBox* m_pPaperFromSetupCB;
110 : ListBox* m_pFaxLB;
111 :
112 : String sNone;
113 :
114 : sal_Bool bAttrModified;
115 : sal_Bool bPreview;
116 :
117 : void Init();
118 : DECL_LINK(AutoClickHdl, void *);
119 : DECL_LINK(SelectHdl, void *);
120 :
121 :
122 : SwAddPrinterTabPage( Window* pParent,
123 : const SfxItemSet& rSet );
124 : public:
125 :
126 : static SfxTabPage* Create( Window* pParent,
127 : const SfxItemSet& rAttrSet );
128 :
129 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
130 : virtual void Reset( const SfxItemSet& rSet );
131 : void SetFax( const std::vector<String>& );
132 : void SelectFax( const String& );
133 : void SetPreview(sal_Bool bPrev);
134 : virtual void PageCreated (SfxAllItemSet aSet);
135 :
136 : };
137 :
138 : class SwStdFontTabPage : public SfxTabPage
139 : {
140 : FixedLine aStdChrFL ;
141 :
142 : FixedText aTypeFT;
143 :
144 : FixedText aStandardLbl;
145 : ComboBox aStandardBox;
146 :
147 : FixedText aHeightFT;
148 : FontSizeBox aStandardHeightLB;
149 :
150 : FixedText aTitleLbl ;
151 : ComboBox aTitleBox ;
152 : FontSizeBox aTitleHeightLB;
153 :
154 : FixedText aListLbl ;
155 : ComboBox aListBox ;
156 : FontSizeBox aListHeightLB;
157 :
158 : FixedText aLabelLbl ;
159 : ComboBox aLabelBox ;
160 : FontSizeBox aLabelHeightLB;
161 :
162 : FixedText aIdxLbl ;
163 : ComboBox aIdxBox ;
164 : FontSizeBox aIndexHeightLB;
165 :
166 : CheckBox aDocOnlyCB ;
167 : PushButton aStandardPB;
168 :
169 : String sShellStd;
170 : String sShellTitle;
171 : String sShellList;
172 : String sShellLabel;
173 : String sShellIndex;
174 :
175 : SfxPrinter* pPrt;
176 : FontList* pFontList;
177 : SwStdFontConfig* pFontConfig;
178 : SwWrtShell* pWrtShell;
179 : LanguageType eLanguage;
180 : // only defaults were there? they were signed with the boxes
181 : sal_Bool bListDefault :1;
182 : sal_Bool bSetListDefault :1;
183 : sal_Bool bLabelDefault :1;
184 : sal_Bool bSetLabelDefault :1;
185 : sal_Bool bIdxDefault :1;
186 : sal_Bool bSetIdxDefault :1;
187 : sal_Bool bDeletePrinter :1;
188 :
189 : sal_Bool bListHeightDefault :1;
190 : sal_Bool bSetListHeightDefault :1;
191 : sal_Bool bLabelHeightDefault :1;
192 : sal_Bool bSetLabelHeightDefault :1;
193 : sal_Bool bIndexHeightDefault :1;
194 : sal_Bool bSetIndexHeightDefault :1;
195 :
196 : sal_uInt8 nFontGroup; //fontcfg.hxx: FONT_GROUP_[STANDARD|CJK|CTL]
197 :
198 : String sScriptWestern;
199 : String sScriptAsian;
200 : String sScriptComplex;
201 :
202 : DECL_LINK(StandardHdl, void *);
203 : DECL_LINK( ModifyHdl, ComboBox * );
204 : DECL_LINK( ModifyHeightHdl, FontSizeBox * );
205 : DECL_LINK( LoseFocusHdl, ComboBox * );
206 :
207 : SwStdFontTabPage( Window* pParent,
208 : const SfxItemSet& rSet );
209 : ~SwStdFontTabPage();
210 :
211 : public:
212 : static SfxTabPage* Create( Window* pParent,
213 : const SfxItemSet& rAttrSet );
214 :
215 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
216 : virtual void Reset( const SfxItemSet& rSet );
217 :
218 0 : void SetFontMode(sal_uInt8 nGroup) {nFontGroup = nGroup;}
219 : virtual void PageCreated (SfxAllItemSet aSet);
220 : };
221 :
222 : class SwTableOptionsTabPage : public SfxTabPage
223 : {
224 : FixedLine aTableFL;
225 : CheckBox aHeaderCB;
226 : CheckBox aRepeatHeaderCB;
227 : CheckBox aDontSplitCB;
228 : CheckBox aBorderCB;
229 :
230 : FixedLine aSeparatorFL;
231 :
232 : FixedLine aTableInsertFL;
233 : CheckBox aNumFormattingCB;
234 : CheckBox aNumFmtFormattingCB;
235 : CheckBox aNumAlignmentCB;
236 :
237 : FixedLine aMoveFL;
238 : FixedText aMoveFT;
239 : FixedText aRowMoveFT;
240 : MetricField aRowMoveMF;
241 : FixedText aColMoveFT;
242 : MetricField aColMoveMF;
243 :
244 : FixedText aInsertFT;
245 : FixedText aRowInsertFT;
246 : MetricField aRowInsertMF;
247 : FixedText aColInsertFT;
248 : MetricField aColInsertMF;
249 :
250 : FixedText aHandlingFT;
251 : RadioButton aFixRB;
252 : RadioButton aFixPropRB;
253 : RadioButton aVarRB;
254 : FixedText aFixFT;
255 : FixedText aFixPropFT;
256 : FixedText aVarFT;
257 :
258 : SwWrtShell* pWrtShell;
259 : sal_Bool bHTMLMode;
260 :
261 : DECL_LINK(CheckBoxHdl, void *);
262 :
263 :
264 : SwTableOptionsTabPage( Window* pParent,
265 : const SfxItemSet& rSet );
266 : ~SwTableOptionsTabPage();
267 :
268 : public:
269 :
270 : static SfxTabPage* Create( Window* pParent,
271 : const SfxItemSet& rAttrSet );
272 :
273 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
274 : virtual void Reset( const SfxItemSet& rSet );
275 :
276 0 : void SetWrtShell(SwWrtShell* pSh) {pWrtShell = pSh;}
277 : virtual void PageCreated (SfxAllItemSet aSet);
278 :
279 : };
280 :
281 : /*--------------------------------------------------
282 : TabPage for ShadowCrsr
283 : --------------------------------------------------*/
284 : class SwShdwCrsrOptionsTabPage : public SfxTabPage
285 : {
286 : //nonprinting characters
287 : CheckBox* m_pParaCB;
288 : CheckBox* m_pSHyphCB;
289 : CheckBox* m_pSpacesCB;
290 : CheckBox* m_pHSpacesCB;
291 : CheckBox* m_pTabCB;
292 : CheckBox* m_pBreakCB;
293 : CheckBox* m_pCharHiddenCB;
294 : CheckBox* m_pFldHiddenCB;
295 : CheckBox* m_pFldHiddenParaCB;
296 :
297 : VclFrame* m_pDirectCursorFrame;
298 : CheckBox* m_pOnOffCB;
299 :
300 : RadioButton* m_pFillMarginRB;
301 : RadioButton* m_pFillIndentRB;
302 : RadioButton* m_pFillTabRB;
303 : RadioButton* m_pFillSpaceRB;
304 :
305 : VclFrame* m_pCursorProtFrame;
306 : CheckBox* m_pCrsrInProtCB;
307 :
308 : CheckBox* m_pMathBaselineAlignmentCB;
309 :
310 : SwWrtShell * m_pWrtShell;
311 :
312 :
313 : SwShdwCrsrOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
314 : ~SwShdwCrsrOptionsTabPage();
315 :
316 : public:
317 :
318 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
319 :
320 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
321 : virtual void Reset( const SfxItemSet& rSet );
322 :
323 0 : void SetWrtShell( SwWrtShell * pSh ) { m_pWrtShell = pSh; }
324 : virtual void PageCreated( SfxAllItemSet aSet );
325 : };
326 :
327 : /*-----------------------------------------------------------------------
328 : Description: mark preview
329 : -----------------------------------------------------------------------*/
330 : class SwMarkPreview : public Window
331 : {
332 : Color m_aBgCol; // background
333 : Color m_aTransCol; // transparency
334 : Color m_aMarkCol; // marks
335 : Color m_aLineCol; // general lines
336 : Color m_aShadowCol; // shadow
337 : Color m_aTxtCol; // text
338 : Color m_aPrintAreaCol; // frame for print area
339 :
340 : Rectangle aPage;
341 : Rectangle aLeftPagePrtArea;
342 : Rectangle aRightPagePrtArea;
343 :
344 : sal_uInt16 nMarkPos;
345 :
346 : using OutputDevice::DrawRect;
347 : void DrawRect(const Rectangle &rRect, const Color &rFillColor, const Color &rLineColor);
348 :
349 : void Paint(const Rectangle&);
350 : void PaintPage(const Rectangle &rRect);
351 : void InitColors( void );
352 :
353 : protected:
354 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
355 :
356 : public:
357 : SwMarkPreview(Window* pParent, const ResId& rResID);
358 : virtual ~SwMarkPreview();
359 :
360 0 : inline void SetColor(const Color& rCol) { m_aMarkCol = rCol; }
361 0 : inline void SetMarkPos(sal_uInt16 nPos) { nMarkPos = nPos; }
362 : };
363 :
364 : /*-----------------------------------------------------------------------
365 : Description: redlining options
366 : -----------------------------------------------------------------------*/
367 : class SwRedlineOptionsTabPage : public SfxTabPage
368 : {
369 : FixedLine aInsertFL;
370 :
371 : FixedText aInsertFT;
372 : FixedText aInsertAttrFT;
373 : ListBox aInsertLB;
374 : FixedText aInsertColorFT;
375 : ColorListBox aInsertColorLB;
376 : SvxFontPrevWindow aInsertedPreviewWN;
377 :
378 : FixedText aDeletedFT;
379 : FixedText aDeletedAttrFT;
380 : ListBox aDeletedLB;
381 : FixedText aDeletedColorFT;
382 : ColorListBox aDeletedColorLB;
383 : SvxFontPrevWindow aDeletedPreviewWN;
384 :
385 : FixedText aChangedFT;
386 : FixedText aChangedAttrFT;
387 : ListBox aChangedLB;
388 : FixedText aChangedColorFT;
389 : ColorListBox aChangedColorLB;
390 : SvxFontPrevWindow aChangedPreviewWN;
391 :
392 : FixedLine aChangedFL;
393 :
394 : FixedText aMarkPosFT;
395 : ListBox aMarkPosLB;
396 : FixedText aMarkColorFT;
397 : ColorListBox aMarkColorLB;
398 : SwMarkPreview aMarkPreviewWN;
399 :
400 : String sAuthor;
401 : String sNone;
402 :
403 : SwRedlineOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
404 : ~SwRedlineOptionsTabPage();
405 :
406 : DECL_LINK( AttribHdl, ListBox *pLB );
407 : DECL_LINK(ChangedMaskPrevHdl, void * = 0);
408 : DECL_LINK( ColorHdl, ColorListBox *pColorLB );
409 :
410 : void InitFontStyle(SvxFontPrevWindow& rExampleWin);
411 :
412 : public:
413 :
414 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
415 :
416 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
417 : virtual void Reset( const SfxItemSet& rSet );
418 : };
419 :
420 : /*-------------------------------------------------------
421 : TabPage test settings for SW
422 : --------------------------------------------------------- */
423 :
424 : #ifdef DBG_UTIL
425 :
426 : class SwTestTabPage : public SfxTabPage
427 : {
428 : public:
429 : SwTestTabPage( Window* pParent,
430 : const SfxItemSet& rSet );
431 :
432 : static SfxTabPage* Create( Window* pParent,
433 : const SfxItemSet& rAttrSet );
434 :
435 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
436 : virtual void Reset( const SfxItemSet& rSet );
437 :
438 : private:
439 : CheckBox* m_pTest1CBox;
440 : CheckBox* m_pTest2CBox;
441 : CheckBox* m_pTest3CBox;
442 : CheckBox* m_pTest4CBox;
443 : CheckBox* m_pTest5CBox;
444 : CheckBox* m_pTest6CBox;
445 : CheckBox* m_pTest7CBox;
446 : CheckBox* m_pTest8CBox;
447 : CheckBox* m_pTest9CBox;
448 : CheckBox* m_pTest10CBox;
449 :
450 : sal_Bool bAttrModified;
451 :
452 : void Init();
453 : DECL_LINK(AutoClickHdl, void *);
454 :
455 : };
456 : #endif // DBG_UTIL
457 :
458 : class SwCompareOptionsTabPage : public SfxTabPage
459 : {
460 : RadioButton* m_pAutoRB;
461 : RadioButton* m_pWordRB;
462 : RadioButton* m_pCharRB;
463 :
464 : CheckBox* m_pRsidCB;
465 : CheckBox* m_pIgnoreCB;
466 : NumericField* m_pLenNF;
467 :
468 : SwCompareOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
469 : ~SwCompareOptionsTabPage();
470 :
471 : DECL_LINK(ComparisonHdl, void *);
472 : DECL_LINK(IgnoreHdl, void *);
473 :
474 : public:
475 :
476 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
477 :
478 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
479 : virtual void Reset( const SfxItemSet& rSet );
480 : };
481 :
482 : #endif
483 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|