lib
KoSpeaker Class Reference
#include <KoSpeaker.h>
Detailed Description
KoSpeaker is a singleton object that provides Text-to-Speech services for KOffice applications.When activated, it will speak the text of widgets under the mouse pointer and/or the the widget with focus.
It also provides some methods for speaking text from documents.
IMPORTANT: This class will be removed from KOffice when KOffice is converted to KDE4. It will be replaced with a proper screen reading capability using the AT-SPI.
This is quite a hack and doesn't work reliably. The following are current problems: 1. Cannot speak menu items in a QMenuBar (top menu of app). 2. Doesn't understand every possible widget.
This capability is not intended for completely blind users. Such users cannot use KDE 3.x anyway, since it lacks a screen reader. Instead, this capability is intended as an aid to users with other vision disabilities.
KOffice applications can access this object using the kospeaker global.
Definition at line 63 of file KoSpeaker.h.
Public Types | |
enum | SpeakFlags { SpeakFocusWidget = 0x0001, SpeakPointerWidget = 0x0002, SpeakWhatsThis = 0x0004, SpeakTooltip = 0x0008, SpeakAccelerator = 0x0010, SpeakDisabled = 0x0020 } |
Signals | |
void | customSpeakNewWidget (QWidget *w, const QPoint &p, uint flags) |
void | customSpeakWidget (QWidget *w, const QPoint &p, uint flags) |
Public Member Functions | |
KoSpeaker () | |
~KoSpeaker () | |
bool | isEnabled () const |
void | readConfig (KConfig *config) |
bool | maybeSayWidget (QWidget *w, const QPoint &pos=QPoint()) |
bool | sayWidget (const QString &msg) |
void | cancelSpeakWidget () |
void | queueSpeech (const QString &msg, const QString &langCode=QString(), bool first=true) |
void | startSpeech () |
Static Public Member Functions | |
static bool | isKttsdInstalled () |
static KoSpeaker * | koSpeaker () |
Static Protected Attributes | |
static KoSpeaker * | KSpkr = 0L |
Member Enumeration Documentation
|
Speech Options.
Definition at line 71 of file KoSpeaker.h. |
Member Function Documentation
|
Cancels speaking of widget. Usually called by slots that receive customSpeakNewWidget signal when they wish to speak the widget themselves. |
|
This signal is emitted whenever a new widget has received focus or the mouse pointer has moved to a new widget. If a receiver wishes to handle speaking of the widget itself, it should call cancelSpeakWidget() .
|
|
This signal is emitted each polling interval when KoSpeaker did not speak the widget (either because it did not think the widget was a new one or because it did not understand the widget). If both mouse pointer and focus flags are set, it may emit twice per polling interval.
|
|
Returns true if TTS services are available. If KTTSD daemon is not running, it is started. Will return false if: -- KTTSD daemon is not installed, or -- Was not able to start KTTSD daemon for some reason. Definition at line 130 of file KoSpeaker.cpp. |
|
Returns whether the KTTSD deamon is installed in the system. If not, apps should disable or hide options/commands to speak. Definition at line 476 of file KoSpeaker.cpp. |
|
Returns the KoSpeaker object singleton. Apps should use "kospeaker" rather than this function directly. Definition at line 145 of file KoSpeaker.h. |
|
Given a widget
If Definition at line 219 of file KoSpeaker.cpp. |
|
Queue a
The text is encoded in the Definition at line 157 of file KoSpeaker.cpp. |
|
Reads configuration options from If KTTSD daemon is not installed, isEnabled will return false. If screen reader is requested and KTTSD is installed, but not running, it will be started. Definition at line 196 of file KoSpeaker.cpp. |
|
Speak a Speaks using ScreenReaderOutput, which has highest priority, and therefore, should only be be used in very time-sensitive contexts and for short messages. Certain standard substitutions are performed on the message. For example, "Ctrl+" becomes "control plus". "Qt" markup is stripped.
Definition at line 430 of file KoSpeaker.cpp. |
|
Start speaking queued text job (if any).
Definition at line 190 of file KoSpeaker.cpp. |
The documentation for this class was generated from the following files: