lib
KoSpeaker.hGo to the documentation of this file.00001
00024 #ifndef KOSPEAKER_H
00025 #define KOSPEAKER_H
00026
00027
00028 #include <qobject.h>
00029 #include <qstring.h>
00030
00031
00032 #include <ksharedptr.h>
00033
00034
00035 #include <koffice_export.h>
00036
00037 class QWidget;
00038 class QPoint;
00039 class KConfig;
00040 class KoSpeakerPrivate;
00041
00042 #define kospeaker KoSpeaker::koSpeaker()
00043
00063 class KOFFICECORE_EXPORT KoSpeaker : public QObject, public KShared
00064 {
00065 Q_OBJECT
00066 public:
00067 KoSpeaker();
00068 ~KoSpeaker();
00069
00071 enum SpeakFlags {
00072 SpeakFocusWidget = 0x0001 ,
00073 SpeakPointerWidget = 0x0002 ,
00074 SpeakWhatsThis = 0x0004 ,
00075 SpeakTooltip = 0x0008 ,
00076 SpeakAccelerator = 0x0010 ,
00077 SpeakDisabled = 0x0020
00078 };
00079
00086 bool isEnabled() const;
00087
00094 void readConfig(KConfig* config);
00095
00102 bool maybeSayWidget(QWidget* w, const QPoint& pos = QPoint());
00103
00113 bool sayWidget(const QString& msg);
00114
00119 void cancelSpeakWidget();
00120
00128 void queueSpeech(const QString& msg, const QString& langCode = QString(), bool first = true);
00129
00133 void startSpeech();
00134
00139 static bool isKttsdInstalled();
00140
00145 static KoSpeaker* koSpeaker() { return KSpkr; }
00146
00147 signals:
00159 void customSpeakNewWidget(QWidget* w, const QPoint& p, uint flags);
00160
00172 void customSpeakWidget(QWidget* w, const QPoint& p, uint flags);
00173
00174 protected:
00175 static KoSpeaker* KSpkr;
00176
00177 private slots:
00182 void probe();
00183
00184 private:
00185
00186
00187
00188 bool startKttsd();
00189
00190 QString getKttsdVersion();
00191
00192
00193
00194
00195 void sayScreenReaderOutput(const QString &msg, const QString &talker);
00196 uint setText(const QString &text, const QString &talker);
00197 int appendText(const QString &text, uint jobNum=0);
00198 void startText(uint jobNum=0);
00199 void removeText(uint jobNum=0);
00200
00201 KoSpeakerPrivate* d;
00202 };
00203
00204 #endif // H_KOSPEAKER
|