]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiBox.h
2763a591c64a8b555aac0cc4a7f9b943e3cd2255
[lyx.git] / src / frontends / qt4 / GuiBox.h
1 // -*- C++ -*-
2 /**
3  * \file GuiBox.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jürgen Spitzmüller
8  * \ author Martin Vermeer
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef QBOX_H
14 #define QBOX_H
15
16 #include "GuiDialogView.h"
17
18 #include "ui_BoxUi.h"
19
20 #include <QCloseEvent>
21 #include <QDialog>
22
23 #include <vector>
24
25
26 namespace lyx {
27 namespace frontend {
28
29 class ControlBox;
30 class GuiBox;
31
32 class GuiBoxDialog : public QDialog, public Ui::BoxUi {
33         Q_OBJECT
34 public:
35         GuiBoxDialog(GuiBox * form);
36 protected Q_SLOTS:
37         virtual void change_adaptor();
38         virtual void innerBoxChanged(const QString &);
39         virtual void typeChanged(int);
40         virtual void restoreClicked();
41 protected:
42         virtual void closeEvent(QCloseEvent * e);
43 private:
44         GuiBox * form_;
45 };
46
47
48 ///
49 class GuiBox
50         : public QController<ControlBox, GuiView<GuiBoxDialog> >
51 {
52 public:
53         ///
54         friend class GuiBoxDialog;
55         ///
56         GuiBox(Dialog &);
57         /// add and remove special lengths
58         void setSpecial(bool ibox);
59         /// only show valid inner box items
60         void setInnerType(bool frameless, int i);
61 private:
62         /// Apply changes
63         virtual void apply();
64         /// update
65         virtual void update_contents();
66         /// build the dialog
67         virtual void build_dialog();
68         ///
69         std::vector<std::string> ids_;
70         ///
71         std::vector<docstring> gui_names_;
72         ///
73         std::vector<std::string> ids_spec_;
74         ///
75         std::vector<docstring> gui_names_spec_;
76 };
77
78 } // namespace frontend
79 } // namespace lyx
80
81 #endif // QBOX_H