libquentier 0.8.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
quentier::enml::IConverter Class Referenceabstract

The IConverter interface encapsulates a set of methods performing conversions between ENML and other note content formats, namely HTML. More...

#include <IConverter.h>

Public Types

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.
 

Public Member Functions

virtual Result< QString, ErrorStringconvertHtmlToEnml (const QString &html, IDecryptedTextCache &decryptedTextCache, const QList< conversion_rules::ISkipRulePtr > &skipRules={}) const =0
 
virtual Result< void, ErrorStringconvertHtmlToDoc (const QString &html, QTextDocument &doc, const QList< conversion_rules::ISkipRulePtr > &skipRules={}) const =0
 
virtual Result< QString, ErrorStringconvertHtmlToXml (const QString &html) const =0
 
virtual Result< QString, ErrorStringconvertHtmlToXhtml (const QString &html) const =0
 
virtual Result< IHtmlDataPtr, ErrorStringconvertEnmlToHtml (const QString &enml, IDecryptedTextCache &decryptedTextCache) const =0
 
virtual Result< QString, ErrorStringconvertEnmlToPlainText (const QString &enml) const =0
 
virtual Result< QStringList, ErrorStringconvertEnmlToWordsList (const QString &enml) const =0
 
virtual QStringList convertPlainTextToWordsList (const QString &plainText) const =0
 
virtual Result< void, ErrorStringvalidateEnml (const QString &enml) const =0
 
virtual Result< QString, ErrorStringvalidateAndFixupEnml (const QString &enml) const =0
 
virtual Result< QString, ErrorStringexportNotesToEnex (const QList< qevercloud::Note > &notes, const QHash< QString, QString > &tagNamesByTagLocalIds, EnexExportTags exportTagsOption, const QString &version={}) const =0
 
virtual Result< QList< qevercloud::Note >, ErrorStringimportEnex (const QString &enex) const =0
 

Detailed Description

The IConverter interface encapsulates a set of methods performing conversions between ENML and other note content formats, namely HTML.

Member Function Documentation

◆ convertEnmlToHtml()

virtual Result< IHtmlDataPtr, ErrorString > quentier::enml::IConverter::convertEnmlToHtml ( const QString enml,
IDecryptedTextCache decryptedTextCache 
) const
pure virtual

Converts ENML into HTML representation of note content

Parameters
enmlENML representation of note content
decryptedTextCachecache 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
pure virtual

Converts ENML into plain text representation of note content

Parameters
enmlENML 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
pure virtual

Converts ENML into a list of words

Parameters
enmlENML 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
pure virtual

Convert HTML representation of note content into QTextDocument

Parameters
htmlHTML representation of note content
docQTextDocument into which the converted note content is put
skipRulesskip 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
pure virtual

Converts HTML representation of note content into ENML

Parameters
htmlHTML representation of note content
decryptedTextCachecache of decrypted text fragments
skipRulesskip 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
pure virtual

Convert HTML representation of note content into a valid XHTML document

Parameters
htmlHTML 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
pure virtual

Convert HTML representation of note content into a valid XML document

Parameters
htmlHTML 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
pure virtual

Converts plain text into a list of words

Parameters
plainTextplain 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
pure virtual

Exports a list of notes into ENEX

Parameters
notesnotes to be exported into ENEX
tagNamesByTagLocalIdsmapper from tag local ids into tag names
exportTagsOptionoption controlling the export of tag names
versionoptional 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
pure virtual

Import notes from ENEX

Parameters
enexENEX 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
pure virtual

Validates ENML and attempts to fix it automatically if it's not valid

Parameters
enmlENML 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
pure virtual

Validates ENML against rules

Parameters
enmlENML representation of note content
Returns
valid Result in case of success or error string in case of failure