]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/FormDocumentDialogImpl.C
implement getLabelList
[lyx.git] / src / frontends / qt2 / FormDocumentDialogImpl.C
1 #include "FormDocumentDialog.h"
2 #include "Dialogs.h"
3 #include "FormDocument.h"
4
5 #include <qlineedit.h>
6 #include <qcheckbox.h>
7 #include <qtoolbutton.h>
8 #include <qbuttongroup.h>
9 #include <qcombobox.h>
10 #include <qspinbox.h>
11
12 /* 
13  *  Constructs a FormDocumentDialog which is a child of 'parent', with the 
14  *  name 'name' and widget flags set to 'f' 
15  *
16  *  The dialog will by default be modeless, unless you set 'modal' to
17  *  TRUE to construct a modal dialog.
18  */
19 FormDocumentDialog::FormDocumentDialog( FormDocument* _form, QWidget* parent,  const char* name, bool modal, WFlags fl )
20   : FormDocumentDialogBase( parent, name, modal, fl ),
21     form( _form )
22 {
23   // Copy the pointers to the bullet buttons into an array so that
24   // they can all be manipulated together.
25   bulletbuttons[0] = bullet00PB;
26   bulletbuttons[1] = bullet01PB;
27   bulletbuttons[2] = bullet02PB;
28   bulletbuttons[3] = bullet03PB;
29   bulletbuttons[4] = bullet04PB;
30   bulletbuttons[5] = bullet05PB;
31   bulletbuttons[6] = bullet10PB;
32   bulletbuttons[7] = bullet11PB;
33   bulletbuttons[8] = bullet12PB;
34   bulletbuttons[9] = bullet13PB;
35   bulletbuttons[10] = bullet14PB;
36   bulletbuttons[11] = bullet15PB;
37   bulletbuttons[12] = bullet20PB;
38   bulletbuttons[13] = bullet21PB;
39   bulletbuttons[14] = bullet22PB;
40   bulletbuttons[15] = bullet23PB;
41   bulletbuttons[16] = bullet24PB;
42   bulletbuttons[17] = bullet25PB;
43   bulletbuttons[18] = bullet30PB;
44   bulletbuttons[19] = bullet31PB;
45   bulletbuttons[20] = bullet32PB;
46   bulletbuttons[21] = bullet33PB;
47   bulletbuttons[22] = bullet34PB;
48   bulletbuttons[23] = bullet35PB;
49   bulletbuttons[24] = bullet40PB;
50   bulletbuttons[25] = bullet41PB;
51   bulletbuttons[26] = bullet42PB;
52   bulletbuttons[27] = bullet43PB;
53   bulletbuttons[28] = bullet44PB;
54   bulletbuttons[29] = bullet45PB;
55   bulletbuttons[30] = bullet50PB;
56   bulletbuttons[31] = bullet51PB;
57   bulletbuttons[32] = bullet52PB;
58   bulletbuttons[33] = bullet53PB;
59   bulletbuttons[34] = bullet54PB;
60   bulletbuttons[35] = bullet55PB;
61 }
62
63 /*  
64  *  Destroys the object and frees any allocated resources
65  */
66 FormDocumentDialog::~FormDocumentDialog()
67 {
68   // no need to delete child widgets, Qt does it all for us
69 }
70
71 /* 
72  * public slot
73  */
74 void FormDocumentDialog::slotApply()
75 {
76   form->apply();
77   // PENDING(kalle) Check whether we need this
78   //  form->bc_->apply();
79 }
80 /* 
81  * public slot
82  */
83 void FormDocumentDialog::slotAMSMath(bool)
84 {
85   form->checkDocumentInput( amsMathCB );
86 }
87 /* 
88  * public slot
89  */
90 void FormDocumentDialog::slotBulletDepth1()
91 {
92   form->bulletDepth( 0 );
93 }
94 /* 
95  * public slot
96  */
97 void FormDocumentDialog::slotBulletDepth2()
98 {
99   form->bulletDepth( 1 );
100 }
101 /* 
102  * public slot
103  */
104 void FormDocumentDialog::slotBulletDepth3()
105 {
106   form->bulletDepth( 2 );
107 }
108 /* 
109  * public slot
110  */
111 void FormDocumentDialog::slotBulletDepth4()
112 {
113   form->bulletDepth( 3 );
114 }
115 /* 
116  * public slot
117  */
118 void FormDocumentDialog::slotBulletDing1()
119 {
120   qDebug( "FormDocumentDialog::slotBulletDing1()" );
121   form->checkDocumentInput( bulletDing1PB );
122   form->setBulletPics();
123   bulletStandardPB->setOn( false );
124   bulletMathsPB->setOn( false );
125   bulletDing2PB->setOn( false );
126   bulletDing3PB->setOn( false );
127   bulletDing4PB->setOn( false );
128 }
129 /* 
130  * public slot
131  */
132 void FormDocumentDialog::slotBulletDing2()
133 {
134   form->checkDocumentInput( bulletDing2PB );
135   form->setBulletPics();
136   bulletStandardPB->setOn( false );
137   bulletMathsPB->setOn( false );
138   bulletDing1PB->setOn( false );
139   bulletDing3PB->setOn( false );
140   bulletDing4PB->setOn( false );
141 }
142 /* 
143  * public slot
144  */
145 void FormDocumentDialog::slotBulletDing3()
146 {
147   form->checkDocumentInput( bulletDing3PB );
148   form->setBulletPics();
149   bulletStandardPB->setOn( false );
150   bulletMathsPB->setOn( false );
151   bulletDing2PB->setOn( false );
152   bulletDing1PB->setOn( false );
153   bulletDing4PB->setOn( false );
154 }
155 /* 
156  * public slot
157  */
158 void FormDocumentDialog::slotBulletDing4()
159 {
160   form->checkDocumentInput( bulletDing4PB );
161   form->setBulletPics();
162   bulletStandardPB->setOn( false );
163   bulletMathsPB->setOn( false );
164   bulletDing2PB->setOn( false );
165   bulletDing3PB->setOn( false );
166   bulletDing1PB->setOn( false );
167 }
168 /* 
169  * public slot
170  */
171 void FormDocumentDialog::slotBulletMaths()
172 {
173   form->checkDocumentInput( bulletMathsPB );
174   form->setBulletPics();
175   bulletStandardPB->setOn( false );
176   bulletDing1PB->setOn( false );
177   bulletDing2PB->setOn( false );
178   bulletDing3PB->setOn( false );
179   bulletDing4PB->setOn( false );
180 }
181 /* 
182  * public slot
183  */
184 void FormDocumentDialog::slotBulletSize(int)
185 {
186   form->choiceBulletSize();
187   form->checkDocumentInput( bulletSizeCO );
188 }
189 /* 
190  * public slot
191  */
192 void FormDocumentDialog::slotBulletStandard()
193 {
194   form->checkDocumentInput( bulletStandardPB );
195   form->setBulletPics();
196   bulletDing1PB->setOn( false );
197   bulletMathsPB->setOn( false );
198   bulletDing2PB->setOn( false );
199   bulletDing3PB->setOn( false );
200   bulletDing4PB->setOn( false );
201 }
202 /* 
203  * public slot
204  */
205 void FormDocumentDialog::slotBulletSymbol(int n)
206 {
207   qDebug( "FormDocumentDialog::slotBulletSymbol( %d )", n );
208   for( int i = 0; i < 36; i++ )
209     bulletbuttons[i]->setOn( false );
210   bulletbuttons[n]->setOn( true );
211   form->bulletBMTable( n );
212   form->checkDocumentInput( bulletTypeBG );
213 }
214 /* 
215  * public slot
216  */
217 void FormDocumentDialog::slotClass(int)
218 {
219   form->checkChoiceClass( 0 );
220   form->checkDocumentInput( classesCO );
221 }
222 /* 
223  * public slot
224  */
225 void FormDocumentDialog::slotClose()
226 {
227   form->cancel();
228   form->hide();
229   // PENDING(kalle) do something with this
230   //  form->bc_->cancel();
231 }
232 /* 
233  * public slot
234  */
235 void FormDocumentDialog::slotColumns(int)
236 {
237   form->checkDocumentInput( columnsBG );
238 }
239 /* 
240  * public slot
241  */
242 void FormDocumentDialog::slotDefaultSkip(const QString&)
243 {
244   form->checkDocumentInput( defaultSkipED );
245 }
246 /* 
247  * public slot
248  */
249 void FormDocumentDialog::slotDefaultSkip(int)
250 {
251   form->checkChoiceClass( defaultSkipCO );
252   form->checkDocumentInput( defaultSkipCO );
253 }
254 /* 
255  * public slot
256  */
257 void FormDocumentDialog::slotEncoding(int)
258 {
259   form->checkChoiceClass( encodingCO );
260   form->checkDocumentInput( encodingCO );
261 }
262 /* 
263  * public slot
264  */
265 void FormDocumentDialog::slotExtraOptions(const QString&)
266 {
267   form->checkDocumentInput( extraOptionsED );
268 }
269 /* 
270  * public slot
271  */
272 void FormDocumentDialog::slotFloatPlacement(const QString&)
273 {
274   form->checkDocumentInput( floatPlacementED );
275 }
276 /* 
277  * public slot
278  */
279 void FormDocumentDialog::slotFont(int)
280 {
281   form->checkChoiceClass( fontsCO );
282   form->checkDocumentInput( fontsCO );
283 }
284 /* 
285  * public slot
286  */
287 void FormDocumentDialog::slotFontSize(int)
288 {
289   form->checkChoiceClass( fontSizeCO );
290   form->checkDocumentInput( fontSizeCO );
291 }
292 /* 
293  * public slot
294  */
295 void FormDocumentDialog::slotFootskip(const QString&)
296 {
297   form->checkDocumentInput( footskipED );
298 }
299 /* 
300  * public slot
301  */
302 void FormDocumentDialog::slotHeadheight(const QString&)
303 {
304   form->checkDocumentInput( headheightED );
305 }
306 /* 
307  * public slot
308  */
309 void FormDocumentDialog::slotHeadsep(const QString&)
310 {
311   form->checkDocumentInput( headsepED );
312 }
313 /* 
314  * public slot
315  */
316 void FormDocumentDialog::slotHeight(const QString&)
317 {
318   form->checkDocumentInput( customHeightED );
319 }
320 /* 
321  * public slot
322  */
323 void FormDocumentDialog::slotLanguage(int)
324 {
325   form->checkChoiceClass( languageCO );
326   form->checkDocumentInput( languageCO );
327 }
328 /* 
329  * public slot
330  */
331 void FormDocumentDialog::slotBulletLaTeX(const QString&)
332 {
333   form->inputBulletLaTeX();
334   form->checkDocumentInput( latexED );
335 }
336 /* 
337  * public slot
338  */
339 void FormDocumentDialog::slotMarginBottom(const QString&)
340 {
341   form->checkDocumentInput( marginBottomED );
342 }
343 /* 
344  * public slot
345  */
346 void FormDocumentDialog::slotMarginLeft(const QString&)
347 {
348   form->checkDocumentInput( marginLeftED );
349 }
350 /* 
351  * public slot
352  */
353 void FormDocumentDialog::slotMarginRight(const QString&)
354 {
355   form->checkDocumentInput( marginRightED );
356 }
357 /* 
358  * public slot
359  */
360 void FormDocumentDialog::slotMarginTop(const QString&)
361 {
362   form->checkDocumentInput( marginTopED );
363 }
364 /* 
365  * public slot
366  */
367 void FormDocumentDialog::slotOK()
368 {
369   form->apply();
370   form->hide();
371   // PENDING(kalle) Do something about this.
372   //  form->bc_->ok();
373 }
374 /* 
375  * public slot
376  */
377 void FormDocumentDialog::slotOrientation(int)
378 {
379   form->checkDocumentInput( orientationBG );
380 }
381 /* 
382  * public slot
383  */
384 void FormDocumentDialog::slotPSDriver(int)
385 {
386   form->checkChoiceClass( psDriverCO );
387   form->checkDocumentInput( psDriverCO );
388 }
389 /* 
390  * public slot
391  */
392 void FormDocumentDialog::slotPageStyle(int)
393 {
394   form->checkChoiceClass( pagestyleCO );
395   form->checkDocumentInput( pagestyleCO );
396 }
397 /* 
398  * public slot
399  */
400 void FormDocumentDialog::slotPapersize(int)
401 {
402   form->checkChoiceClass( pagestyleCO );
403   form->checkDocumentInput( papersizeCO );
404 }
405 /* 
406  * public slot
407  */
408 void FormDocumentDialog::slotQuoteStyle(int)
409 {
410   form->checkChoiceClass( quoteStyleTypeCO );
411   form->checkDocumentInput( quoteStyleTypeCO );
412 }
413 /* 
414  * public slot
415  */
416 void FormDocumentDialog::slotQuoteType(int)
417 {
418   // Intentionally left blank
419 }
420 /* 
421  * public slot
422  */
423 void FormDocumentDialog::slotRestore()
424 {
425   form->update();
426   // PENDING(kalle) Do something about this.
427   //  form->bc_->updateAll();
428 }
429 /* 
430  * public slot
431  */
432 void FormDocumentDialog::slotSectionNumberDepth(int)
433 {
434   form->checkDocumentInput( sectionNumberDepthSB );
435 }
436 /* 
437  * public slot
438  */
439 void FormDocumentDialog::slotSeparation(int)
440 {
441   form->checkDocumentInput( separationBG );
442 }
443 /* 
444  * public slot
445  */
446 void FormDocumentDialog::slotSides(int)
447 {
448   form->checkDocumentInput( sidesBG );
449 }
450 /* 
451  * public slot
452  */
453 void FormDocumentDialog::slotSpacing(const QString&)
454 {
455   form->checkDocumentInput( spacingED );
456 }
457 /* 
458  * public slot
459  */
460 void FormDocumentDialog::slotSpacing(int)
461 {
462   form->checkDocumentInput( spacingCO );
463   form->checkDocumentInput( spacingCO );
464 }
465 /* 
466  * public slot
467  */
468 void FormDocumentDialog::slotSpecialPaperPackage(int)
469 {
470   form->checkChoiceClass( specialCO );
471   form->checkDocumentInput( specialCO );
472 }
473 /* 
474  * public slot
475  */
476 void FormDocumentDialog::slotTOCDepth(int)
477 {
478   form->checkDocumentInput( tocDepthSB );
479 }
480 /* 
481  * public slot
482  */
483 void FormDocumentDialog::slotUseGeometryPackage(bool)
484 {
485   form->checkDocumentInput( CheckBox1 );
486 }
487 /* 
488  * public slot
489  */
490 void FormDocumentDialog::slotWidth(const QString&)
491 {
492   form->checkDocumentInput( customWidthED );
493 }
494
495
496 void FormDocumentDialog::closeEvent( QCloseEvent* e )
497 {
498   form->hide();
499   //PENDING(kalle) Do something about this.
500   //  form->bc_->hide();
501   e->accept();
502 }