~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to khotkeys/kcm_hotkeys/helper_widgets/gesture_recorder.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
 
 
3
 KHotKeys
 
4
 
 
5
 Copyright (C) 2003 Mike Pilone <mpilone@slac.com>
 
6
 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
 
7
 
 
8
 Distributed under the terms of the GNU General Public License version 2.
 
9
 
 
10
****************************************************************************/
 
11
 
 
12
#ifndef GESTURE_RECORDER_H
 
13
#define GESTURE_RECORDER_H
 
14
 
 
15
#include "triggers/gestures.h"
 
16
 
 
17
#include <QtGui/QFrame>
 
18
 
 
19
class QMouseEvent;
 
20
 
 
21
/**
 
22
 * This widget tracks mouse movements when the left mouse button has been
 
23
 * pressed while the cursor was over the widget.
 
24
 * The events are sent to a Stroke. When the mouse button is released the Stroke
 
25
 * is instructed to process the data; the processed data will then be emitted in
 
26
 * a "recorded" signal.
 
27
 */
 
28
 
 
29
class GestureRecorder : public QFrame
 
30
    {
 
31
    Q_OBJECT
 
32
 
 
33
    public:
 
34
 
 
35
        GestureRecorder(QWidget *parent, const char *name="FIXXXXXMMEEEEEEEEEEEEE");
 
36
        ~GestureRecorder();
 
37
 
 
38
    protected:
 
39
 
 
40
        void mousePressEvent(QMouseEvent *);
 
41
        void mouseReleaseEvent(QMouseEvent *);
 
42
        void mouseMoveEvent(QMouseEvent *);
 
43
 
 
44
    Q_SIGNALS:
 
45
 
 
46
        void recorded(const KHotKeys::StrokePoints &data);
 
47
 
 
48
    private:
 
49
        bool _mouseButtonDown;
 
50
        KHotKeys::Stroke stroke;
 
51
    };
 
52
 
 
53
#endif