2 * \file QDocumentDialog.C
3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
11 #include "QDocumentDialog.h"
13 #include "QDocument.h"
15 #include <qlineedit.h>
16 #include <qcheckbox.h>
17 #include <qtoolbutton.h>
18 #include <qbuttongroup.h>
19 #include <qcombobox.h>
22 QDocumentDialog::QDocumentDialog(QDocument * form, QWidget * parent, const char * name, bool modal, WFlags fl)
23 : QDocumentDialogBase(parent, name, modal, fl),
27 // Copy the pointers to the bullet buttons into an array so that
28 // they can all be manipulated together.
29 bulletbuttons[0] = bullet00PB;
30 bulletbuttons[1] = bullet01PB;
31 bulletbuttons[2] = bullet02PB;
32 bulletbuttons[3] = bullet03PB;
33 bulletbuttons[4] = bullet04PB;
34 bulletbuttons[5] = bullet05PB;
35 bulletbuttons[6] = bullet10PB;
36 bulletbuttons[7] = bullet11PB;
37 bulletbuttons[8] = bullet12PB;
38 bulletbuttons[9] = bullet13PB;
39 bulletbuttons[10] = bullet14PB;
40 bulletbuttons[11] = bullet15PB;
41 bulletbuttons[12] = bullet20PB;
42 bulletbuttons[13] = bullet21PB;
43 bulletbuttons[14] = bullet22PB;
44 bulletbuttons[15] = bullet23PB;
45 bulletbuttons[16] = bullet24PB;
46 bulletbuttons[17] = bullet25PB;
47 bulletbuttons[18] = bullet30PB;
48 bulletbuttons[19] = bullet31PB;
49 bulletbuttons[20] = bullet32PB;
50 bulletbuttons[21] = bullet33PB;
51 bulletbuttons[22] = bullet34PB;
52 bulletbuttons[23] = bullet35PB;
53 bulletbuttons[24] = bullet40PB;
54 bulletbuttons[25] = bullet41PB;
55 bulletbuttons[26] = bullet42PB;
56 bulletbuttons[27] = bullet43PB;
57 bulletbuttons[28] = bullet44PB;
58 bulletbuttons[29] = bullet45PB;
59 bulletbuttons[30] = bullet50PB;
60 bulletbuttons[31] = bullet51PB;
61 bulletbuttons[32] = bullet52PB;
62 bulletbuttons[33] = bullet53PB;
63 bulletbuttons[34] = bullet54PB;
64 bulletbuttons[35] = bullet55PB;
69 QDocumentDialog::~QDocumentDialog()
75 void QDocumentDialog::slotApply()
78 // PENDING(kalle) Check whether we need this
79 // form->bc_->apply();
83 void QDocumentDialog::slotAMSMath(bool)
85 form->checkDocumentInput( amsMathCB );
89 void QDocumentDialog::slotBulletDepth1()
91 form->bulletDepth( 0 );
95 void QDocumentDialog::slotBulletDepth2()
97 form->bulletDepth( 1 );
101 void QDocumentDialog::slotBulletDepth3()
103 form->bulletDepth( 2 );
107 void QDocumentDialog::slotBulletDepth4()
109 form->bulletDepth( 3 );
113 void QDocumentDialog::slotBulletDing1()
115 qDebug( "QDocumentDialog::slotBulletDing1()" );
116 form->checkDocumentInput( bulletDing1PB );
117 form->setBulletPics();
118 bulletStandardPB->setOn( false );
119 bulletMathsPB->setOn( false );
120 bulletDing2PB->setOn( false );
121 bulletDing3PB->setOn( false );
122 bulletDing4PB->setOn( false );
126 void QDocumentDialog::slotBulletDing2()
128 form->checkDocumentInput( bulletDing2PB );
129 form->setBulletPics();
130 bulletStandardPB->setOn( false );
131 bulletMathsPB->setOn( false );
132 bulletDing1PB->setOn( false );
133 bulletDing3PB->setOn( false );
134 bulletDing4PB->setOn( false );
138 void QDocumentDialog::slotBulletDing3()
140 form->checkDocumentInput( bulletDing3PB );
141 form->setBulletPics();
142 bulletStandardPB->setOn( false );
143 bulletMathsPB->setOn( false );
144 bulletDing2PB->setOn( false );
145 bulletDing1PB->setOn( false );
146 bulletDing4PB->setOn( false );
150 void QDocumentDialog::slotBulletDing4()
152 form->checkDocumentInput( bulletDing4PB );
153 form->setBulletPics();
154 bulletStandardPB->setOn( false );
155 bulletMathsPB->setOn( false );
156 bulletDing2PB->setOn( false );
157 bulletDing3PB->setOn( false );
158 bulletDing1PB->setOn( false );
162 void QDocumentDialog::slotBulletMaths()
164 form->checkDocumentInput( bulletMathsPB );
165 form->setBulletPics();
166 bulletStandardPB->setOn( false );
167 bulletDing1PB->setOn( false );
168 bulletDing2PB->setOn( false );
169 bulletDing3PB->setOn( false );
170 bulletDing4PB->setOn( false );
174 void QDocumentDialog::slotBulletSize(int)
176 form->choiceBulletSize();
177 form->checkDocumentInput( bulletSizeCO );
181 void QDocumentDialog::slotBulletStandard()
183 form->checkDocumentInput( bulletStandardPB );
184 form->setBulletPics();
185 bulletDing1PB->setOn( false );
186 bulletMathsPB->setOn( false );
187 bulletDing2PB->setOn( false );
188 bulletDing3PB->setOn( false );
189 bulletDing4PB->setOn( false );
193 void QDocumentDialog::slotBulletSymbol(int n)
195 qDebug( "QDocumentDialog::slotBulletSymbol( %d )", n );
196 for( int i = 0; i < 36; i++ )
197 bulletbuttons[i]->setOn( false );
198 bulletbuttons[n]->setOn( true );
199 form->bulletBMTable( n );
200 form->checkDocumentInput( bulletTypeBG );
204 void QDocumentDialog::slotClass(int)
206 form->checkChoiceClass( 0 );
207 form->checkDocumentInput( classesCO );
211 void QDocumentDialog::slotClose()
215 // PENDING(kalle) do something with this
216 // form->bc_->cancel();
220 void QDocumentDialog::slotColumns(int)
222 form->checkDocumentInput( columnsBG );
226 void QDocumentDialog::slotDefaultSkip(const QString&)
228 form->checkDocumentInput( defaultSkipED );
232 void QDocumentDialog::slotDefaultSkip(int)
234 form->checkChoiceClass( defaultSkipCO );
235 form->checkDocumentInput( defaultSkipCO );
239 void QDocumentDialog::slotEncoding(int)
241 form->checkChoiceClass( encodingCO );
242 form->checkDocumentInput( encodingCO );
246 void QDocumentDialog::slotExtraOptions(const QString&)
248 form->checkDocumentInput( extraOptionsED );
252 void QDocumentDialog::slotFloatPlacement(const QString&)
254 form->checkDocumentInput( floatPlacementED );
258 void QDocumentDialog::slotFont(int)
260 form->checkChoiceClass( fontsCO );
261 form->checkDocumentInput( fontsCO );
265 void QDocumentDialog::slotFontSize(int)
267 form->checkChoiceClass( fontSizeCO );
268 form->checkDocumentInput( fontSizeCO );
272 void QDocumentDialog::slotFootskip(const QString&)
274 form->checkDocumentInput( footskipED );
278 void QDocumentDialog::slotHeadheight(const QString&)
280 form->checkDocumentInput( headheightED );
284 void QDocumentDialog::slotHeadsep(const QString&)
286 form->checkDocumentInput( headsepED );
290 void QDocumentDialog::slotHeight(const QString&)
292 form->checkDocumentInput( customHeightED );
296 void QDocumentDialog::slotLanguage(int)
298 form->checkChoiceClass( languageCO );
299 form->checkDocumentInput( languageCO );
303 void QDocumentDialog::slotBulletLaTeX(const QString&)
305 form->inputBulletLaTeX();
306 form->checkDocumentInput( latexED );
310 void QDocumentDialog::slotMarginBottom(const QString&)
312 form->checkDocumentInput( marginBottomED );
316 void QDocumentDialog::slotMarginLeft(const QString&)
318 form->checkDocumentInput( marginLeftED );
322 void QDocumentDialog::slotMarginRight(const QString&)
324 form->checkDocumentInput( marginRightED );
328 void QDocumentDialog::slotMarginTop(const QString&)
330 form->checkDocumentInput( marginTopED );
334 void QDocumentDialog::slotOK()
338 // PENDING(kalle) Do something about this.
343 void QDocumentDialog::slotOrientation(int)
345 form->checkDocumentInput( orientationBG );
349 void QDocumentDialog::slotPSDriver(int)
351 form->checkChoiceClass( psDriverCO );
352 form->checkDocumentInput( psDriverCO );
356 void QDocumentDialog::slotPageStyle(int)
358 form->checkChoiceClass( pagestyleCO );
359 form->checkDocumentInput( pagestyleCO );
363 void QDocumentDialog::slotPapersize(int)
365 form->checkChoiceClass( pagestyleCO );
366 form->checkDocumentInput( papersizeCO );
370 void QDocumentDialog::slotQuoteStyle(int)
372 form->checkChoiceClass( quoteStyleTypeCO );
373 form->checkDocumentInput( quoteStyleTypeCO );
377 void QDocumentDialog::slotQuoteType(int)
379 // Intentionally left blank
383 void QDocumentDialog::slotRestore()
386 // PENDING(kalle) Do something about this.
387 // form->bc_->updateAll();
391 void QDocumentDialog::slotSectionNumberDepth(int)
393 form->checkDocumentInput( sectionNumberDepthSB );
397 void QDocumentDialog::slotSeparation(int)
399 form->checkDocumentInput( separationBG );
403 void QDocumentDialog::slotSides(int)
405 form->checkDocumentInput( sidesBG );
409 void QDocumentDialog::slotSpacing(const QString&)
411 form->checkDocumentInput( spacingED );
415 void QDocumentDialog::slotSpacing(int)
417 form->checkDocumentInput( spacingCO );
418 form->checkDocumentInput( spacingCO );
422 void QDocumentDialog::slotSpecialPaperPackage(int)
424 form->checkChoiceClass( specialCO );
425 form->checkDocumentInput( specialCO );
429 void QDocumentDialog::slotTOCDepth(int)
431 form->checkDocumentInput( tocDepthSB );
435 void QDocumentDialog::slotUseGeometryPackage(bool)
437 form->checkDocumentInput( CheckBox1 );
441 void QDocumentDialog::slotWidth(const QString&)
443 form->checkDocumentInput( customWidthED );
448 void QDocumentDialog::closeEvent( QCloseEvent* e )
451 //PENDING(kalle) Do something about this.
452 // form->bc_->hide();