KoSpeaker.h
Go to the documentation of this file.
1
24#ifndef KOSPEAKER_H
25#define KOSPEAKER_H
26
27// TQt includes.
28#include <tqobject.h>
29#include <tqstring.h>
30
31// KDE includes.
32#include <ksharedptr.h>
33
34// KOffice includes.
35#include <koffice_export.h>
36
37class TQWidget;
38class TQPoint;
39class TDEConfig;
40class KoSpeakerPrivate;
41
42#define kospeaker KoSpeaker::koSpeaker()
43
63class KOFFICECORE_EXPORT KoSpeaker : public TQObject, public TDEShared
64{
65 TQ_OBJECT
66
67public:
68 KoSpeaker();
69 ~KoSpeaker();
70
73 SpeakFocusWidget = 0x0001 ,
74 SpeakPointerWidget = 0x0002 ,
75 SpeakWhatsThis = 0x0004 ,
76 SpeakTooltip = 0x0008 ,
77 SpeakAccelerator = 0x0010 ,
78 SpeakDisabled = 0x0020
79 };
80
87 bool isEnabled() const;
88
95 void readConfig(TDEConfig* config);
96
103 bool maybeSayWidget(TQWidget* w, const TQPoint& pos = TQPoint());
104
114 bool sayWidget(const TQString& msg);
115
121
129 void queueSpeech(const TQString& msg, const TQString& langCode = TQString(), bool first = true);
130
134 void startSpeech();
135
140 static bool isKttsdInstalled();
141
146 static KoSpeaker* koSpeaker() { return KSpkr; }
147
148signals:
160 void customSpeakNewWidget(TQWidget* w, const TQPoint& p, uint flags);
161
173 void customSpeakWidget(TQWidget* w, const TQPoint& p, uint flags);
174
175protected:
176 static KoSpeaker* KSpkr;
177
178private slots:
183 void probe();
184
185private:
186 // int menuBarItemAt(TQMenuBar* m, const TQPoint& p);
187
188 // Start the KTTSD daemon if not already running.
189 bool startKttsd();
190 // Return the KTTSD daemon version string.
191 TQString getKttsdVersion();
192
193 // These methods correspond to dcop interface in tdelibs/interfaces/kspeech/kspeech.h.
194 // They use manual marshalling, instead of using kspeech_stub, because KOffice
195 // supports KDE 3.3 and above and kspeech.h didn't appear until 3.4.
196 void sayScreenReaderOutput(const TQString &msg, const TQString &talker);
197 uint setText(const TQString &text, const TQString &talker);
198 int appendText(const TQString &text, uint jobNum=0);
199 void startText(uint jobNum=0);
200 void removeText(uint jobNum=0);
201
202 KoSpeakerPrivate* d;
203};
204
205#endif // H_KOSPEAKER
KoSpeaker is a singleton object that provides Text-to-Speech services for KOffice applications.
Definition KoSpeaker.h:64
void customSpeakWidget(TQWidget *w, const TQPoint &p, uint flags)
This signal is emitted each polling interval when KoSpeaker did not speak the widget (either because ...
void customSpeakNewWidget(TQWidget *w, const TQPoint &p, uint flags)
This signal is emitted whenever a new widget has received focus or the mouse pointer has moved to a n...
static KoSpeaker * koSpeaker()
Returns the KoSpeaker object singleton.
Definition KoSpeaker.h:146
SpeakFlags
Speech Options.
Definition KoSpeaker.h:72
void cancelSpeakWidget()
Cancels speaking of widget.