• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeaccessibility API Reference
  • KDE Home
  • Contact Us
 

jovie

  • sources
  • kde-4.12
  • kdeaccessibility
  • jovie
  • jovie
jovie.h
Go to the documentation of this file.
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2  Jovie (KDE Text to Speech)
3 
4  The KDE Text-to-Speech API.
5  ------------------------------
6  Copyright:
7  (C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
8  (C) 2009 by Jeremy Whiting <jpwhiting@kde.org>
9  -------------------
10  Original author: Gary Cramblitt <garycramblitt@comcast.net>
11 
12  This library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU Lesser General Public
14  License as published by the Free Software Foundation; either
15  version 2 of the License, or (at your option) any later version.
16 
17  This library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  Lesser General Public License for more details.
21 
22  You should have received a copy of the GNU Lesser General Public
23  License along with this library; if not, write to the Free Software
24  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25  ******************************************************************************/
26 
27 #ifndef JOVIE_H
28 #define JOVIE_H
29 
30 // Qt includes
31 #include <QtCore/QObject>
32 #include <QtCore/QString>
33 #include <QtCore/QStringList>
34 #include <QtCore/QByteArray>
35 
36 #include <kspeech.h>
37 
38 class JoviePrivate;
39 class TalkerCode;
40 
46 class Jovie : public QObject
47 {
48 Q_OBJECT
49 public:
53  static Jovie * Instance();
54 
58  ~Jovie();
59 
60 public: // PROPERTIES
61  Q_PROPERTY(bool isSpeaking READ isSpeaking)
62  Q_PROPERTY(QString version READ version)
63 
64 public Q_SLOTS: // METHODS
69  bool isSpeaking() const;
70 
75  QString version() const;
76 
83  QString applicationName();
84 
89  void setApplicationName(const QString &applicationName);
90 
97  QString defaultTalker();
98 
103  void setDefaultTalker(const QString &defaultTalker);
104 
109  void setCurrentTalker(const TalkerCode &talker);
110 
117  int defaultPriority();
118 
125  void setDefaultPriority(int defaultPriority);
126 
141  QString sentenceDelimiter();
142 
148  void setSentenceDelimiter(const QString &sentenceDelimiter);
149 
157  bool filteringOn();
158 
164  void setFilteringOn(bool filteringOn);
165 
173  bool autoConfigureTalkersOn();
174 
179  void setAutoConfigureTalkersOn(bool autoConfigureTalkersOn);
180 
185  bool isApplicationPaused();
186 
192  QString htmlFilterXsltFile();
193 
199  void setHtmlFilterXsltFile(const QString &htmlFilterXsltFile);
200 
206  QString ssmlFilterXsltFile();
207 
213  void setSsmlFilterXsltFile(const QString &ssmlFilterXsltFile);
214 
219  bool isSystemManager();
220 
228  void setIsSystemManager(bool isSystemManager);
229 
240  int say(const QString &text, int options);
241 
259  int sayFile(const QString &filename, const QString &encoding);
260 
268  int sayClipboard();
269 
274  void pause();
275 
280  void resume();
281 
282 
283  void stop();
284  void cancel();
285 
286  QStringList outputModules();
287  QStringList languagesByModule(const QString & module);
288 
294  QStringList getPossibleTalkers();
295 
296  // runtime slots to change the current speech configuration
297  void setSpeed(int speed);
298  int speed();
299  void setPitch(int pitch);
300  int pitch();
301  void setVolume(int volume);
302  int volume();
303 
304  void setOutputModule(const QString & module);
305  void setLanguage(const QString & language);
306  void setVoiceType(int voiceType);
307  int voiceType();
308 
314  void removeJob(int jobNum);
315 
320  void removeAllJobs();
321 
328  int getSentenceCount(int jobNum);
329 
334  int getCurrentJob();
335 
350  int getJobCount(int priority);
351 
367  QStringList getJobNumbers(int priority);
368 
377  int getJobState(int jobNum);
378 
418  QByteArray getJobInfo(int jobNum);
419 
428  QString getJobSentence(int jobNum, int sentenceNum);
429 
434  QStringList getTalkerCodes();
435 
445  QString talkerToTalkerId(const QString &talker);
446 
456  int getTalkerCapabilities1(const QString &talker);
457 
467  int getTalkerCapabilities2(const QString &talker);
468 
477  QStringList getTalkerVoices(const QString &talker);
478 
485  void changeJobTalker(int jobNum, const QString &talker);
486 
497  void moveJobLater(int jobNum);
498 
515  int moveRelSentence(int jobNum, int n);
516 
521  void showManagerDialog();
522 
526  void kttsdExit();
527 
531  void init();
532 
536  void reinit();
537 
542  void setCallingAppId(const QString& appId);
543 
544 Q_SIGNALS: // SIGNALS
548  void kttsdStarted();
549 
553  void kttsdExiting();
554 
562  void jobStateChanged(const QString &appId, int jobNum, int state);
563 
575  void marker(const QString &appId, int jobNum, int markerType, const QString &markerData);
576 
577 private slots:
578  void slotJobStateChanged(const QString& appId, int jobNum, KSpeech::JobState state);
579  void slotMarker(const QString& appId, int jobNum, KSpeech::MarkerType markerType, const QString& markerData);
580  void slotFilteringFinished();
581 
582 private:
586  QString callingAppId();
587 
588  /*
589  * Checks if KTTSD is ready to speak and at least one talker is configured.
590  * If not, user is prompted to display the configuration dialog.
591  */
592  bool ready();
593 
597  bool initializeConfigData();
598 
599  /*
600  * Create and initialize the SpeechData object.
601  * Deprecated, remove in KDE 5
602  */
603  bool initializeSpeechData();
604 
605  /*
606  * Create and initialize the TalkerMgr object.
607  */
608  bool initializeTalkerMgr();
609 
610  /*
611  * Create and initialize the speaker.
612  */
613  bool initializeSpeaker();
614 
615  /*
616  * If a job number is 0, returns the default job number for a command.
617  * Returns the job number of the last job queued by the application, or if
618  * no such job, the current job number.
619  * @param jobNum The job number passed in the DBUS message. May be 0.
620  * @return Default job number. 0 if no such job.
621  */
622  int applyDefaultJobNum(int jobNum);
623 
624  /*
625  * Announces an event to kDebug.
626  */
627  void announceEvent(const QString& slotName, const QString& eventName);
628  void announceEvent(const QString& slotName, const QString& eventName, const QString& appId,
629  int jobNum, KSpeech::MarkerType markerType, const QString& markerData);
630  void announceEvent(const QString& slotName, const QString& eventName, const QString& appId,
631  int jobNum, KSpeech::JobState state);
632 
633 private:
639  Jovie(QObject *parent=0);
640 
641  JoviePrivate *d;
642  static Jovie *m_instance;
643 
644 };
645 
646 #endif // JOVIE_H
Jovie::kttsdExiting
void kttsdExiting()
This signal is emitted just before KTTS exits.
Jovie::~Jovie
~Jovie()
Destructor.
Definition: jovie.cpp:108
Jovie::getJobInfo
QByteArray getJobInfo(int jobNum)
Get information about a job.
Definition: jovie.cpp:417
Jovie::setCurrentTalker
void setCurrentTalker(const TalkerCode &talker)
Sets the current talker for all applications.
Definition: jovie.cpp:150
Jovie::reinit
void reinit()
Cause KTTSD to re-read its configuration.
Definition: jovie.cpp:499
Jovie::setVoiceType
void setVoiceType(int voiceType)
Definition: jovie.cpp:347
Jovie::pause
void pause()
Pauses speech jobs belonging to the application.
Definition: jovie.cpp:367
Jovie::htmlFilterXsltFile
QString htmlFilterXsltFile()
Returns the full path name to XSLT file used to convert HTML markup to speakable form.
Definition: jovie.cpp:205
Jovie::defaultPriority
int defaultPriority()
Returns the default priority for speech jobs submitted by the application.
Definition: jovie.cpp:160
Jovie::setOutputModule
void setOutputModule(const QString &module)
Definition: jovie.cpp:337
Jovie
Jovie – the KDE Text-to-Speech API.
Definition: jovie.h:46
Jovie::sayClipboard
int sayClipboard()
Submits a speech job from the contents of the clipboard.
Definition: jovie.cpp:260
Jovie::filteringOn
bool filteringOn()
Returns whether speech jobs for this application are filtered using configured filter plugins...
Definition: jovie.cpp:180
Jovie::removeAllJobs
void removeAllJobs()
Removes all jobs belonging to the application.
Definition: jovie.cpp:382
Jovie::removeJob
void removeJob(int jobNum)
Removes the specified job.
Definition: jovie.cpp:377
Jovie::marker
void marker(const QString &appId, int jobNum, int markerType, const QString &markerData)
This signal is emitted when a marker is processed.
Jovie::jobStateChanged
void jobStateChanged(const QString &appId, int jobNum, int state)
This signal is emitted each time the state of a job changes.
QObject
Jovie::defaultTalker
QString defaultTalker()
Returns the default talker for the application.
Definition: jovie.cpp:140
Jovie::changeJobTalker
void changeJobTalker(int jobNum, const QString &talker)
Change the talker of an already-submitted job.
Definition: jovie.cpp:460
Jovie::setIsSystemManager
void setIsSystemManager(bool isSystemManager)
Sets whether this is a System Manager application.
Definition: jovie.cpp:230
Jovie::sayFile
int sayFile(const QString &filename, const QString &encoding)
Creates and starts a speech job from a specified file.
Definition: jovie.cpp:241
Jovie::setPitch
void setPitch(int pitch)
Definition: jovie.cpp:307
Jovie::outputModules
QStringList outputModules()
Definition: jovie.cpp:277
Jovie::showManagerDialog
void showManagerDialog()
Display the KttsMgr program so that user can configure KTTS options.
Definition: jovie.cpp:477
Jovie::getCurrentJob
int getCurrentJob()
Returns the job number of the currently speaking job (any application).
Definition: jovie.cpp:393
Jovie::say
int say(const QString &text, int options)
Creates and starts a speech job.
Definition: jovie.cpp:235
Jovie::speed
int speed()
Definition: jovie.cpp:302
Jovie::setCallingAppId
void setCallingAppId(const QString &appId)
Called by DBusAdaptor so that KTTSD knows the application that called it.
Definition: jovie.cpp:514
Jovie::setDefaultPriority
void setDefaultPriority(int defaultPriority)
Sets the default priority for speech jobs submitted by the application.
Definition: jovie.cpp:165
Jovie::setHtmlFilterXsltFile
void setHtmlFilterXsltFile(const QString &htmlFilterXsltFile)
Sets the full path name to an XSLT file used to convert HTML markup to speakable form.
Definition: jovie.cpp:210
Jovie::getSentenceCount
int getSentenceCount(int jobNum)
Returns the number of sentences in a job.
Definition: jovie.cpp:387
Jovie::setSsmlFilterXsltFile
void setSsmlFilterXsltFile(const QString &ssmlFilterXsltFile)
Sets the full path name to XSLT file used to convert SSML markup to a speakable form.
Definition: jovie.cpp:220
Jovie::resume
void resume()
Resumes speech jobs belonging to the application.
Definition: jovie.cpp:372
Jovie::getTalkerCapabilities1
int getTalkerCapabilities1(const QString &talker)
Returns a bitarray giving the capabilities of a talker.
Definition: jovie.cpp:439
TalkerCode
Definition: talkercode.h:38
Jovie::moveRelSentence
int moveRelSentence(int jobNum, int n)
Advance or rewind N sentences in a job.
Definition: jovie.cpp:471
Jovie::setVolume
void setVolume(int volume)
Definition: jovie.cpp:322
Jovie::isApplicationPaused
bool isApplicationPaused()
Returns whether application is paused.
Definition: jovie.cpp:200
Jovie::getJobState
int getJobState(int jobNum)
Returns the state of a job.
Definition: jovie.cpp:411
Jovie::init
void init()
post ctor helper method that instantiates the dbus adaptor class, and registers
Definition: jovie.cpp:491
Jovie::setApplicationName
void setApplicationName(const QString &applicationName)
Sets a friendly display name for the application.
Definition: jovie.cpp:134
Jovie::talkerToTalkerId
QString talkerToTalkerId(const QString &talker)
Given a talker, returns the Talker ID for the talker.
Definition: jovie.cpp:434
Jovie::getJobNumbers
QStringList getJobNumbers(int priority)
Returns a list job numbers for the jobs belonging to the application with the specified priority...
Definition: jovie.cpp:405
Jovie::pitch
int pitch()
Definition: jovie.cpp:317
Jovie::getTalkerCodes
QStringList getTalkerCodes()
Return a list of full Talker Codes for configured talkers.
Definition: jovie.cpp:429
Jovie::stop
void stop()
Definition: jovie.cpp:357
Jovie::getJobSentence
QString getJobSentence(int jobNum, int sentenceNum)
Return a sentence of a job.
Definition: jovie.cpp:423
Jovie::voiceType
int voiceType()
Definition: jovie.cpp:352
Jovie::applicationName
QString applicationName()
Returns the friendly display name for the application.
Definition: jovie.cpp:129
Jovie::setAutoConfigureTalkersOn
void setAutoConfigureTalkersOn(bool autoConfigureTalkersOn)
Sets whether KTTSD will automatically attempt to configure new talkers to meet required talker attrib...
Definition: jovie.cpp:195
Jovie::setDefaultTalker
void setDefaultTalker(const QString &defaultTalker)
Sets the default talker for the application.
Definition: jovie.cpp:145
Jovie::Instance
static Jovie * Instance()
singleton accessor
Definition: jovie.cpp:93
Jovie::languagesByModule
QStringList languagesByModule(const QString &module)
Definition: jovie.cpp:282
Jovie::autoConfigureTalkersOn
bool autoConfigureTalkersOn()
Returns whether KTTSD will automatically attempt to configure new talkers to meet required talker att...
Definition: jovie.cpp:190
Jovie::isSpeaking
bool isSpeaking() const
Returns true if KTTSD is currently speaking.
Jovie::moveJobLater
void moveJobLater(int jobNum)
Move a job one position down in the queue so that it is spoken later.
Definition: jovie.cpp:466
Jovie::isSystemManager
bool isSystemManager()
Returns whether this is a System Manager application.
Definition: jovie.cpp:225
Jovie::setSpeed
void setSpeed(int speed)
Definition: jovie.cpp:292
Jovie::setSentenceDelimiter
void setSentenceDelimiter(const QString &sentenceDelimiter)
Sets the regular expression used to perform Sentence Boundary Detection (SBD) for the application...
Definition: jovie.cpp:175
Jovie::ssmlFilterXsltFile
QString ssmlFilterXsltFile()
Returns the full path name to XSLT file used to convert SSML markup to a speakable form...
Definition: jovie.cpp:215
Jovie::setLanguage
void setLanguage(const QString &language)
Definition: jovie.cpp:342
Jovie::sentenceDelimiter
QString sentenceDelimiter()
Returns the regular expression used to perform Sentence Boundary Detection (SBD) for the application...
Definition: jovie.cpp:170
Jovie::getJobCount
int getJobCount(int priority)
Returns the number of jobs belonging to the application with the specified job priority.
Definition: jovie.cpp:399
Jovie::volume
int volume()
Definition: jovie.cpp:332
Jovie::getTalkerCapabilities2
int getTalkerCapabilities2(const QString &talker)
Returns a bitarray giving the capabilities of a talker.
Definition: jovie.cpp:446
Jovie::kttsdStarted
void kttsdStarted()
This signal is emitted when KTTSD starts.
Jovie::version
QString version() const
Returns the version number of KTTSD.
Jovie::cancel
void cancel()
Definition: jovie.cpp:362
Jovie::getPossibleTalkers
QStringList getPossibleTalkers()
Get all possible talkers supported by speech-dispatcher configuration.
Definition: jovie.cpp:287
Jovie::setFilteringOn
void setFilteringOn(bool filteringOn)
Sets whether speech jobs for this application are filtered using configured filter plugins...
Definition: jovie.cpp:185
Jovie::getTalkerVoices
QStringList getTalkerVoices(const QString &talker)
Return a list of the voice codes of voices available in the synthesizer corresponding to a talker...
Definition: jovie.cpp:453
Jovie::kttsdExit
void kttsdExit()
Shuts down KTTSD.
Definition: jovie.cpp:484
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:32:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

jovie

Skip menu "jovie"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeaccessibility API Reference

Skip menu "kdeaccessibility API Reference"
  • jovie

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal