summaryrefslogtreecommitdiffstats
path: root/src/kbfxplasmaindexview.h
blob: eb3c22c29cca47262466f65a34308fd9a15b0782 (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
/*
 *   Copyright (C) 2006
 *   Siraj Razick <siraj@kdemail.net>
 *   PhobosK <phobosk@mail.kbfx.net>
 *   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_INDEX_VIEW_H
#define KBFX_PLASMA_INDEX_VIEW_H

#include <tqcanvas.h>

#include <kdebug.h>
#include <tdepopupmenu.h>

#include <kbfxdatastack.h>
#include <kbfxplasmapixmapprovider.h>
#include <kbfxplasmapluginloader.h>

#include "kbfxplasmacanvasitemwrapper.h"
#include "kbfxplasmacanvasstack.h"
#include "kbfxplasmacanvasview.h"
#include "kbfxplasmaindexitem.h"
#include "kbfxsignal.h"



class KbfxPlasmaIndexView : public TQCanvasView
{

		TQ_OBJECT
  

	public:

		KbfxPlasmaIndexView ( TQWidget * parent = 0, const char * name = 0, WFlags l = 0 );
		virtual ~KbfxPlasmaIndexView();
		void loadList ( KbfxDataStack * stkPtr );
		int count() { return m_itemGroup->count() ; }
		void setView ( KbfxPlasmaCanvasView * view );
		virtual void contentsMouseMoveEvent ( TQMouseEvent * e );
		virtual void contentsMousePressEvent ( TQMouseEvent * me );
		virtual void contentsContextMenuEvent ( TQContextMenuEvent * e ) ;
		virtual void mouseMoveEvent ( TQMouseEvent * e );
		virtual void leaveEvent ( TQEvent * e );
		void setKbfxCanvas ( TQCanvas * cnv );
		void clearAll();

	public slots:
		void slotClicked ( KbfxPlasmaIndexItem * );
		void contextMenuSlot ( int id );
		void loadPlugin ( TQString name,KbfxPlasmaCanvasView * );
		void checkMousePos();
		void clearSelection();

	signals:
		void loadRequest ( KbfxSignal signal );
		void pluginRequest ( TQString pluginName,KbfxPlasmaCanvasView * );
		void clicked ( KbfxPlasmaIndexItem * item );
		void expand();
		void clearSelected();

	protected:
		void clearAllButOne ( KbfxPlasmaIndexItem * i );

	private:

		KbfxPlasmaCanvasGroup * m_itemGroup;
		KbfxPlasmaCanvasGroupView * m_itemGroupList;
		KbfxPlasmaCanvasStack * m_itemStack;
		KbfxPlasmaIndexItem * m_currentItem;
		KbfxPlasmaIndexItem * m_selectedItem;
		TQStringList m_pluginList;
		TQStringList m_pluginLoaded;
		TDEPopupMenu * m_pluginMenu;
		KbfxPlasmaCanvasView * m_currentView;
		TQPoint m_currentPos;
		TQTimer  * m_mousePollTimer;
};

#endif