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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
/*
* 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_VIEW_H
#define KBFX_PLASMA_CANVAS_VIEW_H
#include <qcanvas.h>
#include <qcursor.h>
#include <qdragobject.h>
#include <qpainter.h>
#include <kimageeffect.h>
#include <kbfxconfig.h>
#include <kbfxdatastack.h>
#include <kbfxplasmapixmapprovider.h>
#include <kbfxplasmapluginloader.h>
//#include "kbfxplasmacanvasrtti.h"
#include "kbfxplasmacanvasgroup.h"
#include "kbfxplasmacanvasgroupview.h"
#include "kbfxplasmacanvasitem.h"
#include "kbfxplasmacanvasitemwrapper.h"
#include "kbfxplasmacanvasstack.h"
#include "kbfxplasmacanvasview.h"
#include "kbfxsignal.h"
#include "kbfxspinxscrollbar.h"
class QCanvasView;
class KbfxPlasmaCanvasView : public QCanvasView
{
Q_OBJECT
public:
typedef QMap<QString,KbfxPlasmaCanvasStack*> stackMap;
typedef QMap<QString,KbfxDataStack*> dataStack;
typedef QMap<int,KbfxPlasmaCanvasItem*> searchMap;
KbfxPlasmaCanvasView ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 );
virtual ~KbfxPlasmaCanvasView();
void addStack ( KbfxPlasmaCanvasStack*stk,QString name );
void addStack ( KbfxDataStack*stk,QString name );
void setKbfxCanvas ( QCanvas*cnv );
void loadGroup ( KbfxDataGroupList * src,KbfxPlasmaCanvasGroupView * dest );
void contentsDragLeaveEvent ( QDragEnterEvent *event );
void contentsDragEnterEvent ( QDragEnterEvent *event );
public slots:
void clearAll();
virtual void contentsMousePressEvent ( QMouseEvent * me );
virtual void contentsMouseMoveEvent ( QMouseEvent * e );
virtual void contentsMouseReleaseEvent ( QMouseEvent * e );
virtual void mouseMoveEvent ( QMouseEvent * me );
virtual void enterEvent ( QEvent * e );
virtual void keyPressEvent ( QKeyEvent * ke );
virtual void emulatedKeyPress ( QKeyEvent * k ) {keyPressEvent ( k );}
virtual void resizeEvent ( QResizeEvent * ) ;
virtual void leaveEvent ( QEvent * e );
// virtual void leaveEvent(QEvent e );
void handleLoadRequest ( KbfxSignal );
void search ( const QString & );
void search_R ( const QString key );
void execFirst();
void execAt ( int i );
void expandAll();
void reload();
signals:
void clicked();
protected:
void clearAllButOne ( KbfxPlasmaCanvasItem * i );
private:
void clearSearch();
void startDrag();
void placeScrollBars();
QPoint m_clickPos;
KbfxPlasmaCanvasItem * m_currentItem;
KbfxPlasmaCanvasStack * m_currentStack;
KbfxPlasmaCanvasStack * m_stack;
QString m_lastSignalData;
stackMap m_appletMap;
dataStack m_dataStack;
searchMap m_searchMap;
KbfxPlasmaCanvasStack * gstack ;
KbfxPlasmaCanvasItem * m_exeCandidate;
QCanvas * m_default;
QCanvas * m_search;
bool m_findDone;
KbfxSpinxScrollBar * m_scrollbar_top;
KbfxSpinxScrollBar * m_scrollbar_bot;
QPoint m_dragPos;
KbfxPlasmaCanvasGroupView * m_currentView;
QString m_currentViewName;
KbfxPlasmaCanvasItem * m_selectedItem;
};
#endif
|