akregator/src

speechclient.h
00001 /*
00002     This file is part of Akregator.
00003 
00004     Copyright (C) 2005 Frank Osterfeld <frank.osterfeld at kdemail.net>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 
00025 #ifndef AKREGATOR_SPEECHCLIENT_H
00026 #define AKREGATOR_SPEECHCLIENT_H
00027 
00028 #include <kspeechsink.h>
00029 #include "kspeech_stub.h"
00030 
00031 #include <tqobject.h>
00032 
00033 class TQString;
00034 template <class T> class TQValueList;
00035 
00036 namespace Akregator
00037 {
00038 
00039 class Article;
00040 
00041 class SpeechClient : public TQObject, public KSpeech_stub, virtual public KSpeechSink
00042 {
00043 
00044     Q_OBJECT
00045   TQ_OBJECT
00046 
00047     public:
00048 
00049         static SpeechClient* self();
00050         bool isTextToSpeechInstalled() const;
00051         virtual ~SpeechClient();
00052 
00053     public slots:
00054 
00055         void slotSpeak(const TQString& text, const TQString& language);
00056         void slotSpeak(const Article& article);
00057         void slotSpeak(const TQValueList<Article>& articles);
00058         void slotAbortJobs();
00059 
00060     signals:
00061       
00063         void signalJobsStarted();
00064 
00066         void signalJobsDone();
00067 
00068         void signalActivated(bool);
00069 
00070     protected:
00071 
00072         SpeechClient();
00073         void setupSpeechSystem();
00074 
00075         ASYNC textRemoved(const TQCString& appId, uint jobNum);
00076 
00077     private:
00078      
00079         class SpeechClientPrivate;
00080         SpeechClientPrivate* d;
00081         
00082         static SpeechClient* m_self;
00083 };
00084 
00085 } // namespace Akregator
00086 
00087 #endif // AKREGATOR_SPEECHCLIENT_H