]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/docdlg.h
small cleanup, doxygen, formatting changes
[lyx.git] / src / frontends / kde / docdlg.h
1 /**
2  * \file docdlg.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  */
8
9 #ifndef DOCDLG_H
10 #define DOCDLG_H
11
12 #include <config.h>
13 #include <gettext.h>
14
15 #include "dlg/docsettingsdlgdata.h"
16 #include "dlg/docgeometrydlgdata.h"
17 #include "dlg/doclanguagedlgdata.h"
18 #include "dlg/docextradlgdata.h"
19 #include "dlg/docbulletsdlgdata.h"
20 #include "dlg/docdlgdata.h"
21
22 #include "debug.h"
23
24 class BufferParams;
25
26 // to connect apply() and close()
27 #include "FormDocument.h"
28
29 class DocDialog : public DocDialogData {
30         Q_OBJECT
31 public:
32         DocDialog(FormDocument * form, QWidget * parent=0, char const * name=0,
33                             bool modal=false, WFlags f=0);
34         ~DocDialog();
35
36         /**
37          * \fn setReadOnly
38          * \brief set widgets read only status appropriately
39          */
40         void setReadOnly(bool readonly);
41
42         /**
43          * \fn setFromParams
44          * \brief set dialog widgets from buffer parameters
45          */
46         void setFromParams(BufferParams const & params);
47
48         /**
49          * \fn updateParams
50          * \brief update the given params object based on the dialog widgets
51          *
52          * This will update the params object. It returns true if a redo
53          * of the related buffer is necessary
54          */
55         bool updateParams(BufferParams & params) const;
56         
57         /**
58          * \fn updateParams
59          * \brief update the given params object based on the dialog widgets
60          *
61          * This will update the params object. It returns true if a redo
62          * of the related buffer is necessary
63          */
64         bool updateParams(BufferParams & params);
65
66 protected:
67         void closeEvent(QCloseEvent *e);
68
69 private:
70         /// for generating the float placement string
71         string DocDialog::placementString(QComboBox * box) const;
72
73         /// the form
74         FormDocument * form_;
75
76         /// the settings page
77         DocSettingsDialogData * settings;
78         /// the geometry page
79         DocGeometryDialogData * geometry;
80         /// the language page
81         DocLanguageDialogData * language;
82         /// the extra page
83         DocExtraDialogData * extra;
84         /// the bullets page
85         DocBulletsDialogData * bullets;
86
87 private slots:
88
89         void paraspacingChanged(const char * sel);
90
91         void linespacingChanged(const char * sel);
92
93         void addspaceChanged(bool on);
94  
95         void ok_adaptor(void) {
96                 apply_adaptor();
97                 form_->close();
98                 hide();
99         }
100
101         void apply_adaptor(void) {
102                 form_->apply();
103         }
104
105         void restore_adaptor(void) {
106                 // this will reset to known values
107                 form_->update();
108         }
109         
110         void cancel_adaptor(void) {
111                 form_->close();
112                 hide();
113         }
114
115 };
116
117 #endif // DOCDLG_H