1
/***************************************************************************
2
krmousehandler.h - description
4
begin : Sat Feb 14 2009
5
copyright : (C) 2009+ by Csaba Karai
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
18
#ifndef __KR_MOUSE_HANDLER__
19
#define __KR_MOUSE_HANDLER__
1
/*****************************************************************************
2
* Copyright (C) 2009 Csaba Karai <cskarai@freemail.hu> *
4
* This program is free software; you can redistribute it and/or modify *
5
* it under the terms of the GNU General Public License as published by *
6
* the Free Software Foundation; either version 2 of the License, or *
7
* (at your option) any later version. *
9
* This package is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this package; if not, write to the Free Software *
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
17
*****************************************************************************/
19
#ifndef KRMOUSEHANDLER_H
20
#define KRMOUSEHANDLER_H
34
35
class KrMouseHandler : public QObject
39
KrMouseHandler( KrView * view, int contextMenuShift );
41
bool mousePressEvent( QMouseEvent *e );
42
bool mouseReleaseEvent( QMouseEvent *e );
43
bool mouseDoubleClickEvent( QMouseEvent *e );
44
bool mouseMoveEvent ( QMouseEvent *e );
45
bool wheelEvent ( QWheelEvent * );
46
bool dragEnterEvent(QDragEnterEvent *e);
47
bool dragMoveEvent(QDragMoveEvent *e);
48
bool dragLeaveEvent(QDragLeaveEvent *e);
49
bool dropEvent ( QDropEvent *e );
50
void handleContextMenu( KrViewItem * it, const QPoint & pos );
51
void otherEvent( QEvent * e );
52
void cancelTwoClickRename();
40
KrMouseHandler(KrView * view, int contextMenuShift);
42
bool mousePressEvent(QMouseEvent *e);
43
bool mouseReleaseEvent(QMouseEvent *e);
44
bool mouseDoubleClickEvent(QMouseEvent *e);
45
bool mouseMoveEvent(QMouseEvent *e);
46
bool wheelEvent(QWheelEvent *);
47
bool dragEnterEvent(QDragEnterEvent *e);
48
bool dragMoveEvent(QDragMoveEvent *e);
49
bool dragLeaveEvent(QDragLeaveEvent *e);
50
bool dropEvent(QDropEvent *e);
51
void handleContextMenu(KrViewItem * it, const QPoint & pos);
52
void otherEvent(QEvent * e);
53
void cancelTwoClickRename();
55
void showContextMenu();
56
void showContextMenu();
58
void renameCurrentItem();
59
void renameCurrentItem();
62
KrViewItem * _rightClickedItem;
63
KrViewItem * _clickedItem;
64
bool _rightClickSelects;
66
QPoint _contextMenuPoint;
67
QTimer _contextMenuTimer;
68
int _contextMenuShift;
70
KrViewItem * _singleClickedItem;
71
QTime _singleClickTime;
74
bool _emptyContextMenu;
63
KrViewItem * _rightClickedItem;
64
KrViewItem * _clickedItem;
65
bool _rightClickSelects;
67
QPoint _contextMenuPoint;
68
QTimer _contextMenuTimer;
69
int _contextMenuShift;
71
KrViewItem * _singleClickedItem;
72
QTime _singleClickTime;
75
bool _emptyContextMenu;
77
#endif /* __KR_MOUSE_HANDLER */