CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkXMLEventSource.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 __ctkXMLEventSource_h
22 #define __ctkXMLEventSource_h
23 
24 // QT includes
25 #include <QMainWindow>
26 #include <QXmlStreamReader>
27 
28 // QtTesting includes
29 #include <pqEventSource.h>
30 #include <pqTestUtility.h>
31 
32 // CTKQtTesting includes
33 #if !defined(NO_SYMBOL_EXPORT)
34 # include "ctkQtTestingExport.h"
35 #else
36 # define CTK_QTTESTING_EXPORT
37 #endif
38 
39 //-----------------------------------------------------------------------------
40 class CTK_QTTESTING_EXPORT ctkXMLEventSource : public pqEventSource
41 {
42  Q_OBJECT
43 
44 public:
45  typedef pqEventSource Superclass;
46 
47  ctkXMLEventSource(QObject* testUtility);
49 
50  virtual void setContent(const QString& xmlfilename);
51  int getNextEvent(QString& widget, QString& command, QString&arguments, int& eventType);
52 
53  void setRestoreSettingsAuto(bool value);
54  bool restoreSettingsAuto() const;
55 
59  QMap<QString, QString> recoverSettingsFromXML();
60 
61 private:
62  QMainWindow* mainWindow();
63 
64 protected:
65  bool Automatic;
66  QXmlStreamReader* XMLStream;
67  pqTestUtility* TestUtility;
68  QMap<QString, QString> OldSettings;
69 };
70 
71 #endif // __ctkXMLEventSource_h
QXmlStreamReader * XMLStream
ctkXMLEventSource(QObject *testUtility)
bool restoreApplicationSettings()
pqTestUtility * TestUtility
QMap< QString, QString > recoverSettingsFromXML()
QMap< QString, QString > OldSettings
bool restoreSettingsAuto() const
void setRestoreSettingsAuto(bool value)
pqEventSource Superclass
int getNextEvent(QString &widget, QString &command, QString &arguments, int &eventType)
virtual void setContent(const QString &xmlfilename)