From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- noatun/modules/kjofol-skin/kjwidget.h | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 noatun/modules/kjofol-skin/kjwidget.h (limited to 'noatun/modules/kjofol-skin/kjwidget.h') diff --git a/noatun/modules/kjofol-skin/kjwidget.h b/noatun/modules/kjofol-skin/kjwidget.h new file mode 100644 index 00000000..cc7ddf53 --- /dev/null +++ b/noatun/modules/kjofol-skin/kjwidget.h @@ -0,0 +1,53 @@ +#ifndef KJWIDGET_H +#define KJWIDGET_H + +#include "kjloader.h" + +class KJWidget +{ +public: + KJWidget(KJLoader *); + virtual ~KJWidget() {}; + // called when the widget should paint + virtual void paint(QPainter *, const QRect &) {}; + // called to receive the rect this widget is in + virtual QRect rect() const { return mRect; } + // called when pressed in this widget + virtual bool mousePress(const QPoint &) {return false; } + // called when the mouse is released after clicked in this widget + virtual void mouseRelease(const QPoint &, bool){} + virtual void mouseMove(const QPoint &, bool) {} + // called with the current time (mille) + virtual void timeUpdate(int) {} + // called when a new song is playing, player() is ready with it too + virtual void newFile() {} + // called when config-entries have to be read, is a TODO for most widgets + virtual void readConfig() {} + + // called when the mouse is moved while clicked in this widget + // repaint myself + virtual void repaint(bool me=true, const QRect &rect=QRect(), bool clear=false); + + virtual QString tip() { return 0; } + +public: + static QBitmap getMask(const QImage &color, register QRgb=qRgb(255,0,255)); + +protected: + const QString &backgroundPressed(const QString &bmp) const; + KJLoader *parent() const {return mParent;} + KJLoader &parser() const {return *mParent;} + + KJFont &textFont() const {return *mParent->mText;} + KJFont &timeFont() const {return *mParent->mNumbers;} + KJFont &volumeFont() const {return *mParent->mVolumeFont;} + KJFont &pitchFont() const {return *mParent->mPitchFont;} + + void setRect(const QRect& rect) {mRect=rect;} + void setRect(int x, int y, int xs, int ys) {mRect=QRect(x,y,xs,ys);} +private: + KJLoader *mParent; + QRect mRect; +}; + +#endif -- cgit v1.2.3