ctkXMLEventObserver.h 2.0 KB

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