2006-03-05 17:24:44 +00:00
|
|
|
// -*- 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>
|
2006-11-21 09:06:12 +00:00
|
|
|
#include <QLayout>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QWidgetItem>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class QPushButton;
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
2006-11-19 17:12:33 +00:00
|
|
|
namespace frontend {
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2006-11-21 09:06:12 +00:00
|
|
|
class FlowLayout : public QLayout
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FlowLayout(QWidget *parent);
|
|
|
|
~FlowLayout();
|
|
|
|
|
|
|
|
void addItem(QLayoutItem *item);
|
|
|
|
Qt::Orientations expandingDirections() const;
|
|
|
|
bool hasHeightForWidth() const;
|
|
|
|
int heightForWidth(int) const;
|
|
|
|
QSize minimumSize() const;
|
|
|
|
void setGeometry(const QRect &rect);
|
|
|
|
QSize sizeHint() const;
|
|
|
|
QLayoutItem * takeAt(int index);
|
|
|
|
QLayoutItem * itemAt(int index) const;
|
|
|
|
int count() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
int doLayout(const QRect &rect, bool testOnly) const;
|
|
|
|
QList<QLayoutItem *> itemList;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/**
|
|
|
|
* For holding an arbitrary set of icons.
|
|
|
|
*/
|
|
|
|
class IconPalette : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2006-11-19 17:12:33 +00:00
|
|
|
IconPalette(QWidget * parent, char const ** entries);
|
2006-11-18 16:19:18 +00:00
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
Q_SIGNALS:
|
2006-03-05 17:24:44 +00:00
|
|
|
void button_clicked(const std::string &);
|
2006-11-19 17:12:33 +00:00
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
protected Q_SLOTS:
|
2006-03-05 17:24:44 +00:00
|
|
|
virtual void clicked();
|
|
|
|
|
2006-11-19 17:12:33 +00:00
|
|
|
private:
|
2006-03-05 17:24:44 +00:00
|
|
|
typedef std::pair<QPushButton *, std::string> Button;
|
|
|
|
std::vector<Button> buttons_;
|
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2006-11-19 17:12:33 +00:00
|
|
|
} // namespace frontend
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#endif // ICONPALETTE_H
|