2001-06-19 15:26:48 +00:00
|
|
|
#ifndef __MODSYSTEMCLIENT_H
|
|
|
|
#define __MODSYSTEMCLIENT_H
|
|
|
|
|
|
|
|
#include <qbitmap.h>
|
2005-03-24 16:33:13 +00:00
|
|
|
#include <kcommondecoration.h>
|
2003-09-16 19:37:46 +00:00
|
|
|
#include <kdecorationfactory.h>
|
|
|
|
|
2001-06-19 15:26:48 +00:00
|
|
|
class QLabel;
|
|
|
|
class QSpacerItem;
|
|
|
|
|
2002-08-27 18:08:20 +00:00
|
|
|
namespace ModernSystem {
|
2001-06-19 15:26:48 +00:00
|
|
|
|
2003-09-16 19:37:46 +00:00
|
|
|
class ModernSys;
|
2002-08-27 18:08:20 +00:00
|
|
|
|
2005-03-24 16:33:13 +00:00
|
|
|
class ModernButton : public KCommonDecorationButton
|
2001-06-19 15:26:48 +00:00
|
|
|
{
|
|
|
|
public:
|
2005-03-24 16:33:13 +00:00
|
|
|
ModernButton(ButtonType type, ModernSys *parent, const char *name);
|
2001-06-19 15:26:48 +00:00
|
|
|
void setBitmap(const unsigned char *bitmap);
|
2005-03-24 16:33:13 +00:00
|
|
|
virtual void reset(unsigned long changed);
|
2001-06-19 15:26:48 +00:00
|
|
|
protected:
|
2005-08-17 09:15:59 +00:00
|
|
|
void paintEvent(QPaintEvent *);
|
2001-06-19 15:26:48 +00:00
|
|
|
virtual void drawButton(QPainter *p);
|
|
|
|
void drawButtonLabel(QPainter *){;}
|
|
|
|
QBitmap deco;
|
|
|
|
};
|
|
|
|
|
2005-03-24 16:33:13 +00:00
|
|
|
class ModernSys : public KCommonDecoration
|
2001-06-19 15:26:48 +00:00
|
|
|
{
|
|
|
|
public:
|
2003-09-16 19:37:46 +00:00
|
|
|
ModernSys( KDecorationBridge* b, KDecorationFactory* f );
|
2001-06-19 15:26:48 +00:00
|
|
|
~ModernSys(){;}
|
2005-03-24 16:33:13 +00:00
|
|
|
|
|
|
|
virtual QString visibleName() const;
|
|
|
|
virtual QString defaultButtonsLeft() const;
|
|
|
|
virtual QString defaultButtonsRight() const;
|
|
|
|
virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
|
|
|
|
virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
|
|
|
|
virtual KCommonDecorationButton *createButton(ButtonType type);
|
|
|
|
|
|
|
|
virtual void updateWindowShape();
|
|
|
|
virtual void updateCaption();
|
|
|
|
|
2003-09-16 19:37:46 +00:00
|
|
|
void init();
|
2001-06-19 15:26:48 +00:00
|
|
|
protected:
|
|
|
|
void drawRoundFrame(QPainter &p, int x, int y, int w, int h);
|
|
|
|
void paintEvent( QPaintEvent* );
|
|
|
|
void recalcTitleBuffer();
|
2003-09-16 19:37:46 +00:00
|
|
|
void reset( unsigned long );
|
2001-06-19 15:26:48 +00:00
|
|
|
private:
|
|
|
|
QPixmap titleBuffer;
|
|
|
|
QString oldTitle;
|
2005-03-24 16:33:13 +00:00
|
|
|
bool reverse;
|
2001-06-19 15:26:48 +00:00
|
|
|
};
|
|
|
|
|
2003-09-16 19:37:46 +00:00
|
|
|
class ModernSysFactory : public QObject, public KDecorationFactory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ModernSysFactory();
|
|
|
|
virtual ~ModernSysFactory();
|
|
|
|
virtual KDecoration* createDecoration( KDecorationBridge* );
|
|
|
|
virtual bool reset( unsigned long changed );
|
2004-11-05 15:33:09 +00:00
|
|
|
virtual bool supports( Ability ability );
|
2005-07-28 14:59:42 +00:00
|
|
|
QList< BorderSize > borderSizes() const;
|
2003-09-26 12:09:20 +00:00
|
|
|
private:
|
2005-03-24 16:33:13 +00:00
|
|
|
void read_config();
|
2003-09-16 19:37:46 +00:00
|
|
|
};
|
|
|
|
|
2003-07-26 10:41:28 +00:00
|
|
|
}
|
2001-06-19 15:26:48 +00:00
|
|
|
|
|
|
|
#endif
|