summaryrefslogtreecommitdiffstats
path: root/tdemarkdown/markdown_part.h
diff options
context:
space:
mode:
Diffstat (limited to 'tdemarkdown/markdown_part.h')
-rw-r--r--tdemarkdown/markdown_part.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/tdemarkdown/markdown_part.h b/tdemarkdown/markdown_part.h
new file mode 100644
index 000000000..0131553d3
--- /dev/null
+++ b/tdemarkdown/markdown_part.h
@@ -0,0 +1,47 @@
+/***************************************************************************
+ * Markdown Viewer part *
+ * Copyright (c) 2022 Mavridis Philippe <mavridisf@gmail.com> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
+
+
+#ifndef __MARKDOWN_PART_H
+#define __MARKDOWN_PART_H
+
+#include <tqwidget.h>
+
+#include <tdehtml_part.h>
+
+class TDEHTMLPart;
+
+class MarkdownPart : public TDEHTMLPart
+{
+ TQ_OBJECT
+
+ public:
+ MarkdownPart(TQWidget* parentWidget, const char* widgetName,
+ TQObject* parent, const char* name, const TQStringList& args);
+ ~MarkdownPart();
+
+ /* Create and return About data */
+ static TDEAboutData* createAboutData();
+
+ /* Implemented virtual from TDEHTMLPart */
+ bool openURL(const KURL& u);
+
+ /* Parser */
+ TQString& parse(MD_CHAR* document);
+
+ private:
+ TQString m_buffer;
+
+ static void processHTML(const MD_CHAR* data, MD_SIZE data_size, void* userData);
+
+};
+
+
+#endif // __MARKDOWN_PART_H