summaryrefslogtreecommitdiffstats
path: root/khotkeys/shared/voices.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /khotkeys/shared/voices.h
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khotkeys/shared/voices.h')
-rw-r--r--khotkeys/shared/voices.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/khotkeys/shared/voices.h b/khotkeys/shared/voices.h
new file mode 100644
index 000000000..b0193e7c2
--- /dev/null
+++ b/khotkeys/shared/voices.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+
+ KHotKeys
+
+ Copyright (C) 2005 Olivier Goffart <ogoffart @ kde.org>
+
+ Distributed under the terms of the GNU General Public License version 2.
+
+****************************************************************************/
+
+#ifndef VOICES_H_
+#define VOICES_H_
+
+#include <qwidget.h>
+#include <kshortcut.h>
+
+class Sound;
+class QTimer;
+class KGlobalAccel;
+
+namespace KHotKeys
+{
+
+class Voice;
+class SoundRecorder;
+
+class Voice_trigger;
+class VoiceSignature;
+
+
+class KDE_EXPORT Voice : public QObject
+ {
+ Q_OBJECT
+ public:
+ Voice( bool enabled_P, QObject* parent_P );
+ virtual ~Voice();
+ void enable( bool enable_P );
+
+ void register_handler( Voice_trigger* );
+ void unregister_handler( Voice_trigger* );
+// bool x11Event( XEvent* e );
+
+ void set_shortcut( const KShortcut &k);
+
+ /**
+ * return QString::null is a new signature is far enough from others signature
+ * otherwise, return the stringn which match.
+ */
+ QString isNewSoundFarEnough(const VoiceSignature& s, const QString& currentTrigger);
+
+ bool doesVoiceCodeExists(const QString &s);
+
+ public slots:
+ void record_start();
+ void record_stop();
+
+ private slots:
+ void slot_sound_recorded( const Sound & );
+ void slot_key_pressed();
+ void slot_timeout();
+
+ signals:
+ void handle_voice( const QString &voice );
+ private:
+
+ bool _enabled;
+ bool _recording;
+
+ QValueList<Voice_trigger *> _references;
+ SoundRecorder *_recorder;
+
+ KShortcut _shortcut;
+ KGlobalAccel *_kga;
+
+ QTimer *_timer;
+ };
+
+
+KDE_EXPORT extern Voice* voice_handler;
+
+} // namespace KHotKeys
+
+#endif