• 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
  • filters
  • stringreplacer
stringreplacerconf.h
Go to the documentation of this file.
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2  Generic String Replacement Filter Configuration class.
3  -------------------
4  Copyright:
5  (C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
6  -------------------
7  Original author: Gary Cramblitt <garycramblitt@comcast.net>
8 
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.
13 
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.
18 
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  ******************************************************************************/
23 
24 #ifndef STRINGREPLACERCONF_H
25 #define STRINGREPLACERCONF_H
26 
27 // Qt includes.
28 #include <QtGui/QWidget>
29 #include <QtCore/QStringList>
30 
31 // KDE includes.
32 #include <kconfig.h>
33 #include <kdebug.h>
34 
35 // KTTS includes.
36 #include "filterconf.h"
37 
38 // StringReplacer includes.
39 #include "ui_stringreplacerconfwidget.h"
40 #include "ui_editreplacementwidget.h"
41 
42 class KDialog;
43 
44 class StringReplacerConf : public KttsFilterConf, public Ui::StringReplacerConfWidget
45 {
46  Q_OBJECT
47 
48  public:
52  explicit StringReplacerConf( QWidget *parent, const QVariantList &args = QVariantList() );
53 
57  virtual ~StringReplacerConf();
58 
59  enum SubstitutionType {
60  stWord, // Word
61  stRegExp // Regular Expression
62  };
63 
82  virtual void load(KConfig *c, const QString &configGroup);
83 
94  virtual void save(KConfig *c, const QString &configGroup);
95 
103  virtual void defaults();
104 
110  virtual bool supportsMultiInstance();
111 
120  virtual QString userPlugInName();
121 
122  private slots:
123  void slotLanguageBrowseButton_clicked();
124  void slotAddButton_clicked();
125  void slotUpButton_clicked();
126  void slotDownButton_clicked();
127  void slotEditButton_clicked();
128  void slotRemoveButton_clicked();
129  void slotMatchLineEdit_textChanged(const QString& text);
130  void slotTypeButtonGroup_clicked();
131  void slotMatchButton_clicked();
132  void slotLoadButton_clicked();
133  void slotSaveButton_clicked();
134  void slotClearButton_clicked();
135 
136  // EnablesDisables buttons depending upon current item in list view.
137  void enableDisableButtons();
138 
139  private:
140  // Converts a Substitution Type to displayable string.
141  QString substitutionTypeToString(const int substitutionType);
142  // Displays the add/edit string replacement dialog.
143  void addOrEditSubstitution(bool isAdd);
144  // Loads word list and settings from a file. Clearing configuration if clear is True.
145  QString loadFromFile( const QString& filename, bool clear);
146  // Saves word list and settings to a file.
147  QString saveToFile( const QString& filename );
148 
149 
150  // Edit Dialog and widget.
151  KDialog* m_editDlg;
152  Ui::EditReplacementWidget* m_editWidget;
153  // True if kdeutils Regular Expression Editor is installed.
154  bool m_reEditorInstalled;
155  // Language Codes.
156  QStringList m_languageCodeList;
157 };
158 
159 #endif //STRINGREPLACERCONF_H
QWidget
filterconf.h
KDialog
StringReplacerConf::stWord
Definition: stringreplacerconf.h:60
StringReplacerConf::~StringReplacerConf
virtual ~StringReplacerConf()
Destructor.
Definition: stringreplacerconf.cpp:103
StringReplacerConf::StringReplacerConf
StringReplacerConf(QWidget *parent, const QVariantList &args=QVariantList())
Constructor.
Definition: stringreplacerconf.cpp:56
StringReplacerConf::SubstitutionType
SubstitutionType
Definition: stringreplacerconf.h:59
StringReplacerConf::defaults
virtual void defaults()
This function is called to set the settings in the module to sensible default values.
Definition: stringreplacerconf.cpp:348
StringReplacerConf::supportsMultiInstance
virtual bool supportsMultiInstance()
Indicates whether the plugin supports multiple instances.
Definition: stringreplacerconf.cpp:362
StringReplacerConf::save
virtual void save(KConfig *c, const QString &configGroup)
This function gets called when the user wants to save the settings in the user interface, updating the config files or wherever the configuration is stored.
Definition: stringreplacerconf.cpp:240
StringReplacerConf
Definition: stringreplacerconf.h:44
StringReplacerConf::load
virtual void load(KConfig *c, const QString &configGroup)
This method is invoked whenever the module should read its configuration (most of the times from a co...
Definition: stringreplacerconf.cpp:107
KttsFilterConf
Definition: filterconf.h:36
StringReplacerConf::userPlugInName
virtual QString userPlugInName()
Returns the name of the plugin.
Definition: stringreplacerconf.cpp:364
StringReplacerConf::stRegExp
Definition: stringreplacerconf.h:61
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