]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/iconpalette.h
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[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 John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef ICONPALETTE_H
13 #define ICONPALETTE_H
14
15
16 #include <QWidget>
17 //#include <QPixmap>
18 //#include <Q3GridLayout>
19 //#include <QResizeEvent>
20
21 #include <string>
22 #include <utility>
23 #include <vector>
24
25
26 class QPixmap;
27 class QPushButton;
28 class Q3GridLayout;
29 class QResizeEvent;
30
31 /**
32  * For holding an arbitrary set of icons.
33  */
34 class IconPalette : public QWidget {
35         Q_OBJECT
36 public:
37         IconPalette(QWidget * parent, char const * name = 0);
38
39         /// add a button
40         void add(QPixmap const & pixmap, std::string name, std::string tooltip);
41 signals:
42         void button_clicked(const std::string &);
43 protected:
44         virtual void resizeEvent(QResizeEvent * e);
45 protected slots:
46         virtual void clicked();
47 private:
48         int maxcol_;
49
50         Q3GridLayout * layout_;
51
52         typedef std::pair<QPushButton *, std::string> Button;
53
54         std::vector<Button> buttons_;
55 };
56
57 #endif // ICONPALETTE_H