lyx_mirror/src/frontends/qt4/iconpalette.h
André Pönitz 6c300f72a2 move everything into namespace lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15422 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 00:16:43 +00:00

59 lines
1.0 KiB
C++

// -*- C++ -*-
/**
* \file iconpalette.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef ICONPALETTE_H
#define ICONPALETTE_H
#include <QWidget>
#include <string>
#include <utility>
#include <vector>
class QPixmap;
class QPushButton;
class QGridLayout;
class QResizeEvent;
namespace lyx {
/**
* For holding an arbitrary set of icons.
*/
class IconPalette : public QWidget {
Q_OBJECT
public:
IconPalette(QWidget * parent);
/// add a button
void add(QPixmap const & pixmap, std::string name, std::string tooltip);
Q_SIGNALS:
void button_clicked(const std::string &);
protected:
virtual void resizeEvent(QResizeEvent * e);
protected Q_SLOTS:
virtual void clicked();
private:
int maxcol_;
QGridLayout * layout_;
typedef std::pair<QPushButton *, std::string> Button;
std::vector<Button> buttons_;
};
} // namespace lyx
#endif // ICONPALETTE_H