Changeset View
Changeset View
Standalone View
Standalone View
generators/markdown/converter.h
- This file was added.
1 | /*************************************************************************** | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2017 by Julian Wolff <wolff@julianwolff.de> * | ||||
3 | * * | ||||
4 | * This program is free software; you can redistribute it and/or modify * | ||||
5 | * it under the terms of the GNU General Public License as published by * | ||||
6 | * the Free Software Foundation; either version 2 of the License, or * | ||||
7 | * (at your option) any later version. * | ||||
8 | ***************************************************************************/ | ||||
9 | | ||||
10 | #ifndef MARKDOWN_CONVERTER_H | ||||
11 | #define MARKDOWN_CONVERTER_H | ||||
12 | | ||||
13 | #include <QDir> | ||||
14 | | ||||
15 | #include <core/textdocumentgenerator.h> | ||||
16 | | ||||
17 | class QTextCursor; | ||||
18 | class QTextFrame; | ||||
19 | | ||||
20 | namespace Markdown { | ||||
21 | | ||||
22 | class Converter : public Okular::TextDocumentConverter | ||||
23 | { | ||||
24 | Q_OBJECT | ||||
25 | | ||||
26 | public: | ||||
27 | Converter(); | ||||
28 | ~Converter(); | ||||
29 | | ||||
30 | QTextDocument *convert( const QString &fileName ) override; | ||||
31 | | ||||
32 | private: | ||||
33 | void convertLinks(); | ||||
34 | void convertImages(); | ||||
35 | | ||||
36 | void convertLinks(QTextFrame *parent); | ||||
37 | void convertLinks(QTextBlock& parent); | ||||
38 | void convertImages(QTextFrame *parent); | ||||
39 | void convertImages(QTextBlock& parent); | ||||
40 | | ||||
41 | QTextDocument *mTextDocument; | ||||
42 | QDir mDir; | ||||
43 | }; | ||||
44 | | ||||
45 | } | ||||
46 | | ||||
47 | #endif |