~ubuntu-branches/ubuntu/precise/krusader/precise

« back to all changes in this revision

Viewing changes to krusader/Panel/krmousehandler.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-05-05 22:26:37 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505222637-ydv3cwjwy365on2r
Tags: 1:2.1.0~beta1-1ubuntu1
* Merge from Debian Unstable.  Remaining changes:
  - Retain Kubuntu doc path

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                        krmousehandler.h  -  description
3
 
                             -------------------
4
 
    begin                : Sat Feb 14 2009
5
 
    copyright            : (C) 2009+ by Csaba Karai
6
 
    email                : 
7
 
 ***************************************************************************/
8
 
 
9
 
/***************************************************************************
10
 
 *                                                                         *
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.                                   *
15
 
 *                                                                         *
16
 
 ***************************************************************************/
17
 
 
18
 
#ifndef __KR_MOUSE_HANDLER__
19
 
#define __KR_MOUSE_HANDLER__
 
1
/*****************************************************************************
 
2
 * Copyright (C) 2009 Csaba Karai <cskarai@freemail.hu>                      *
 
3
 *                                                                           *
 
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.                                       *
 
8
 *                                                                           *
 
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.                              *
 
13
 *                                                                           *
 
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
 *****************************************************************************/
 
18
 
 
19
#ifndef KRMOUSEHANDLER_H
 
20
#define KRMOUSEHANDLER_H
20
21
 
21
22
#include <QPoint>
22
23
#include <QTimer>
33
34
 
34
35
class KrMouseHandler : public QObject
35
36
{
36
 
        Q_OBJECT
 
37
    Q_OBJECT
37
38
 
38
39
public:
39
 
        KrMouseHandler( KrView * view, int contextMenuShift );
40
 
        
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();
53
 
        
 
40
    KrMouseHandler(KrView * view, int contextMenuShift);
 
41
 
 
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();
 
54
 
54
55
public slots:
55
 
        void showContextMenu();
56
 
        
 
56
    void showContextMenu();
 
57
 
57
58
signals:
58
 
        void renameCurrentItem();
59
 
        
 
59
    void renameCurrentItem();
 
60
 
60
61
protected:
61
 
        KrView     * _view;
62
 
        KrViewItem * _rightClickedItem;
63
 
        KrViewItem * _clickedItem;
64
 
        bool         _rightClickSelects;
65
 
        bool         _singleClick;
66
 
        QPoint       _contextMenuPoint;
67
 
        QTimer       _contextMenuTimer;
68
 
        int          _contextMenuShift;
69
 
        bool         _singleClicked;
70
 
        KrViewItem * _singleClickedItem;
71
 
        QTime        _singleClickTime;
72
 
        QTimer       _renameTimer;
73
 
        QPoint       _dragStartPos;
74
 
        bool         _emptyContextMenu;
 
62
    KrView     * _view;
 
63
    KrViewItem * _rightClickedItem;
 
64
    KrViewItem * _clickedItem;
 
65
    bool         _rightClickSelects;
 
66
    bool         _singleClick;
 
67
    QPoint       _contextMenuPoint;
 
68
    QTimer       _contextMenuTimer;
 
69
    int          _contextMenuShift;
 
70
    bool         _singleClicked;
 
71
    KrViewItem * _singleClickedItem;
 
72
    QTime        _singleClickTime;
 
73
    QTimer       _renameTimer;
 
74
    QPoint       _dragStartPos;
 
75
    bool         _emptyContextMenu;
75
76
};
76
77
 
77
 
#endif /* __KR_MOUSE_HANDLER */
 
78
#endif