Main Page   Class Hierarchy   Compound List   File List   Compound Members  

lirc.h

00001 // -*- c++ -*-
00002 /*
00003  * Copyright (C) 2002 Zsolt Rizsanyi <rizsanyi@myrealbox.com>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018  * Boston, MA 02111-1307, USA.
00019  */
00020 
00021 
00022 #ifndef __LIRC_H__
00023 #define __LIRC_H__
00024 
00025 #include <qmap.h>
00026 #include <qobject.h>
00027 #include <qstring.h>
00028 
00029 #ifdef HAVE_CONFIG_H
00030 # include <config.h>
00031 #endif
00032 
00033 #ifdef HAVE_LIRC
00034 # include <lirc/lirc_client.h>
00035 #endif
00036 
00040 class Lirc : public QObject
00041 {
00042     Q_OBJECT
00043 
00044 public:
00048     Lirc( QObject *parent, const QString& appname);
00049     virtual ~Lirc();
00050 
00056     void setDefaultKeyMap(const QMap<QString, QString>& keymap) { _keymap = keymap; }
00057 
00058 signals:
00064     void event(const QString& key, unsigned repeat);
00065 
00070     void command(const QString& cmd, unsigned repeat);
00071 
00072 private slots:
00073     void dataReceived();
00074 
00075 private:
00076     QString _appname;
00077 #ifdef HAVE_LIRC
00078     lirc_config* _config;
00079     int _lircfd;
00080 #endif
00081     QMap<QString, QString> _keymap;
00082 };
00083 
00084 #endif // __LIRC_H__

Generated at Thu Jan 30 02:56:02 2003 for QtVision by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001