• 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
stringreplacerproc.h
Go to the documentation of this file.
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2  Generic String Replacement Filter Processing class.
3  This is the interface definition for text filters.
4  -------------------
5  Copyright:
6  (C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
7  -------------------
8  Original author: Gary Cramblitt <garycramblitt@comcast.net>
9 
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23  ******************************************************************************/
24 
25 #ifndef STRINGREPLACERPROC_H
26 #define STRINGREPLACERPROC_H
27 
28 // Qt includes.
29 #include <QtCore/QObject>
30 #include <QtCore/QTextStream>
31 #include <QtCore/QRegExp>
32 #include <QtCore/QStringList>
33 
34 // KTTS includes.
35 #include "filterproc.h"
36 
37 class StringReplacerProc : public KttsFilterProc
38 {
39  Q_OBJECT
40 
41 public:
45  explicit StringReplacerProc( QObject *parent, QVariantList list = QVariantList() );
46 
50  virtual ~StringReplacerProc();
51 
61  virtual bool init(KConfig *c, const QString &configGroup);
62 
72  virtual QString convert(const QString& inputText, TalkerCode* talkerCode, const QString& appId);
73 
78  virtual bool wasModified();
79 
80 private:
81  // Language codes supported by the filter.
82  QStringList m_languageCodeList;
83  // If not empty, apply filter only to apps containing one or more of these strings.
84  QStringList m_appIdList;
85 
86  // List of regular expressions to match.
87  QList<QRegExp> m_matchList;
88  // List of substitutions to replace matches.
89  QList<QString> m_substList;
90  // True if this filter did anything to the text.
91  bool m_wasModified;
92 };
93 
94 #endif // STRINGREPLACERPROC_H
QObject
filterproc.h
KttsFilterProc
Definition: filterproc.h:38
StringReplacerProc
Definition: stringreplacerproc.h:37
StringReplacerProc::StringReplacerProc
StringReplacerProc(QObject *parent, QVariantList list=QVariantList())
Constructor.
Definition: stringreplacerproc.cpp:48
TalkerCode
Definition: talkercode.h:38
StringReplacerProc::convert
virtual QString convert(const QString &inputText, TalkerCode *talkerCode, const QString &appId)
Convert input, returning output.
Definition: stringreplacerproc.cpp:176
StringReplacerProc::~StringReplacerProc
virtual ~StringReplacerProc()
Destructor.
Definition: stringreplacerproc.cpp:56
StringReplacerProc::init
virtual bool init(KConfig *c, const QString &configGroup)
Initialize the filter.
Definition: stringreplacerproc.cpp:62
StringReplacerProc::wasModified
virtual bool wasModified()
Did this filter do anything? If the filter returns the input as output unmolested, it should return False when this method is called.
Definition: stringreplacerproc.cpp:234
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