summaryrefslogtreecommitdiffstats
path: root/src/kbfxplasmacanvasitem.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-17 00:43:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-17 00:43:50 +0000
commitceea23677c61f20759ae986bd77b0d5c4d673edb (patch)
tree3fcec1702eaf9c14d1dd736e594f5df08dab4001 /src/kbfxplasmacanvasitem.h
downloadkbfx-ceea23677c61f20759ae986bd77b0d5c4d673edb.tar.gz
kbfx-ceea23677c61f20759ae986bd77b0d5c4d673edb.zip
Added old KDE3 version of kbfx
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbfx@1091549 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kbfxplasmacanvasitem.h')
-rw-r--r--src/kbfxplasmacanvasitem.h141
1 files changed, 141 insertions, 0 deletions
diff --git a/src/kbfxplasmacanvasitem.h b/src/kbfxplasmacanvasitem.h
new file mode 100644
index 0000000..92f1047
--- /dev/null
+++ b/src/kbfxplasmacanvasitem.h
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2006
+ * Siraj Razick <[email protected]>
+ * PhobosK <[email protected]>
+ * see Also AUTHORS
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License version 2 as
+ * published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef KBFX_PLASMA_CANVAS_ITEM_H
+#define KBFX_PLASMA_CANVAS_ITEM_H
+
+#include <qcanvas.h>
+#include <qfont.h>
+#include <qfontinfo.h>
+#include <qimage.h>
+
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kdesktopfile.h>
+
+#include <kbfxconfig.h>
+#include <kbfxplasmapixmapprovider.h>
+
+#include "kbfxplasmacanvasabstractitem.h"
+
+
+class KbfxPlasmaCanvasItem:public KbfxPlasmaCanvasAbstractItem
+{
+
+ Q_OBJECT
+
+ public:
+
+// typedef enum {EXECUTABLE=0,SEPARATOR,INDEX,OTHER} Type;
+ typedef enum {RASTER=0,VECTOR,NATIVE} SkinMode;
+
+
+ KbfxPlasmaCanvasItem ( QCanvasPixmapArray * a, QCanvas * canvas );
+ KbfxPlasmaCanvasItem ( const KbfxPlasmaCanvasItem &t );
+ KbfxPlasmaCanvasItem &operator = ( const KbfxPlasmaCanvasItem &t );
+ virtual ~KbfxPlasmaCanvasItem ();
+
+ bool itemMode();
+ void setItemMode ( bool mode=true );
+ void setType ( Type );
+ void setCurrent ( bool );
+ void setExec ( QString desktopfile );
+ QString name() {return m_labelText;};
+ QString desktopFile() { return m_desktopFilePath;}
+
+
+ KbfxDataSource * source() { return m_source;}
+ void setSource ( KbfxDataSource src );
+ void setCommand ( QString cmd );
+ void setComment ( QString comment );
+ void setIcon ( QPixmap pixmap );
+ void setIconPath ( QString path );
+ bool isCurrent();
+ int height() { return m_height;}
+ int width() { return m_width;}
+ Type type() { return m_type;}
+ bool lookup ( QString str );
+ virtual void advance ( int phase );
+ virtual int rtti() const { return CANVASITEM;}
+ virtual void draw ( QPainter & pe );
+ virtual void drawContent ( QPainter * pe );
+ virtual QPixmap dragPixmap();
+
+// virtual void drawText(QPainter *pe,QString str);
+ virtual void drawBackDrop ( QPainter * pe,QRect & rect );
+
+ /* Event Handling */
+ virtual void mousePressEvent ( QMouseEvent * e );
+ virtual void mouseMoveEvent ( QMouseEvent * e );
+ virtual void enterEvent ( QEvent * e );
+ virtual void mouseReleaseEvent ( QMouseEvent * e );
+
+
+ void setLabelText ( QString s );
+
+ public slots:
+ void updateAngle() {}
+ void hideit();
+ void exec();
+ signals:
+ void leave();
+ void selected ( KbfxPlasmaCanvasItem* );
+
+ private:
+
+
+ void drawStar ( QPainter * pe );
+
+ int m_frameCount;
+ int m_textWidth;
+ QString m_exec;
+ QString m_desktopFilePath;
+ QString m_labelText;
+ QString m_commentText;
+ QPixmap m_icon;
+ QString m_iconPath;
+ KDesktopFile * m_desktopFile;
+ KbfxDataSource * m_source;
+
+ /* Theming stuff */
+ QColor m_fontAppNameColor;
+ QFont m_fontAppNameFont;
+ QColor m_commentColor;
+ QFont m_commentFont;
+ QColor m_lineColor;
+ QFont m_sepNameFont;
+ bool m_boldFonts;
+ bool m_skined;
+ bool m_restricted ; //KDE kiosk
+ Type m_type;
+ bool m_hidden;
+ QString m_error;
+ bool m_isCurrent;
+ bool m_noComments;
+ int m_margin;
+ int m_height;
+ int m_width;
+ int m_iconSize;
+}
+;//C.G
+
+#endif //M.I.G
+