1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2 Standard Sentence Boundary Detection Filter Configuration class.
5 (C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
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 ******************************************************************************/
28 #include <QtGui/QWidget>
35 #include "filterconf.h"
38 #include "ui_sbdconfwidget.h"
40 class SbdConf
: public KttsFilterConf
, public Ui::SbdConfWidget
48 explicit SbdConf( QWidget
*parent
, const QStringList
&args
= QStringList() );
56 * This method is invoked whenever the module should read its
57 * configuration (most of the times from a config file) and update the
58 * user interface. This happens when the user clicks the "Reset" button in
59 * the control center, to undo all of his changes and restore the currently
60 * valid settings. Note that KTTSMGR calls this when the plugin is
61 * loaded, so it not necessary to call it in your constructor.
62 * The plugin should read its configuration from the specified group
63 * in the specified config file.
64 * @param config Pointer to a KConfig object.
65 * @param configGroup Call config->setGroup with this argument before
66 * loading your configuration.
68 * When a plugin is first added to KTTSMGR, @e load will be called with
69 * a Null @e configGroup. In this case, the plugin will not have
70 * any instance-specific parameters to load, but it may still wish
71 * to load parameters that apply to all instances of the plugin.
73 virtual void load(KConfig
*config
, const QString
&configGroup
);
76 * This function gets called when the user wants to save the settings in
77 * the user interface, updating the config files or wherever the
78 * configuration is stored. The method is called when the user clicks "Apply"
79 * or "Ok". The plugin should save its configuration in the specified
80 * group of the specified config file.
81 * @param config Pointer to a KConfig object.
82 * @param configGroup Call config->setGroup with this argument before
83 * saving your configuration.
85 virtual void save(KConfig
*config
, const QString
&configGroup
);
88 * This function is called to set the settings in the module to sensible
89 * default values. It gets called when hitting the "Default" button. The
90 * default values should probably be the same as the ones the application
91 * uses when started without a config file. Note that defaults should
92 * be applied to the on-screen widgets; not to the config file.
94 virtual void defaults();
97 * Indicates whether the plugin supports multiple instances. Return
98 * False if only one instance of the plugin can be configured.
99 * @return True if multiple instances are possible.
101 virtual bool supportsMultiInstance();
104 * Returns the name of the plugin. Displayed in Filters tab of KTTSMgr.
105 * If there can be more than one instance of a filter, it should return
106 * a unique name for each instance. The name should be translated for
107 * the user if possible. If the plugin is not correctly configured,
108 * return an empty string.
109 * @return Filter instance name.
111 virtual QString
userPlugInName();
114 * Returns True if this filter is a Sentence Boundary Detector.
115 * @return True if this filter is a SBD.
117 virtual bool isSBD();
120 void slotReButton_clicked();
121 void slotLanguageBrowseButton_clicked();
122 void slotLoadButton_clicked();
123 void slotSaveButton_clicked();
124 void slotClearButton_clicked();
127 // True if kdeutils Regular Expression Editor is installed.
128 bool m_reEditorInstalled
;
130 QStringList m_languageCodeList
;