]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/iconpalette.h
Add basic bits of Qt's math panel. Hacked together (no MVC yet) but
[lyx.git] / src / frontends / qt2 / iconpalette.h
1 /**
2  * \file iconpalette.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  */
8
9 #ifndef ICONPALETTE_H
10 #define ICONPALETTE_H
11
12 #include <config.h>
13
14 #include "LString.h"
15  
16 #include <qwidget.h>
17
18 #include <map>
19
20 class QPixmap;
21 class QPushButton;
22 class QGridLayout;
23
24 /**
25  * For holding an arbitrary set of icons.
26  */
27 class IconPalette : public QWidget {
28         Q_OBJECT
29 public:
30         IconPalette(QWidget * parent, char const * name);
31
32         /// add a button
33         void add(QPixmap const & pixmap, string name, string tooltip);
34
35 signals:
36         void button_clicked(string);
37
38 protected slots:
39         virtual void clicked();
40
41 private:
42         typedef std::map<QPushButton *, string> ButtonMap;
43
44         int crow_;
45         int ccol_;
46  
47         QGridLayout * layout_;
48  
49         ButtonMap button_map_;
50 };
51
52 #endif // ICONPALETTE_H