~ubuntu-branches/ubuntu/raring/recorditnow/raring

« back to all changes in this revision

Viewing changes to src/keymonmanager.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-09 14:54:01 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110109145401-gyckb4airz4fio50
Tags: 0.8.1-0ubuntu1
* New upstream release. (LP: #681270)
  - Update debian/copyright.
* Build-depend on recordmydesktop.
* Add a watch file.
* Drop 01_fix_ftbfs_kwarning_call.diff, fixed upstream.
* Add 01_joschy_install_to_usr_lib.diff.
* Add 02_fix_ftbfs_no-add-needed.diff.
* Add 03_dont_install_header_files.diff.
* Replace dependency on libpolkit-qt-1-0 with policykit-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2010 by Kai Dombrowe <just89@gmx.de>                    *
 
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 program 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 program; if not, write to the                         *
 
16
 *   Free Software Foundation, Inc.,                                       *
 
17
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
 
18
 ***************************************************************************/
 
19
 
 
20
#ifndef KEYMONMANAGER_H
 
21
#define KEYMONMANAGER_H
 
22
 
 
23
 
 
24
// own
 
25
#include "keymon/event.h"
 
26
#include"keymon/deviceinfo.h"
 
27
 
 
28
// KDE
 
29
#include <kauth.h>
 
30
 
 
31
// Qt
 
32
#include <QtCore/QObject>
 
33
 
 
34
 
 
35
 
 
36
using namespace KAuth;
 
37
class KeyMonManager : public QObject
 
38
{
 
39
    Q_OBJECT
 
40
    friend class KeyMonManagerSingleton;
 
41
 
 
42
 
 
43
public:
 
44
    ~KeyMonManager();
 
45
    static KeyMonManager *self();
 
46
    static QList<KeyMon::DeviceInfo> getInputDeviceList();
 
47
    static QString fileForDevice(const KeyMon::DeviceInfo &info);
 
48
 
 
49
 
 
50
    QString error() const;
 
51
    bool start(const QStringList &devs);
 
52
    void stop();
 
53
 
 
54
 
 
55
private:
 
56
    static KeyMonManager *m_self;
 
57
    bool m_started;
 
58
    QString m_error;
 
59
 
 
60
    explicit KeyMonManager(QObject *parent = 0);
 
61
 
 
62
    QString parseError(const int &errorCode);
 
63
 
 
64
 
 
65
private slots:
 
66
    void progressStep(const QVariantMap &data);
 
67
    void actionPerformed(const ActionReply &reply);
 
68
    void actionStarted();
 
69
 
 
70
 
 
71
signals:
 
72
    void keyEvent(const KeyMon::Event &event);
 
73
    void stopped();
 
74
    void started();
 
75
 
 
76
 
 
77
};
 
78
 
 
79
 
 
80
#endif // KEYMONMANAGER_H