htmltemplatehelper.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef HTMLTEMPLATEHELPER_H
  2. #define HTMLTEMPLATEHELPER_H
  3. #include <QString>
  4. namespace vnotex
  5. {
  6. class MarkdownEditorConfig;
  7. // Global options to be passed to Web side at the very beginning.
  8. struct WebGlobalOptions
  9. {
  10. bool m_webPlantUml = true;
  11. bool m_webGraphviz = true;
  12. bool m_sectionNumberEnabled = true;
  13. bool m_constrainImageWidthEnabled = true;
  14. bool m_protectFromXss = false;
  15. bool m_htmlTagEnabled = true;
  16. bool m_autoBreakEnabled = false;
  17. bool m_linkifyEnabled = true;
  18. QString toJavascriptObject() const;
  19. };
  20. // Help to generate and update HTML templates.
  21. class HtmlTemplateHelper
  22. {
  23. public:
  24. HtmlTemplateHelper() = delete;
  25. static const QString &getMarkdownViewerTemplate();
  26. static void updateMarkdownViewerTemplate(const MarkdownEditorConfig &p_config);
  27. private:
  28. struct Template
  29. {
  30. int m_revision = -1;
  31. QString m_template;
  32. };
  33. // Template for MarkdownViewer.
  34. static Template s_markdownViewerTemplate;
  35. };
  36. }
  37. #endif // HTMLTEMPLATEHELPER_H