00001 /* 00002 This file is part of the Opie Project 00003 =. (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de> 00004 .=l. 00005 .>+-= 00006 _;:, .> :=|. This program is free software; you can 00007 .> <`_, > . <= redistribute it and/or modify it under 00008 :`=1 )Y*s>-.-- : the terms of the GNU Library General Public 00009 .="- .-=="i, .._ License as published by the Free Software 00010 - . .-<_> .<> Foundation; version 2 of the License. 00011 ._= =} : 00012 .%`+i> _;_. 00013 .i_,=:_. -<s. This program is distributed in the hope that 00014 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00015 : .. .:, . . . without even the implied warranty of 00016 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00017 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00018 ..}^=.= = ; Library General Public License for more 00019 ++= -. .` .: details. 00020 : = ...= . :.=- 00021 -. .:....=;==+<; You should have received a copy of the GNU 00022 -_. . . )=. = Library General Public License along with 00023 -- :-=` this library; see the file COPYING.LIB. 00024 If not, write to the Free Software Foundation, 00025 Inc., 59 Temple Place - Suite 330, 00026 Boston, MA 02111-1307, USA. 00027 */ 00028 00029 #ifndef OINPUTSYSTEM_H 00030 #define OINPUTSYSTEM_H 00031 00032 #include "linux_input.h" 00033 00034 /* QT */ 00035 #include <qobject.h> 00036 #include <qdict.h> 00037 00038 namespace Opie { 00039 namespace Core { 00040 00041 class OInputDevice; 00042 00050 class OInputSystem : public QObject 00051 { 00052 public: 00053 typedef QDict<OInputDevice> DeviceMap; 00054 typedef QDictIterator<OInputDevice> DeviceIterator; 00055 00059 int count() const; 00063 static OInputSystem* instance(); 00067 DeviceIterator iterator() const; 00072 OInputDevice* device( const QString& interface ) const; 00077 void synchronize(); 00081 ~OInputSystem(); 00082 00083 protected: 00084 OInputSystem(); 00085 00086 static OInputSystem* _instance; 00087 DeviceMap _devices; 00088 }; 00089 00090 00091 class OInputDevice : public QObject 00092 { 00093 public: 00094 OInputDevice( QObject* parent, const char* name = 0 ); 00095 ~OInputDevice(); 00096 00097 #include <opie2/oinputsystemenums.h> 00098 00099 public: 00103 QString identity() const; 00107 QString path() const; 00112 QString uniq() const; 00116 bool hasFeature( Feature ) const; 00120 bool isHeld( Key ) const; 00124 bool isHeld( Switch ) const; 00129 QString globalSwitchMask() const; 00134 QString globalKeyMask() const; 00139 static bool isValid( const QString& path ); 00140 00141 private: 00142 int _fd; 00143 input_id _id; 00144 00145 }; 00146 00147 } 00148 } 00149 00150 #endif // OINPUTSYSTEM_H 00151
1.4.2