converter.hh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 Lesser 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 Lesser 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/loadsettings.hh>
  21. #include <wkhtmltox/dllbegin.inc>
  22. namespace wkhtmltopdf {
  23. class DLL_LOCAL ConverterPrivate;
  24. class DLL_PUBLIC Converter: public QObject {
  25. Q_OBJECT
  26. public:
  27. virtual ~Converter() {};
  28. int currentPhase();
  29. int phaseCount();
  30. QString phaseDescription(int phase=-1);
  31. QString progressString();
  32. int httpErrorCode();
  33. signals:
  34. void warning(const QString & message);
  35. void error(const QString & message);
  36. void phaseChanged();
  37. void progressChanged(int progress);
  38. void finished(bool ok);
  39. void checkboxSvgChanged(const QString & path);
  40. void checkboxCheckedSvgChanged(const QString & path);
  41. void radiobuttonSvgChanged(const QString & path);
  42. void radiobuttonCheckedSvgChanged(const QString & path);
  43. public slots:
  44. void beginConvertion();
  45. bool convert();
  46. void cancel();
  47. protected:
  48. void emitCheckboxSvgs(const settings::LoadPage & ls);
  49. virtual ConverterPrivate & priv() = 0;
  50. friend class ConverterPrivate;
  51. };
  52. }
  53. #include <wkhtmltox/dllend.inc>
  54. #endif //__CONVERTER_HH__