Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _OPTPAGE_HXX
29 : : #define _OPTPAGE_HXX
30 : : #include <sfx2/tabdlg.hxx>
31 : :
32 : : #include <vcl/group.hxx>
33 : :
34 : : #include <vcl/button.hxx>
35 : :
36 : : #include <vcl/lstbox.hxx>
37 : :
38 : : #include <vcl/field.hxx>
39 : :
40 : : #include <vcl/fixed.hxx>
41 : : #include <svtools/ctrlbox.hxx>
42 : : #include <svx/fntctrl.hxx>
43 : : #include <fontcfg.hxx>
44 : : class SfxPrinter;
45 : : class SwStdFontConfig;
46 : : class SwWrtShell;
47 : : class FontList;
48 : :
49 : : class SwContentOptPage : public SfxTabPage
50 : : {
51 : : //visual aids
52 : : FixedLine aLineFL;
53 : : CheckBox aCrossCB;
54 : :
55 : : //view
56 : : FixedLine aWindowFL;
57 : : CheckBox aHScrollBox;
58 : : CheckBox aVScrollBox;
59 : : CheckBox aAnyRulerCB;
60 : : CheckBox aHRulerCBox;
61 : : ListBox aHMetric;
62 : : CheckBox aVRulerCBox;
63 : : CheckBox aVRulerRightCBox;
64 : : ListBox aVMetric;
65 : : CheckBox aSmoothCBox;
66 : :
67 : : //display
68 : : FixedLine aDispFL;
69 : : CheckBox aGrfCB;
70 : : CheckBox aTblCB;
71 : : CheckBox aDrwCB;
72 : : CheckBox aFldNameCB;
73 : : CheckBox aPostItCB;
74 : :
75 : : FixedLine aSettingsFL;
76 : : FixedText aMetricFT;
77 : : ListBox aMetricLB;
78 : :
79 : : DECL_LINK(VertRulerHdl, CheckBox*);
80 : : DECL_LINK(AnyRulerHdl, CheckBox*);
81 : : public:
82 : : SwContentOptPage( Window* pParent,
83 : : const SfxItemSet& rSet );
84 : : ~SwContentOptPage();
85 : :
86 : : static SfxTabPage* Create( Window* pParent,
87 : : const SfxItemSet& rAttrSet);
88 : :
89 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
90 : : virtual void Reset( const SfxItemSet& rSet );
91 : :
92 : : };
93 : :
94 : : /*--------------------------------------------------------
95 : : TabPage printer settings additions
96 : : --------------------------------------------------------- */
97 : 0 : class SwAddPrinterTabPage : public SfxTabPage
98 : : {
99 : : FixedLine aFL1;
100 : : CheckBox aGrfCB;
101 : : // CheckBox aTabCB;
102 : : // CheckBox aDrawCB;
103 : : CheckBox aCtrlFldCB;
104 : : CheckBox aBackgroundCB;
105 : : CheckBox aBlackFontCB;
106 : : CheckBox aPrintHiddenTextCB;
107 : : CheckBox aPrintTextPlaceholderCB;
108 : :
109 : : FixedLine aSeparatorLFL;
110 : :
111 : : FixedLine aFL2;
112 : : CheckBox aLeftPageCB;
113 : : CheckBox aRightPageCB;
114 : : // CheckBox aReverseCB;
115 : : CheckBox aProspectCB;
116 : : CheckBox aProspectCB_RTL;
117 : :
118 : : FixedLine aSeparatorRFL;
119 : :
120 : : FixedLine aFL3;
121 : : RadioButton aNoRB;
122 : : RadioButton aOnlyRB;
123 : : RadioButton aEndRB;
124 : : RadioButton aEndPageRB;
125 : : FixedLine aFL4;
126 : : CheckBox aPrintEmptyPagesCB;
127 : : // CheckBox aSingleJobsCB;
128 : : CheckBox aPaperFromSetupCB;
129 : : FixedText aFaxFT;
130 : : ListBox aFaxLB;
131 : : String sNone;
132 : :
133 : : sal_Bool bAttrModified;
134 : : sal_Bool bPreview;
135 : :
136 : : void Init();
137 : : DECL_LINK(AutoClickHdl, void *);
138 : : DECL_LINK(SelectHdl, void *);
139 : :
140 : :
141 : : SwAddPrinterTabPage( Window* pParent,
142 : : const SfxItemSet& rSet );
143 : : public:
144 : :
145 : : static SfxTabPage* Create( Window* pParent,
146 : : const SfxItemSet& rAttrSet );
147 : :
148 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
149 : : virtual void Reset( const SfxItemSet& rSet );
150 : : void SetFax( const std::vector<String>& );
151 : : void SelectFax( const String& );
152 : : void SetPreview(sal_Bool bPrev);
153 : : virtual void PageCreated (SfxAllItemSet aSet);
154 : :
155 : : };
156 : :
157 : : class SwStdFontTabPage : public SfxTabPage
158 : : {
159 : : FixedLine aStdChrFL ;
160 : :
161 : : FixedText aTypeFT;
162 : :
163 : : FixedText aStandardLbl;
164 : : ComboBox aStandardBox;
165 : :
166 : : FixedText aHeightFT;
167 : : FontSizeBox aStandardHeightLB;
168 : :
169 : : FixedText aTitleLbl ;
170 : : ComboBox aTitleBox ;
171 : : FontSizeBox aTitleHeightLB;
172 : :
173 : : FixedText aListLbl ;
174 : : ComboBox aListBox ;
175 : : FontSizeBox aListHeightLB;
176 : :
177 : : FixedText aLabelLbl ;
178 : : ComboBox aLabelBox ;
179 : : FontSizeBox aLabelHeightLB;
180 : :
181 : : FixedText aIdxLbl ;
182 : : ComboBox aIdxBox ;
183 : : FontSizeBox aIndexHeightLB;
184 : :
185 : : CheckBox aDocOnlyCB ;
186 : : PushButton aStandardPB;
187 : :
188 : : String sShellStd;
189 : : String sShellTitle;
190 : : String sShellList;
191 : : String sShellLabel;
192 : : String sShellIndex;
193 : :
194 : : SfxPrinter* pPrt;
195 : : FontList* pFontList;
196 : : SwStdFontConfig* pFontConfig;
197 : : SwWrtShell* pWrtShell;
198 : : LanguageType eLanguage;
199 : : // only defaults were there? they were signed with the boxes
200 : : sal_Bool bListDefault :1;
201 : : sal_Bool bSetListDefault :1;
202 : : sal_Bool bLabelDefault :1;
203 : : sal_Bool bSetLabelDefault :1;
204 : : sal_Bool bIdxDefault :1;
205 : : sal_Bool bSetIdxDefault :1;
206 : : sal_Bool bDeletePrinter :1;
207 : :
208 : : sal_Bool bListHeightDefault :1;
209 : : sal_Bool bSetListHeightDefault :1;
210 : : sal_Bool bLabelHeightDefault :1;
211 : : sal_Bool bSetLabelHeightDefault :1;
212 : : sal_Bool bIndexHeightDefault :1;
213 : : sal_Bool bSetIndexHeightDefault :1;
214 : :
215 : : sal_uInt8 nFontGroup; //fontcfg.hxx: FONT_GROUP_[STANDARD|CJK|CTL]
216 : :
217 : : String sScriptWestern;
218 : : String sScriptAsian;
219 : : String sScriptComplex;
220 : :
221 : : DECL_LINK(StandardHdl, void *);
222 : : DECL_LINK( ModifyHdl, ComboBox * );
223 : : DECL_LINK( ModifyHeightHdl, FontSizeBox * );
224 : : DECL_LINK( LoseFocusHdl, ComboBox * );
225 : :
226 : : SwStdFontTabPage( Window* pParent,
227 : : const SfxItemSet& rSet );
228 : : ~SwStdFontTabPage();
229 : :
230 : : public:
231 : : static SfxTabPage* Create( Window* pParent,
232 : : const SfxItemSet& rAttrSet );
233 : :
234 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
235 : : virtual void Reset( const SfxItemSet& rSet );
236 : :
237 : 0 : void SetFontMode(sal_uInt8 nGroup) {nFontGroup = nGroup;}
238 : : virtual void PageCreated (SfxAllItemSet aSet);
239 : : };
240 : :
241 : : class SwTableOptionsTabPage : public SfxTabPage
242 : : {
243 : : FixedLine aTableFL;
244 : : CheckBox aHeaderCB;
245 : : CheckBox aRepeatHeaderCB;
246 : : CheckBox aDontSplitCB;
247 : : CheckBox aBorderCB;
248 : :
249 : : FixedLine aSeparatorFL;
250 : :
251 : : FixedLine aTableInsertFL;
252 : : CheckBox aNumFormattingCB;
253 : : CheckBox aNumFmtFormattingCB;
254 : : CheckBox aNumAlignmentCB;
255 : :
256 : : FixedLine aMoveFL;
257 : : FixedText aMoveFT;
258 : : FixedText aRowMoveFT;
259 : : MetricField aRowMoveMF;
260 : : FixedText aColMoveFT;
261 : : MetricField aColMoveMF;
262 : :
263 : : FixedText aInsertFT;
264 : : FixedText aRowInsertFT;
265 : : MetricField aRowInsertMF;
266 : : FixedText aColInsertFT;
267 : : MetricField aColInsertMF;
268 : :
269 : : FixedText aHandlingFT;
270 : : RadioButton aFixRB;
271 : : RadioButton aFixPropRB;
272 : : RadioButton aVarRB;
273 : : FixedText aFixFT;
274 : : FixedText aFixPropFT;
275 : : FixedText aVarFT;
276 : :
277 : : SwWrtShell* pWrtShell;
278 : : sal_Bool bHTMLMode;
279 : :
280 : : DECL_LINK(CheckBoxHdl, void *);
281 : :
282 : :
283 : : SwTableOptionsTabPage( Window* pParent,
284 : : const SfxItemSet& rSet );
285 : : ~SwTableOptionsTabPage();
286 : :
287 : : public:
288 : :
289 : : static SfxTabPage* Create( Window* pParent,
290 : : const SfxItemSet& rAttrSet );
291 : :
292 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
293 : : virtual void Reset( const SfxItemSet& rSet );
294 : :
295 : 0 : void SetWrtShell(SwWrtShell* pSh) {pWrtShell = pSh;}
296 : : virtual void PageCreated (SfxAllItemSet aSet);
297 : :
298 : : };
299 : :
300 : : /*--------------------------------------------------
301 : : TabPage for ShadowCrsr
302 : : --------------------------------------------------*/
303 : : class SwShdwCrsrOptionsTabPage : public SfxTabPage
304 : : {
305 : : //nonprinting characters
306 : : FixedLine aUnprintFL;
307 : : CheckBox aParaCB;
308 : : CheckBox aSHyphCB;
309 : : CheckBox aSpacesCB;
310 : : CheckBox aHSpacesCB;
311 : : CheckBox aTabCB;
312 : : CheckBox aBreakCB;
313 : : CheckBox aCharHiddenCB;
314 : : CheckBox aFldHiddenCB;
315 : : CheckBox aFldHiddenParaCB;
316 : :
317 : : FixedLine aSeparatorFL;
318 : :
319 : : FixedLine aFlagFL;
320 : : CheckBox aOnOffCB;
321 : :
322 : : FixedText aFillModeFT;
323 : : RadioButton aFillMarginRB;
324 : : RadioButton aFillIndentRB;
325 : : RadioButton aFillTabRB;
326 : : RadioButton aFillSpaceRB;
327 : :
328 : : FixedLine aCrsrOptFL;
329 : : CheckBox aCrsrInProtCB;
330 : :
331 : : FixedLine m_aLayoutOptionsFL;
332 : : CheckBox m_aMathBaselineAlignmentCB;
333 : :
334 : : SwWrtShell * m_pWrtShell;
335 : :
336 : :
337 : : SwShdwCrsrOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
338 : : ~SwShdwCrsrOptionsTabPage();
339 : :
340 : : public:
341 : :
342 : : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
343 : :
344 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
345 : : virtual void Reset( const SfxItemSet& rSet );
346 : :
347 : 0 : void SetWrtShell( SwWrtShell * pSh ) { m_pWrtShell = pSh; }
348 : : virtual void PageCreated( SfxAllItemSet aSet );
349 : : };
350 : :
351 : : /*-----------------------------------------------------------------------
352 : : Description: mark preview
353 : : -----------------------------------------------------------------------*/
354 : : class SwMarkPreview : public Window
355 : : {
356 : : Color m_aBgCol; // background
357 : : Color m_aTransCol; // transparency
358 : : Color m_aMarkCol; // marks
359 : : Color m_aLineCol; // general lines
360 : : Color m_aShadowCol; // shadow
361 : : Color m_aTxtCol; // text
362 : : Color m_aPrintAreaCol; // frame for print area
363 : :
364 : : Rectangle aPage;
365 : : Rectangle aLeftPagePrtArea;
366 : : Rectangle aRightPagePrtArea;
367 : :
368 : : sal_uInt16 nMarkPos;
369 : :
370 : : using OutputDevice::DrawRect;
371 : : void DrawRect(const Rectangle &rRect, const Color &rFillColor, const Color &rLineColor);
372 : :
373 : : void Paint(const Rectangle&);
374 : : void PaintPage(const Rectangle &rRect);
375 : : void InitColors( void );
376 : :
377 : : protected:
378 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
379 : :
380 : : public:
381 : : SwMarkPreview(Window* pParent, const ResId& rResID);
382 : : virtual ~SwMarkPreview();
383 : :
384 : 0 : inline void SetColor(const Color& rCol) { m_aMarkCol = rCol; }
385 : 0 : inline void SetMarkPos(sal_uInt16 nPos) { nMarkPos = nPos; }
386 : : };
387 : :
388 : : /*-----------------------------------------------------------------------
389 : : Description: redlining options
390 : : -----------------------------------------------------------------------*/
391 : : class SwRedlineOptionsTabPage : public SfxTabPage
392 : : {
393 : : FixedLine aInsertFL;
394 : :
395 : : FixedText aInsertFT;
396 : : FixedText aInsertAttrFT;
397 : : ListBox aInsertLB;
398 : : FixedText aInsertColorFT;
399 : : ColorListBox aInsertColorLB;
400 : : SvxFontPrevWindow aInsertedPreviewWN;
401 : :
402 : : FixedText aDeletedFT;
403 : : FixedText aDeletedAttrFT;
404 : : ListBox aDeletedLB;
405 : : FixedText aDeletedColorFT;
406 : : ColorListBox aDeletedColorLB;
407 : : SvxFontPrevWindow aDeletedPreviewWN;
408 : :
409 : : FixedText aChangedFT;
410 : : FixedText aChangedAttrFT;
411 : : ListBox aChangedLB;
412 : : FixedText aChangedColorFT;
413 : : ColorListBox aChangedColorLB;
414 : : SvxFontPrevWindow aChangedPreviewWN;
415 : :
416 : : FixedLine aChangedFL;
417 : :
418 : : FixedText aMarkPosFT;
419 : : ListBox aMarkPosLB;
420 : : FixedText aMarkColorFT;
421 : : ColorListBox aMarkColorLB;
422 : : SwMarkPreview aMarkPreviewWN;
423 : :
424 : : String sAuthor;
425 : : String sNone;
426 : :
427 : : SwRedlineOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
428 : : ~SwRedlineOptionsTabPage();
429 : :
430 : : DECL_LINK( AttribHdl, ListBox *pLB );
431 : : DECL_LINK(ChangedMaskPrevHdl, void * = 0);
432 : : DECL_LINK( ColorHdl, ColorListBox *pColorLB );
433 : :
434 : : void InitFontStyle(SvxFontPrevWindow& rExampleWin);
435 : :
436 : : public:
437 : :
438 : : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
439 : :
440 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
441 : : virtual void Reset( const SfxItemSet& rSet );
442 : : };
443 : :
444 : : /*-------------------------------------------------------
445 : : TabPage test settings for SW
446 : : --------------------------------------------------------- */
447 : :
448 : : #ifdef DBG_UTIL
449 : :
450 : : class SwTestTabPage : public SfxTabPage
451 : : {
452 : : public:
453 : : SwTestTabPage( Window* pParent,
454 : : const SfxItemSet& rSet );
455 : :
456 : : static SfxTabPage* Create( Window* pParent,
457 : : const SfxItemSet& rAttrSet );
458 : :
459 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
460 : : virtual void Reset( const SfxItemSet& rSet );
461 : :
462 : : private:
463 : : FixedLine aTestFL;
464 : : CheckBox aTest1CBox;
465 : : CheckBox aTest2CBox;
466 : : CheckBox aTest3CBox;
467 : : CheckBox aTest4CBox;
468 : : CheckBox aTest5CBox;
469 : : CheckBox aTest6CBox;
470 : : CheckBox aTest7CBox;
471 : : CheckBox aTest8CBox;
472 : : CheckBox aTest9CBox;
473 : : CheckBox aTest10CBox;
474 : :
475 : : sal_Bool bAttrModified;
476 : :
477 : : void Init();
478 : : DECL_LINK(AutoClickHdl, void *);
479 : :
480 : : };
481 : : #endif // DBG_UTIL
482 : :
483 : : class SwCompareOptionsTabPage : public SfxTabPage
484 : : {
485 : : FixedLine aComparisonFL;
486 : : RadioButton aAutoRB;
487 : : RadioButton aWordRB;
488 : : RadioButton aCharRB;
489 : :
490 : : FixedLine aSettingsFL;
491 : : CheckBox aRsidCB;
492 : : CheckBox aIgnoreCB;
493 : : NumericField aLenNF;
494 : :
495 : : SwCompareOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
496 : : ~SwCompareOptionsTabPage();
497 : :
498 : : DECL_LINK(ComparisonHdl, void *);
499 : : DECL_LINK(IgnoreHdl, void *);
500 : :
501 : : public:
502 : :
503 : : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
504 : :
505 : : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
506 : : virtual void Reset( const SfxItemSet& rSet );
507 : : };
508 : :
509 : : #endif
510 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|