2007-05-24 00:45:21 +02:00
|
|
|
#ifndef APPLET_LAYOUT_H
|
|
|
|
#define APPLET_LAYOUT_H
|
2005-12-30 07:47:24 +01:00
|
|
|
|
|
|
|
#include <QLayout>
|
2005-12-30 21:09:10 +01:00
|
|
|
#include <QSize>
|
2005-12-30 07:47:24 +01:00
|
|
|
|
2007-05-20 22:36:59 +02:00
|
|
|
#include <plasma_export.h>
|
|
|
|
|
2005-12-30 21:09:10 +01:00
|
|
|
class QLayoutItem;
|
|
|
|
class QRect;
|
2005-12-30 07:47:24 +01:00
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* AppletLayout is our custom layouting engine
|
|
|
|
* for applets. It reacts to state transition (removal,addition
|
|
|
|
* of applets) by emitting corresponding signals which AppletCompositor
|
|
|
|
* can intercept and respond with some nice animation/effect.
|
|
|
|
*/
|
2007-05-20 22:13:46 +02:00
|
|
|
class PLASMA_EXPORT AppletLayout : public QLayout
|
2005-12-30 07:47:24 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
AppletLayout(QWidget *parent);
|
2005-12-30 21:09:10 +01:00
|
|
|
~AppletLayout();
|
2005-12-30 07:47:24 +01:00
|
|
|
|
2005-12-30 21:09:10 +01:00
|
|
|
virtual void addItem(QLayoutItem *item);
|
|
|
|
virtual Qt::Orientations expandingDirections() const;
|
|
|
|
virtual bool hasHeightForWidth() const;
|
|
|
|
virtual int heightForWidth(int) const;
|
|
|
|
virtual int count() const;
|
|
|
|
virtual QLayoutItem *itemAt(int index) const;
|
|
|
|
virtual QSize minimumSize() const;
|
|
|
|
virtual void setGeometry(const QRect &rect);
|
|
|
|
virtual QSize sizeHint() const;
|
|
|
|
virtual QLayoutItem *takeAt(int index);
|
2006-01-20 12:09:06 +01:00
|
|
|
Q_SIGNALS:
|
2005-12-30 07:47:24 +01:00
|
|
|
void mergeTwoApplets();
|
|
|
|
void splitTwoApplets();
|
2005-12-30 21:09:10 +01:00
|
|
|
protected:
|
|
|
|
int layoutApplets(const QRect &rect, bool computeHeightOnly) const;
|
2005-12-30 07:47:24 +01:00
|
|
|
private:
|
|
|
|
class Private;
|
|
|
|
Private *d;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|