• 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
  • libkttsd
talkercode.h
Go to the documentation of this file.
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2  Object containing a Talker Code and providing convenience
3  functions for manipulating Talker Codes.
4  For an explanation of what a Talker Code is, see speech.h.
5  -------------------
6  Copyright 2005 by Gary Cramblitt <garycramblitt@comcast.net>
7  Copyright 2009 by Jeremy Whiting <jpwhiting@kde.org>
8  -------------------
9  Original author: Gary Cramblitt <garycramblitt@comcast.net>
10 
11  This program is free software; you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 2 of the License, or
14  (at your option) any later version.
15 
16  This program is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  ******************************************************************************/
25 
26 #ifndef TALKERCODE_H
27 #define TALKERCODE_H
28 
29 // Qt includes.
30 #include <QtCore/QList>
31 #include <QtCore/QString>
32 
33 // KDE includes.
34 #include <kdemacros.h>
35 
36 class TalkerCodePrivate;
37 
38 class KDE_EXPORT TalkerCode
39 {
40  public:
44  explicit TalkerCode(const QString &code=QString(), bool normal=false);
45 
49  TalkerCode(const TalkerCode& other);
50 
54  ~TalkerCode();
55 
56  TalkerCode &operator=(const TalkerCode &other);
57 
58  bool operator==(TalkerCode &other) const;
59  bool operator!=(TalkerCode &other) const;
60 
61  typedef QList<TalkerCode> TalkerCodeList;
62 
66  QString name() const; /* user given name */
67  QString language() const; /* lang="xx" */
68  int voiceType() const; /* voiceType="xxx" equivalent to SPDVoiceType enumeration */
69  int volume() const; /* volume="xxx" */
70  int rate() const; /* rate="xxx" */
71  int pitch() const; /* pitch="xxx" */
72  QString voiceName() const; /* voice name from synthesizer */
73  QString outputModule() const; /* synthesizer="xxx" */
74 
78  QString fullLanguageCode() const;
79 
80  void setName(const QString& name);
81  void setLanguage(const QString &language);
82  void setVoiceType(int voiceType);
83  void setVolume(int volume);
84  void setRate(int rate);
85  void setPitch(int pitch);
86  void setVoiceName(const QString &voiceName);
87  void setOutputModule(const QString &moduleName);
88 
92  void setFullLanguageCode(const QString &fullLanguageCode);
93 
97  void setTalkerCode(const QString& code);
98  QString getTalkerCode() const;
99 
103  QString getTranslatedDescription() const;
104 
115  static void splitFullLanguageCode(const QString &lang, QString &languageCode, QString &countryCode);
116 
128  static QString defaultTalkerCode(const QString &fullLanguageCode, const QString &moduleName);
129 
133  static QString languageCodeToLanguage(const QString &languageCode);
134 
138  static QString translatedVoiceType(int voiceType);
139 
149  static int findClosestMatchingTalker(
150  const TalkerCodeList& talkers,
151  const QString& talker,
152  bool assumeDefaultLang = true);
153 
157  static QString stripPrefer( const QString& code, bool& preferred);
158 
159  private:
164  void parseTalkerCode(const QString &talkerCode);
165 
166  TalkerCodePrivate * const d;
167 };
168 
169 #endif // TALKERCODE_H
TalkerCode::TalkerCodeList
QList< TalkerCode > TalkerCodeList
Definition: talkercode.h:61
TalkerCode
Definition: talkercode.h:38
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