19 #ifndef LIB_QUENTIER_ENML_ENML_CONVERTER_H 20 #define LIB_QUENTIER_ENML_ENML_CONVERTER_H 22 #include <quentier/utility/Printable.h> 23 #include <quentier/utility/Linkage.h> 24 #include <quentier/utility/Macros.h> 25 #include <quentier/types/ErrorString.h> 26 #include <quentier/types/Note.h> 31 #include <QTextDocument> 35 QT_FORWARD_DECLARE_CLASS(Resource)
36 QT_FORWARD_DECLARE_CLASS(DecryptedTextManager)
37 QT_FORWARD_DECLARE_CLASS(ENMLConverterPrivate)
70 virtual QTextStream & print(QTextStream & strm)
const override;
72 QString m_elementNameToSkip;
73 ComparisonRule m_elementNameComparisonRule = ComparisonRule::Equals;
74 Qt::CaseSensitivity m_elementNameCaseSensitivity = Qt::CaseSensitive;
76 QString m_attributeNameToSkip;
77 ComparisonRule m_attributeNameComparisonRule = ComparisonRule::Equals;
78 Qt::CaseSensitivity m_attributeNameCaseSensitivity = Qt::CaseSensitive;
80 QString m_attributeValueToSkip;
81 ComparisonRule m_attributeValueComparisonRule = ComparisonRule::Equals;
82 Qt::CaseSensitivity m_attributeValueCaseSensitivity = Qt::CaseSensitive;
84 bool m_includeElementContents =
false;
87 bool htmlToNoteContent(
88 const QString & html, QString & noteContent,
91 const QVector<SkipHtmlElementRule> & skipRules = {})
const;
106 bool cleanupExternalHtml(
107 const QString & inputHtml, QString & cleanedUpHtml,
123 bool htmlToQTextDocument(
124 const QString & html, QTextDocument & doc,
126 const QVector<SkipHtmlElementRule> & skipRules = {})
const;
130 quint64 m_numEnToDoNodes = 0;
131 quint64 m_numHyperlinkNodes = 0;
132 quint64 m_numEnCryptNodes = 0;
133 quint64 m_numEnDecryptedNodes = 0;
136 bool noteContentToHtml(
137 const QString & noteContent, QString & html,
143 const QString & enml,
ErrorString & errorDescription)
const;
145 bool validateAndFixupEnml(
146 QString & enml,
ErrorString & errorDescription)
const;
148 static bool noteContentToPlainText(
149 const QString & noteContent, QString & plainText,
152 static bool noteContentToListOfWords(
153 const QString & noteContent, QStringList & listOfWords,
154 ErrorString & errorMessage, QString * plainText =
nullptr);
156 static QStringList plainTextToListOfWords(
const QString & plainText);
158 static QString toDoCheckboxHtml(
const bool checked,
const quint64 idNumber);
160 static QString encryptedTextHtml(
161 const QString & encryptedText,
const QString & hint,
162 const QString & cipher,
const size_t keyLength,
163 const quint64 enCryptIndex);
165 static QString decryptedTextHtml(
166 const QString & decryptedText,
const QString & encryptedText,
167 const QString & hint,
const QString & cipher,
168 const size_t keyLength,
const quint64 enDecryptedIndex);
170 static QString resourceHtml(
173 static void escapeString(QString &
string,
const bool simplify =
true);
211 bool exportNotesToEnex(
212 const QVector<Note> & notes,
213 const QHash<QString, QString> & tagNamesByTagLocalUids,
214 const EnexExportTags exportTagsOption,
216 const QString & version = {})
const;
238 const QString & enex, QVector<Note> & notes,
239 QHash<QString, QStringList> & tagNamesByNoteLocalUid,
240 ErrorString & errorDescription)
const;
243 Q_DISABLE_COPY(ENMLConverter)
246 ENMLConverterPrivate *
const d_ptr;
247 Q_DECLARE_PRIVATE(ENMLConverter)
252 #endif // LIB_QUENTIER_ENML_ENML_CONVERTER_H The ErrorString class encapsulates two (or more) strings which are meant to contain translatable (bas...
Definition: ErrorString.h:43
Definition: Resource.h:29
EnexExportTags
The EnexExportTags enum allows to specify whether export of note(s) to ENEX should include the names ...
Definition: ENMLConverter.h:179
The Printable class is the interface for Quentier's internal classes which should be able to write th...
Definition: Printable.h:38
Definition: DecryptedTextManager.h:30
The SkipHtmlElementRule class describes the set of rules for HTML -> ENML conversion about the HTML e...
Definition: ENMLConverter.h:60
The ENMLConverter class encapsulates a set of methods and helper data structures for performing the c...
Definition: ENMLConverter.h:44