• 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
  • xmltransformer
xmltransformerproc.h
Go to the documentation of this file.
1 /***************************************************** vim:set ts=4 sw=4 sts=4:
2  Generic XML Transformation Filter Processing 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 XMLTRANSFORMERPROC_H
25 #define XMLTRANSFORMERPROC_H
26 
27 // Qt includes.
28 #include <QtCore/QObject>
29 #include <QtCore/QStringList>
30 
31 // KDE includes.
32 #include <kprocess.h>
33 
34 // KTTS includes.
35 #include "filterproc.h"
36 #include "talkercode.h"
37 
38 class XmlTransformerProc : public KttsFilterProc
39 {
40  Q_OBJECT
41 
42 public:
46  explicit XmlTransformerProc( QObject *parent, const QVariantList &args);
47 
51  virtual ~XmlTransformerProc();
52 
62  virtual bool init(KConfig *c, const QString &configGroup);
63 
74  virtual bool supportsAsync();
75 
85  virtual QString convert(const QString& inputText, TalkerCode* talkerCode, const QString& appId);
86 
101  virtual bool asyncConvert(const QString& inputText, TalkerCode* talkerCode, const QString& appId);
102 
106  virtual void waitForFinished();
107 
111  virtual int getState();
112 
116  virtual QString getOutput();
117 
121  virtual void ackFinished();
122 
127  virtual void stopFiltering();
128 
133  virtual bool wasModified();
134 
135 private slots:
136  void slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus);
137  void slotReceivedStdout();
138  void slotReceivedStderr();
139 
140 private:
141  // Process output when xsltproc exits.
142  void processOutput();
143 
144  // If not empty, only apply to text queued by an applications containing one of these strings.
145  QStringList m_appIdList;
146  // If not empty, only apply to XML that has the specified root element.
147  QStringList m_rootElementList;
148  // If not empty, only apply to XML that has the specified DOCTYPE spec.
149  QStringList m_doctypeList;
150  // The text that is being filtered.
151  QString m_text;
152  // Processing state.
153  int m_state;
154  // xsltproc process.
155  KProcess* m_xsltProc;
156  // Input and Output filenames.
157  QString m_inFilename;
158  QString m_outFilename;
159  // User's name for the filter.
160  QString m_UserFilterName;
161  // XSLT file.
162  QString m_xsltFilePath;
163  // Path to xsltproc processor.
164  QString m_xsltprocPath;
165  // Did this filter modify the text?
166  bool m_wasModified;
167 };
168 
169 #endif // XMLTRANSFORMERPROC_H
XmlTransformerProc::ackFinished
virtual void ackFinished()
Acknowledges the finished filtering.
Definition: xmltransformerproc.cpp:325
XmlTransformerProc::asyncConvert
virtual bool asyncConvert(const QString &inputText, TalkerCode *talkerCode, const QString &appId)
Convert input.
Definition: xmltransformerproc.cpp:121
QObject
XmlTransformerProc::waitForFinished
virtual void waitForFinished()
Waits for a previous call to asyncConvert to finish.
Definition: xmltransformerproc.cpp:296
XmlTransformerProc::getState
virtual int getState()
Returns the state of the Filter.
Definition: xmltransformerproc.cpp:315
filterproc.h
XmlTransformerProc
Definition: xmltransformerproc.h:38
KttsFilterProc
Definition: filterproc.h:38
talkercode.h
XmlTransformerProc::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: xmltransformerproc.cpp:345
TalkerCode
Definition: talkercode.h:38
XmlTransformerProc::init
virtual bool init(KConfig *c, const QString &configGroup)
Initialize the filter.
Definition: xmltransformerproc.cpp:65
XmlTransformerProc::XmlTransformerProc
XmlTransformerProc(QObject *parent, const QVariantList &args)
Constructor.
Definition: xmltransformerproc.cpp:49
XmlTransformerProc::supportsAsync
virtual bool supportsAsync()
Returns True if the plugin supports asynchronous processing, i.e., supports asyncConvert method...
Definition: xmltransformerproc.cpp:90
XmlTransformerProc::getOutput
virtual QString getOutput()
Returns the filtered output.
Definition: xmltransformerproc.cpp:320
XmlTransformerProc::~XmlTransformerProc
virtual ~XmlTransformerProc()
Destructor.
Definition: xmltransformerproc.cpp:58
XmlTransformerProc::convert
virtual QString convert(const QString &inputText, TalkerCode *talkerCode, const QString &appId)
Convert input, returning output.
Definition: xmltransformerproc.cpp:101
XmlTransformerProc::stopFiltering
virtual void stopFiltering()
Stops filtering.
Definition: xmltransformerproc.cpp:335
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