~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to noatun/noatun/modules/infrared/lirc.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#ifndef _LIRC_H_
 
3
#define _LIRC_H_
 
4
 
 
5
#include <qobject.h>
 
6
#include <qstringlist.h>
 
7
#include <qmap.h>
 
8
 
 
9
class QSocket;
 
10
 
 
11
typedef QMap<QString, QStringList> Remotes;
 
12
 
 
13
class Lirc : public QObject
 
14
{
 
15
Q_OBJECT
 
16
public:
 
17
        /**
 
18
         * Constructor
 
19
         */
 
20
        Lirc(QObject *parent);
 
21
        /**
 
22
         * Destructor
 
23
         */
 
24
        virtual ~Lirc();
 
25
 
 
26
        /**
 
27
         * Returns true if the connection to lircd is operational
 
28
         */
 
29
        bool isConnected() const { return m_socket; }
 
30
        /**
 
31
         * The names of the remote configured controls
 
32
         */
 
33
        const QStringList remotes() const;
 
34
        /**
 
35
         * The names of the buttons for the specified
 
36
         * remote control
 
37
         */
 
38
        const QStringList buttons(const QString &remote) const
 
39
        {
 
40
                        return m_remotes[remote];
 
41
        }
 
42
 
 
43
signals:
 
44
        /**
 
45
         * Emitted when a IR command was received
 
46
         * 
 
47
         * The arguments are the name of the remote control used,
 
48
         * the name of the button pressed and the repeat counter.
 
49
         *
 
50
         * The signal is emitted repeatedly as long as the button
 
51
         * on the remote control remains pressed.
 
52
         * The repeat counter starts with 0 and increases
 
53
         * every time this signal is emitted.
 
54
         */
 
55
        void commandReceived(const QString &, const QString &, int);
 
56
        
 
57
private slots:
 
58
        void slotRead();
 
59
        
 
60
private:
 
61
        void update();
 
62
        const QString readLine();
 
63
        void sendCommand(const QString &);
 
64
        
 
65
private:
 
66
        QSocket *m_socket;
 
67
        Remotes m_remotes;
 
68
};
 
69
 
 
70
#endif
 
71