ctkCmdLineModuleXmlProgressWatcher.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKCMDLINEMODULEXMLPROGRESSWATCHER_H
  16. #define CTKCMDLINEMODULEXMLPROGRESSWATCHER_H
  17. #include "ctkCommandLineModulesCoreExport.h"
  18. #include <QObject>
  19. class ctkCmdLineModuleXmlProgressWatcherPrivate;
  20. class QIODevice;
  21. class QProcess;
  22. /**
  23. * \class ctkCmdLineModuleXmlProgressWatcher
  24. * \brief Provides progress updates of a module.
  25. * \ingroup CommandLineModulesCore
  26. */
  27. class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleXmlProgressWatcher : public QObject
  28. {
  29. Q_OBJECT
  30. public:
  31. ctkCmdLineModuleXmlProgressWatcher(QIODevice* input);
  32. ctkCmdLineModuleXmlProgressWatcher(QProcess* input);
  33. ~ctkCmdLineModuleXmlProgressWatcher();
  34. Q_SIGNALS:
  35. void filterStarted(const QString& name, const QString& comment);
  36. void filterProgress(float progress);
  37. void filterFinished(const QString& name);
  38. void filterXmlError(const QString& error);
  39. void outputDataAvailable(const QByteArray& outputData);
  40. void errorDataAvailable(const QByteArray& errorData);
  41. private:
  42. friend class ctkCmdLineModuleXmlProgressWatcherPrivate;
  43. Q_PRIVATE_SLOT(d, void _q_readyRead())
  44. Q_PRIVATE_SLOT(d, void _q_readyReadError())
  45. QScopedPointer<ctkCmdLineModuleXmlProgressWatcherPrivate> d;
  46. };
  47. #endif // CTKCMDLINEMODULEXMLPROGRESSWATCHER_H