kttsd Library API Documentation

talkercode.h

00001 /***************************************************** vim:set ts=4 sw=4 sts=4:
00002   Object containing a Talker Code and providing convenience
00003   functions for manipulating Talker Codes.
00004   For an explanation of what a Talker Code is, see speech.h. 
00005   -------------------
00006   Copyright : (C) 2004 by Gary Cramblitt <garycramblitt@comcast.net>
00007   -------------------
00008   Original author: Gary Cramblitt <garycramblitt@comcast.net>
00009   Current Maintainer: Gary Cramblitt <garycramblitt@comcast.net>
00010  ******************************************************************************/
00011 
00012 /***************************************************************************
00013  *                                                                         *
00014  *   This program is free software; you can redistribute it and/or modify  *
00015  *   it under the terms of the GNU General Public License as published by  *
00016  *   the Free Software Foundation; version 2 of the License.               *
00017  *                                                                         *
00018  ***************************************************************************/
00019 
00020 #ifndef _TALKERCODE_H_
00021 #define _TALKERCODE_H_
00022 
00023 // Qt includes.
00024 #include <qstring.h>
00025 
00026 class TalkerCode
00027 {
00028     public:
00032         TalkerCode(const QString &code=QString::null, bool normal=false);
00036         TalkerCode(TalkerCode* talker, bool normal=false);
00037 
00041         ~TalkerCode();
00042 
00046         QString languageCode();       /* lang="xx" */
00047         QString countryCode();        /* lang="yy_xx */
00048         QString voice();              /* name="xxx" */
00049         QString gender();             /* gender="xxx" */
00050         QString volume();             /* volume="xxx" */
00051         QString rate();               /* rate="xxx" */
00052         QString plugInName();         /* synthesizer="xxx" */
00053 
00057         QString fullLanguageCode();
00058 
00059         void setLanguageCode(const QString &languageCode);
00060         void setCountryCode(const QString &countryCode);
00061         void setVoice(const QString &voice);
00062         void setGender(const QString &gender);
00063         void setVolume(const QString &volume);
00064         void setRate(const QString &rate);
00065         void setPlugInName(const QString plugInName);
00066 
00070         void setFullLanguageCode(const QString &fullLanguageCode);
00071 
00075         QString getTalkerCode();
00076 
00080         void normalize();
00081 
00089         static QString normalizeTalkerCode(const QString &talkerCode, QString &fullLanguageCode);
00090 
00101         static void splitFullLanguageCode(const QString &lang, QString &languageCode, QString &countryCode);
00102 
00114         static QString defaultTalkerCode(const QString &fullLanguageCode, const QString &plugInName);
00115 
00119         static QString languageCodeToLanguage(const QString &languageCode);
00120 
00124         static QString translatedGender(const QString &gender);
00125         static QString translatedVolume(const QString &volume);
00126         static QString translatedRate(const QString &rate);
00127 
00128     private:
00133         void parseTalkerCode(const QString &talkerCode);
00134 
00135         QString m_languageCode;       /* lang="xx" */
00136         QString m_countryCode;        /* lang="yy_xx */
00137         QString m_voice;              /* name="xxx" */
00138         QString m_gender;             /* gender="xxx" */
00139         QString m_volume;             /* volume="xxx" */
00140         QString m_rate;               /* rate="xxx" */
00141         QString m_plugInName;         /* synthesizer="xxx" */
00142 };
00143 
00144 #endif      // _TALKERCODE_H_
KDE Logo
This file is part of the documentation for kttsd Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Dec 12 14:37:18 2004 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003