CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkXMLEventObserver.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkXMLEventObserver_h
22 #define __ctkXMLEventObserver_h
23 
24 // QT includes
25 #include <QString>
26 #include <QXmlStreamWriter>
27 #include <QMainWindow>
28 
29 // QtTesting includes
30 #include <pqEventObserver.h>
31 #include <pqTestUtility.h>
32 
33 // CTKQtTesting includes
34 #if !defined(NO_SYMBOL_EXPORT)
35 # include "ctkQtTestingExport.h"
36 #else
37 # define CTK_QTTESTING_EXPORT
38 #endif
39 
40 
41 class QTextStream;
42 
43 //-----------------------------------------------------------------------------
44 class CTK_QTTESTING_EXPORT ctkXMLEventObserver : public pqEventObserver
45 {
46  Q_OBJECT
47 
48 public:
49  ctkXMLEventObserver(QObject* testUtility);
51 
52  virtual void setStream(QTextStream* stream);
53 
54  virtual void onRecordEvent(const QString& widget,
55  const QString& command,
56  const QString& arguments,
57  const int& eventType);
58 
60  void recordApplicationSetting(const QString& startElement,
61  const QString& attribute1,
62  const QString& attribute2,
63  const QString& attribute3);
64 protected:
65  QXmlStreamWriter* XMLStream;
66  QString XMLString;
67  pqTestUtility* TestUtility;
68 
69 };
70 
71 #endif // __ctkXMLEventObserver_h
ctkXMLEventObserver(QObject *testUtility)
void recordApplicationSetting(const QString &startElement, const QString &attribute1, const QString &attribute2, const QString &attribute3)
virtual void onRecordEvent(const QString &widget, const QString &command, const QString &arguments, const int &eventType)
void recordApplicationSettings()
QXmlStreamWriter * XMLStream
virtual void setStream(QTextStream *stream)
pqTestUtility * TestUtility