]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/IconPalette.h
Rename .C ==> .cpp for files in src/frontends/qt4, part two
[lyx.git] / src / frontends / qt4 / IconPalette.h
1 // -*- C++ -*-
2 /**
3  * \file IconPalette.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Edwin Leuven
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef ICONPALETTE_H
13 #define ICONPALETTE_H
14
15 #include <QWidget>
16 #include <QMenu>
17 #include <QLayout>
18 #include "Action.h"
19
20 namespace lyx {
21 namespace frontend {
22
23 /**
24  * For holding an arbitrary set of icons.
25  */
26 class IconPalette : public QWidget {
27         Q_OBJECT
28 public:
29         IconPalette(QWidget * parent);
30         void addButton(QAction *);
31
32 public Q_SLOTS:
33         void updateParent();
34
35 Q_SIGNALS:
36         void triggered(QAction *);
37         void visible(bool);
38
39 protected:
40         void showEvent(QShowEvent * event);
41         void hideEvent(QHideEvent * event);
42         void paintEvent(QPaintEvent * event);
43
44 private Q_SLOTS:
45         virtual void clicked(QAction *);
46
47 private:
48         QGridLayout * layout_;
49         QList<QAction *> actions_;
50 };
51
52 /**
53  * Popup menu for a toolbutton.
54  * We need this to keep track whether
55  * it is necessary to enable/disable
56  * the toolbutton
57  */
58 class ButtonMenu : public QMenu {
59         Q_OBJECT
60 public:
61         ButtonMenu(const QString & title, QWidget * parent = 0 );
62         void add(QAction *);
63
64 public Q_SLOTS:
65         void updateParent();
66
67 private:
68         QList<QAction *> actions_;
69 };
70
71
72 } // namespace frontend
73 } // namespace lyx
74
75 #endif // ICONPALETTE_H