]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/docdlg.h
Move LaTeX and VC logs to GUI-I on xforms
[lyx.git] / src / frontends / kde / docdlg.h
1 /*
2  * docdlg.h
3  * (C) 2001 LyX Team
4  * John Levon, moz@compsoc.man.ac.uk
5  */
6
7 /***************************************************************************
8  *                                                                         *
9  *   This program is free software; you can redistribute it and/or modify  *
10  *   it under the terms of the GNU General Public License as published by  *
11  *   the Free Software Foundation; either version 2 of the License, or     *
12  *   (at your option) any later version.                                   *
13  *                                                                         *
14  ***************************************************************************/
15
16 #ifndef DOCDLG_H
17 #define DOCDLG_H
18
19 #include <config.h>
20 #include <gettext.h>
21 #include <string>
22
23 #include "dlg/docsettingsdlgdata.h"
24 #include "dlg/docgeometrydlgdata.h"
25 #include "dlg/doclanguagedlgdata.h"
26 #include "dlg/docextradlgdata.h"
27 #include "dlg/docbulletsdlgdata.h"
28 #include "dlg/docdlgdata.h"
29  
30 #include "debug.h" 
31
32 class BufferParams;
33
34 // to connect apply() and close()
35 #include "FormDocument.h"
36
37 class DocDialog : public DocDialogData  {
38    Q_OBJECT
39 public:
40         DocDialog(FormDocument *form, QWidget *parent=0, const char *name=0,
41                             bool modal=false, WFlags f=0);
42         ~DocDialog();
43
44         /** 
45          * \fn setReadOnly
46          * \brief set widgets read only status appropriately
47          */
48         void setReadOnly(bool readonly);
49
50         /**
51          * \fn setFromParams
52          * \brief set dialog widgets from buffer parameters
53          */
54         void setFromParams(BufferParams const & params);
55
56         /**
57          * \fn updateParams
58          * \brief update the given params object based on the dialog widgets
59          *
60          * This will update the params object. It returns true if a redo
61          * of the related buffer is necessary
62          */
63         bool updateParams(BufferParams & params) const;
64         
65         /**
66          * \fn updateParams
67          * \brief update the given params object based on the dialog widgets
68          *
69          * This will update the params object. It returns true if a redo
70          * of the related buffer is necessary
71          */
72         bool updateParams(BufferParams & params);
73
74 protected:
75         void closeEvent(QCloseEvent *e);
76  
77 private:
78         /// the form
79         FormDocument *form_;
80
81         /// the settings page
82         DocSettingsDialogData *settings; 
83         /// the geometry page
84         DocGeometryDialogData *geometry;
85         /// the language page
86         DocLanguageDialogData *language;
87         /// the extra page
88         DocExtraDialogData *extra;
89         /// the bullets page
90         DocBulletsDialogData *bullets;
91
92 private slots:
93
94         void skipspacingChanged(const char *sel);
95
96         void linespacingChanged(const char *sel);
97
98         void ok_adaptor(void) {
99                 apply_adaptor();
100                 form_->close();
101                 hide();
102         }
103
104         void apply_adaptor(void) {
105                 form_->apply();
106         }
107
108         void restore_adaptor(void) {
109                 // this will reset to known values
110                 form_->update();
111         }
112         
113         void cancel_adaptor(void) {
114                 form_->close();
115                 hide();
116         }
117
118 };
119
120 #endif