]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiBox.h
support for colored boxes
[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 (with useful hints from Angus Leeming)
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GUIBOX_H
14 #define GUIBOX_H
15
16 #include "InsetParamsWidget.h"
17 #include "ui_BoxUi.h"
18 #include "Font.h"
19
20 namespace lyx {
21 namespace frontend {
22
23 typedef std::pair<QString, ColorCode>  ColorPair;
24
25 class GuiBox : public InsetParamsWidget, public Ui::BoxUi
26 {
27         Q_OBJECT
28
29 public:
30         GuiBox(QWidget * parent = 0);
31
32 private Q_SLOTS:
33         void on_innerBoxCO_activated(int);
34         void on_typeCO_activated(int);
35         void on_frameColorCO_currentIndexChanged(int);
36         void initDialog();
37         void on_widthCB_stateChanged(int state);
38         void on_heightCB_stateChanged(int state);
39         void on_pagebreakCB_stateChanged();
40
41 private:
42         /// \name DialogView inherited methods
43         //@{
44         InsetCode insetCode() const { return BOX_CODE; }
45         FuncCode creationCode() const { return LFUN_BOX_INSERT; }
46         void paramsToDialog(Inset const *);
47         docstring dialogToParams() const;
48         bool checkWidgets(bool readonly) const;
49         //@}
50
51         /// add and remove special lengths
52         void setSpecial(bool ibox);
53         /// only show valid inner box items
54         void setInnerType(bool frameless, QString const & type);
55
56         QStringList ids_;
57         ///
58         QStringList gui_names_;
59         ///
60         QStringList ids_spec_;
61         ///
62         QStringList gui_names_spec_;
63         ///
64         QList<ColorPair> color;
65 };
66
67 } // namespace frontend
68 } // namespace lyx
69
70 #endif // GUIBOX_H