Fix include
[kdeaccessibility.git] / kttsd / plugins / command / commandconf.h
blobd1eb70be50637c79281558f558223b55fdb51321
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2 Configuration for the Command Plug in
3 -------------------
4 Copyright : (C) 2002,2004 by Gunnar Schmi Dt and Gary Cramblitt
5 -------------------
6 Original author: Gunnar Schmi Dt <kmouth@schmi-dt.de>
7 Current Maintainer: Gary Cramblitt <garycramblitt@comcast.net>
8 ******************************************************************************/
10 /***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; version 2 of the License. *
15 * *
16 ***************************************************************************/
18 #ifndef _COMMANDCONF_H_
19 #define _COMMANDCONF_H_
21 // Qt includes.
24 // KDE includes.
25 #include <kconfig.h>
27 // KTTS includes.
28 #include <pluginconf.h>
30 // Command Plugin includes.
31 #include "ui_commandconfwidget.h"
33 class CommandProc;
34 class KProgressDialog;
36 class CommandConf : public PlugInConf, public Ui::CommandConfWidget {
37 Q_OBJECT
39 public:
40 /** Constructor */
41 CommandConf( QWidget* parent = 0, const QStringList &args = QStringList());
43 /** Destructor */
44 ~CommandConf();
46 /** This method is invoked whenever the module should read its
47 * configuration (most of the times from a config file) and update the
48 * user interface. This happens when the user clicks the "Reset" button in
49 * the control center, to undo all of his changes and restore the currently
50 * valid settings. NOTE that this is not called after the modules is loaded,
51 * so you probably want to call this method in the constructor.
53 void load(KConfig *config, const QString &configGroup);
55 /** This function gets called when the user wants to save the settings in
56 * the user interface, updating the config files or wherever the
57 * configuration is stored. The method is called when the user clicks "Apply"
58 * or "Ok".
60 void save(KConfig *config, const QString &configGroup);
62 /** This function is called to set the settings in the module to sensible
63 * default values. It gets called when hitting the "Default" button. The
64 * default values should probably be the same as the ones the application
65 * uses when started without a config file.
67 void defaults();
69 /**
70 * This function informs the plugin of the desired language to be spoken
71 * by the plugin. The plugin should attempt to adapt itself to the
72 * specified language code, choosing sensible defaults if necessary.
73 * If the passed-in code is QString(), no specific language has
74 * been chosen.
75 * @param lang The desired language code or Null if none.
77 * If the plugin is unable to support the desired language, that is OK.
78 * Language codes are given by ISO 639-1 and are in lowercase.
79 * The code may also include an ISO 3166 country code in uppercase
80 * separated from the language code by underscore (_). For
81 * example, en_GB. If your plugin supports the given language, but
82 * not the given country, treat it as though the country
83 * code were not specified, i.e., adapt to the given language.
85 void setDesiredLanguage(const QString &lang);
87 /**
88 * Return fully-specified talker code for the configured plugin. This code
89 * uniquely identifies the configured instance of the plugin and distinquishes
90 * one instance from another. If the plugin has not been fully configured,
91 * i.e., cannot yet synthesize, return QString().
92 * @return Fully-specified talker code.
94 QString getTalkerCode();
96 private slots:
97 void configChanged(){
98 // kDebug() << "CommandConf::configChanged: Running" << endl;
99 emit changed(true);
101 void slotCommandTest_clicked();
102 void slotSynthFinished();
103 void slotSynthStopped();
105 private:
106 QString m_languageCode;
108 // Command synthesizer.
109 CommandProc* m_commandProc;
110 // Synthesized wave file name.
111 QString m_waveFile;
112 // Progress dialog.
113 KProgressDialog* m_progressDlg;
114 // Codec list.
115 QStringList m_codecList;
117 #endif // _COMMANDCONF_H_