converter_p.hh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
  2. // vi:set ts=4 sts=4 sw=4 noet :
  3. //
  4. // Copyright 2010-2020 wkhtmltopdf authors
  5. //
  6. // This file is part of wkhtmltopdf.
  7. //
  8. // wkhtmltopdf is free software: you can redistribute it and/or modify
  9. // it under the terms of the GNU Lesser General Public License as published by
  10. // the Free Software Foundation, either version 3 of the License, or
  11. // (at your option) any later version.
  12. //
  13. // wkhtmltopdf is distributed in the hope that it will be useful,
  14. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. // GNU General Public License for more details.
  17. //
  18. // You should have received a copy of the GNU Lesser General Public License
  19. // along with wkhtmltopdf. If not, see <http://www.gnu.org/licenses/>.
  20. #ifndef __CONVERTER_P_HH__
  21. #define __CONVERTER_P_HH__
  22. #include "converter.hh"
  23. #include "websettings.hh"
  24. #include <QFile>
  25. #include <QWebSettings>
  26. #include "dllbegin.inc"
  27. namespace wkhtmltopdf {
  28. class DLL_LOCAL ConverterPrivate: public QObject {
  29. Q_OBJECT
  30. public:
  31. void copyFile(QFile & src, QFile & dst);
  32. QList<QString> phaseDescriptions;
  33. int currentPhase;
  34. QString progressString;
  35. protected:
  36. bool error;
  37. virtual void clearResources() = 0;
  38. virtual Converter & outer() = 0;
  39. int errorCode;
  40. bool conversionDone;
  41. void updateWebSettings(QWebSettings * ws, const settings::Web & s) const;
  42. public slots:
  43. void fail();
  44. void loadProgress(int progress);
  45. virtual void beginConvert() = 0;
  46. void cancel();
  47. bool convert();
  48. void forwardError(QString error);
  49. void forwardWarning(QString warning);
  50. private:
  51. friend class Converter;
  52. };
  53. }
  54. #include "dllend.inc"
  55. #endif //__CONVERTER_P_HH__