summaryrefslogtreecommitdiffstats
path: root/src/kbfxplasmacanvasabstractitem.h
blob: c1c8ac5d794f43c2cd4a37d6e4686510b5084d9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
 *   Copyright (C) 2006
 *   Siraj Razick <siraj@kdemail.net>
 *   PhobosK <phobosk@mail.kbfx.org>
 *   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_ABSTRACT_ITEM_H
#define KBFX_PLASMA_CANVAS_ABSTRACT_ITEM_H

#include <tqcanvas.h>
#include <tqpainter.h>
#include "kbfxplasmacanvasrtti.h"
#include <tqtimer.h>
#include <kdesktopfile.h>
#include <kstandarddirs.h>
#include <kiconloader.h>
#include "kbfxdatasource.h"
#include <krun.h>

class KbfxPlasmaCanvasAbstractItem:public TQObject,public TQCanvasSprite
{

		Q_OBJECT
  TQ_OBJECT

	public:
		typedef enum {EXECUTABLE=0,SEPARATOR,INDEX,OTHER} Type;
//	typedef enum {RASTER=0,VECTOR,NATIVE} SkinMode;

		KbfxPlasmaCanvasAbstractItem ( TQCanvasPixmapArray * a, TQCanvas * canvas );
		virtual ~KbfxPlasmaCanvasAbstractItem ();

		void setCurrent ( bool );
		virtual Type type() { return m_type; }
		virtual void setType ( Type t ) { m_type = t;}

		TQString name() { if ( m_source != 0 ) return m_source->name(); else return TQString ( "Not Set" );};

		void setSource ( KbfxDataSource src );
		bool isCurrent();
		virtual int height() { return m_height;}
		
		virtual int width() { return m_width;}

		virtual bool lookup ( TQString str ) {str = str  ; return false;}

		virtual int  rtti() const { return CANVASITEM;}

		virtual void draw ( TQPainter & pe );

		virtual void drawContent ( TQPainter * pe );

		virtual TQPixmap dragPixmap();


//Event Handling
		virtual void mousePressEvent ( TQMouseEvent * e );
		virtual void mouseMoveEvent ( TQMouseEvent * e );
		virtual void enterEvent ( TQEvent * e );
		virtual void mouseReleaseEvent ( TQMouseEvent * e );


		virtual void setLabelText ( TQString s );

	public slots:
		virtual void hideit();
		virtual void exec();
	signals:
		void clicked();
		void leave();
		void selected ( KbfxPlasmaCanvasAbstractItem* );

	private:

//	KbfxPlasmaCanvasAbstractItem  (const KbfxPlasmaCanvasItem &t);
		KbfxDataSource * m_source;
		Type m_type;
		int m_height;
		int m_width;
		bool m_current;




}
;//C.G

#endif //M.I.G