]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiBox.h
Merge QController into individual dialogs. Also various cleanup
[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 GUIBOX_H
14 #define GUIBOX_H
15
16 #include "GuiDialogView.h"
17 #include "ControlBox.h"
18 #include "ui_BoxUi.h"
19
20 #include <QDialog>
21
22 #include <vector>
23
24
25 namespace lyx {
26 namespace frontend {
27
28 class GuiBox;
29
30 class GuiBoxDialog : public QDialog, public Ui::BoxUi {
31         Q_OBJECT
32 public:
33         GuiBoxDialog(GuiBox * form);
34 protected Q_SLOTS:
35         virtual void change_adaptor();
36         virtual void innerBoxChanged(const QString &);
37         virtual void typeChanged(int);
38         virtual void restoreClicked();
39 protected:
40         virtual void closeEvent(QCloseEvent * e);
41 private:
42         GuiBox * form_;
43 };
44
45
46 class GuiBox : public GuiView<GuiBoxDialog>
47 {
48 public:
49         ///
50         GuiBox(Dialog &);
51         /// parent controller
52         ControlBox & controller()
53         { return static_cast<ControlBox &>(this->getController()); }
54         /// parent controller
55         ControlBox const & controller() const
56         { return static_cast<ControlBox const &>(this->getController()); }
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         ///
63         friend class GuiBoxDialog;
64         /// Apply changes
65         virtual void apply();
66         /// update
67         virtual void update_contents();
68         /// build the dialog
69         virtual void build_dialog();
70         ///
71         std::vector<std::string> ids_;
72         ///
73         std::vector<docstring> gui_names_;
74         ///
75         std::vector<std::string> ids_spec_;
76         ///
77         std::vector<docstring> gui_names_spec_;
78 };
79
80 } // namespace frontend
81 } // namespace lyx
82
83 #endif // GUIBOX_H