converter.hh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2010 wkhtmltopdf authors
  2. //
  3. // This file is part of wkhtmltopdf.
  4. //
  5. // wkhtmltopdf is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // wkhtmltopdf is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with wkhtmltopdf. If not, see <http://www.gnu.org/licenses/>.
  17. #ifndef __CONVERTER_HH__
  18. #define __CONVERTER_HH__
  19. #include <QObject>
  20. #include <wkhtmltox/dllbegin.inc>
  21. namespace wkhtmltopdf {
  22. class DLL_LOCAL ConverterPrivate;
  23. class DLL_PUBLIC Converter: public QObject {
  24. Q_OBJECT
  25. public:
  26. virtual ~Converter() {};
  27. int currentPhase();
  28. int phaseCount();
  29. QString phaseDescription(int phase=-1);
  30. QString progressString();
  31. int httpErrorCode();
  32. signals:
  33. void warning(const QString & message);
  34. void error(const QString & message);
  35. void phaseChanged();
  36. void progressChanged(int progress);
  37. void finished(bool ok);
  38. public slots:
  39. void beginConvertion();
  40. bool convert();
  41. void cancel();
  42. protected:
  43. virtual ConverterPrivate & priv() = 0;
  44. friend class ConverterPrivate;
  45. };
  46. }
  47. #include <wkhtmltox/dllend.inc>
  48. #endif //__CONVERTER_HH__