The IConverter interface encapsulates a set of methods performing conversions between ENML and other note content formats, namely HTML.
More...
#include <IConverter.h>
|
| enum class | EnexExportTags { Yes = 0
, No
} |
| | The EnexExportTags enum allows to specify whether export of note(s) to ENEX should include the names of note's tags or not.
|
| |
|
| virtual Result< QString, ErrorString > | convertHtmlToEnml (const QString &html, IDecryptedTextCache &decryptedTextCache, const QList< conversion_rules::ISkipRulePtr > &skipRules={}) const =0 |
| |
| virtual Result< void, ErrorString > | convertHtmlToDoc (const QString &html, QTextDocument &doc, const QList< conversion_rules::ISkipRulePtr > &skipRules={}) const =0 |
| |
| virtual Result< QString, ErrorString > | convertHtmlToXml (const QString &html) const =0 |
| |
| virtual Result< QString, ErrorString > | convertHtmlToXhtml (const QString &html) const =0 |
| |
| virtual Result< IHtmlDataPtr, ErrorString > | convertEnmlToHtml (const QString &enml, IDecryptedTextCache &decryptedTextCache) const =0 |
| |
| virtual Result< QString, ErrorString > | convertEnmlToPlainText (const QString &enml) const =0 |
| |
| virtual Result< QStringList, ErrorString > | convertEnmlToWordsList (const QString &enml) const =0 |
| |
| virtual QStringList | convertPlainTextToWordsList (const QString &plainText) const =0 |
| |
| virtual Result< void, ErrorString > | validateEnml (const QString &enml) const =0 |
| |
| virtual Result< QString, ErrorString > | validateAndFixupEnml (const QString &enml) const =0 |
| |
| virtual Result< QString, ErrorString > | exportNotesToEnex (const QList< qevercloud::Note > ¬es, const QHash< QString, QString > &tagNamesByTagLocalIds, EnexExportTags exportTagsOption, const QString &version={}) const =0 |
| |
| virtual Result< QList< qevercloud::Note >, ErrorString > | importEnex (const QString &enex) const =0 |
| |
The IConverter interface encapsulates a set of methods performing conversions between ENML and other note content formats, namely HTML.
◆ convertEnmlToHtml()
Converts ENML into HTML representation of note content
- Parameters
-
| enml | ENML representation of note content |
| decryptedTextCache | cache of decrypted text fragments |
- Returns
- Result with HTML data in case of success or error string in case of failure
◆ convertEnmlToPlainText()
| virtual Result< QString, ErrorString > quentier::enml::IConverter::convertEnmlToPlainText |
( |
const QString & | enml | ) |
const |
|
nodiscardpure virtual |
Converts ENML into plain text representation of note content
- Parameters
-
| enml | ENML representation of note content |
- Returns
- Result with plain text representation of note content in case of success or error string in case of failure
◆ convertEnmlToWordsList()
| virtual Result< QStringList, ErrorString > quentier::enml::IConverter::convertEnmlToWordsList |
( |
const QString & | enml | ) |
const |
|
nodiscardpure virtual |
Converts ENML into a list of words
- Parameters
-
| enml | ENML representation of note content |
- Returns
- Result with list of words in case of success or error string in case of failure
◆ convertHtmlToDoc()
| virtual Result< void, ErrorString > quentier::enml::IConverter::convertHtmlToDoc |
( |
const QString & | html, |
|
|
QTextDocument & | doc, |
|
|
const QList< conversion_rules::ISkipRulePtr > & | skipRules = {} ) const |
|
nodiscardpure virtual |
Convert HTML representation of note content into QTextDocument
- Parameters
-
| html | HTML representation of note content |
| doc | QTextDocument into which the converted note content is put |
| skipRules | skip rules to be used during the conversion |
- Returns
- Valid result in case of success or error string in case of failure
◆ convertHtmlToEnml()
| virtual Result< QString, ErrorString > quentier::enml::IConverter::convertHtmlToEnml |
( |
const QString & | html, |
|
|
IDecryptedTextCache & | decryptedTextCache, |
|
|
const QList< conversion_rules::ISkipRulePtr > & | skipRules = {} ) const |
|
nodiscardpure virtual |
Converts HTML representation of note content into ENML
- Parameters
-
| html | HTML representation of note content |
| decryptedTextCache | cache of decrypted text fragments |
| skipRules | skip rules to be used during the conversion |
- Returns
- Result with ENML in case of success or error string in case of failure
◆ convertHtmlToXhtml()
| virtual Result< QString, ErrorString > quentier::enml::IConverter::convertHtmlToXhtml |
( |
const QString & | html | ) |
const |
|
nodiscardpure virtual |
Convert HTML representation of note content into a valid XHTML document
- Parameters
-
| html | HTML representation of note content |
- Returns
- Result with XHTML in case of success of error string in case of failure
◆ convertHtmlToXml()
| virtual Result< QString, ErrorString > quentier::enml::IConverter::convertHtmlToXml |
( |
const QString & | html | ) |
const |
|
nodiscardpure virtual |
Convert HTML representation of note content into a valid XML document
- Parameters
-
| html | HTML representation of note content |
- Returns
- Result with XML in case of success of error string in case of failure
◆ convertPlainTextToWordsList()
| virtual QStringList quentier::enml::IConverter::convertPlainTextToWordsList |
( |
const QString & | plainText | ) |
const |
|
nodiscardpure virtual |
Converts plain text into a list of words
- Parameters
-
| plainText | plain text representation of note content |
- Returns
- list of words
◆ exportNotesToEnex()
| virtual Result< QString, ErrorString > quentier::enml::IConverter::exportNotesToEnex |
( |
const QList< qevercloud::Note > & | notes, |
|
|
const QHash< QString, QString > & | tagNamesByTagLocalIds, |
|
|
EnexExportTags | exportTagsOption, |
|
|
const QString & | version = {} ) const |
|
nodiscardpure virtual |
Exports a list of notes into ENEX
- Parameters
-
| notes | notes to be exported into ENEX |
| tagNamesByTagLocalIds | mapper from tag local ids into tag names |
| exportTagsOption | option controlling the export of tag names |
| version | optional version tag for ENEX, omitted if not set |
- Returns
- Result with ENEX in case of success or error string in case of failure
◆ importEnex()
| virtual Result< QList< qevercloud::Note >, ErrorString > quentier::enml::IConverter::importEnex |
( |
const QString & | enex | ) |
const |
|
nodiscardpure virtual |
Import notes from ENEX
- Parameters
-
| enex | ENEX to be used for import |
- Returns
- Result with list of notes in case of success or error string in case of failure
- Note
- if tag names are present in ENEX, corresponding notes would have their tagNames field filled
◆ validateAndFixupEnml()
| virtual Result< QString, ErrorString > quentier::enml::IConverter::validateAndFixupEnml |
( |
const QString & | enml | ) |
const |
|
nodiscardpure virtual |
Validates ENML and attempts to fix it automatically if it's not valid
- Parameters
-
| enml | ENML representation of note content |
- Returns
- Result with either unchanged or fixed up ENML in case of success or error string in case of failure
◆ validateEnml()
| virtual Result< void, ErrorString > quentier::enml::IConverter::validateEnml |
( |
const QString & | enml | ) |
const |
|
nodiscardpure virtual |
Validates ENML against rules
- Parameters
-
| enml | ENML representation of note content |
- Returns
- valid Result in case of success or error string in case of failure