SVN_SILENT made messages (.desktop file)
[kdeaccessibility.git] / kttsd / filters / talkerchooser / talkerchooserconf.h
blob73898d02a2ae792cc2d4c20446468ebae9db03da
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2 Generic Talker Chooser Filter Configuration class.
3 -------------------
4 Copyright:
5 (C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
6 -------------------
7 Original author: Gary Cramblitt <garycramblitt@comcast.net>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 ******************************************************************************/
24 #ifndef _TALKERCHOOSERCONF_H_
25 #define _TALKERCHOOSERCONF_H_
27 // Qt includes.
28 #include <QtGui/QWidget>
30 // KDE includes.
31 #include <kconfig.h>
32 #include <kdebug.h>
34 // KTTS includes.
35 #include "filterconf.h"
36 #include "talkercode.h"
38 // TalkerChooser includes.
39 #include "ui_talkerchooserconfwidget.h"
42 class TalkerChooserConf : public KttsFilterConf, public Ui::TalkerChooserConfWidget
44 Q_OBJECT
46 public:
47 /**
48 * Constructor
50 explicit TalkerChooserConf( QWidget *parent, const QStringList &args = QStringList() );
52 /**
53 * Destructor
55 virtual ~TalkerChooserConf();
57 /**
58 * This method is invoked whenever the module should read its
59 * configuration (most of the times from a config file) and update the
60 * user interface. This happens when the user clicks the "Reset" button in
61 * the control center, to undo all of his changes and restore the currently
62 * valid settings. Note that KTTSMGR calls this when the plugin is
63 * loaded, so it not necessary to call it in your constructor.
64 * The plugin should read its configuration from the specified group
65 * in the specified config file.
66 * @param config Pointer to a KConfig object.
67 * @param configGroup Call config->setGroup with this argument before
68 * loading your configuration.
70 * When a plugin is first added to KTTSMGR, @e load will be called with
71 * a Null @e configGroup. In this case, the plugin will not have
72 * any instance-specific parameters to load, but it may still wish
73 * to load parameters that apply to all instances of the plugin.
75 virtual void load(KConfig *config, const QString &configGroup);
77 /**
78 * This function gets called when the user wants to save the settings in
79 * the user interface, updating the config files or wherever the
80 * configuration is stored. The method is called when the user clicks "Apply"
81 * or "Ok". The plugin should save its configuration in the specified
82 * group of the specified config file.
83 * @param config Pointer to a KConfig object.
84 * @param configGroup Call config->setGroup with this argument before
85 * saving your configuration.
87 virtual void save(KConfig *config, const QString &configGroup);
89 /**
90 * This function is called to set the settings in the module to sensible
91 * default values. It gets called when hitting the "Default" button. The
92 * default values should probably be the same as the ones the application
93 * uses when started without a config file. Note that defaults should
94 * be applied to the on-screen widgets; not to the config file.
96 virtual void defaults();
98 /**
99 * Indicates whether the plugin supports multiple instances. Return
100 * False if only one instance of the plugin can be configured.
101 * @return True if multiple instances are possible.
103 virtual bool supportsMultiInstance();
106 * Returns the name of the plugin. Displayed in Filters tab of KTTSMgr.
107 * If there can be more than one instance of a filter, it should return
108 * a unique name for each instance. The name should be translated for
109 * the user if possible. If the plugin is not correctly configured,
110 * return an empty string.
111 * @return Filter instance name.
113 virtual QString userPlugInName();
115 private slots:
116 void slotReEditorButton_clicked();
117 void slotTalkerButton_clicked();
118 void slotLoadButton_clicked();
119 void slotSaveButton_clicked();
120 void slotClearButton_clicked();
122 private:
123 // True if kdeutils Regular Expression Editor is installed.
124 bool m_reEditorInstalled;
125 // User's chosen Talker Code.
126 TalkerCode m_talkerCode;
129 #endif //_TALKERCHOOSERCONF_H_