![]() |
LeechCraft
%{LEECHCRAFT_VERSION}
Modular cross-platform feature rich live environment.
|
Interface for HTML/WYSIWYG editors with some advanced functionality. More...
#include "itexteditor.h"
Public Types | |
typedef QPair< QRegExp, QString > | Replacement_t |
typedef QList< Replacement_t > | Replacements_t |
Public Member Functions | |
virtual | ~IAdvancedHTMLEditor () |
virtual void | InsertHTML (const QString &html)=0 |
Inserts the given HTML at the current cursor position. More... | |
virtual void | SetTagsMappings (const Replacements_t &rich2html, const Replacements_t &html2rich)=0 |
Sets tags mapping for this editor widget. More... | |
virtual void | ExecJS (const QString &js)=0 |
Executes the given js in the context of the content. More... | |
Interface for HTML/WYSIWYG editors with some advanced functionality.
It is sometimes desirable to add support for custom tags not defined in HTML standards, like LJ's user tags. It is possible to define such custom tags by the means of tag mappings, each tag mapping being a pair of QRegExp and QString, which are fed to QString::replace(). The QString can refer to the expressions captured by the QRegExp effectively adding support for custom tag parameters (refer to QString::replace() documentation for more information).
There are two lists comprising tag mappings, first being a translation from the view to source (that would translate an LJ user tag into appropriate spans, imgs and other tags) and the other being the the reverse translation (that would turn that stuff back into an LJ user tag). These lists are passed to the SetTagsMappings() function, the first list called html2rich and the second called rich2html.
Definition at line 194 of file itexteditor.h.
typedef QPair<QRegExp, QString> IAdvancedHTMLEditor::Replacement_t |
Definition at line 199 of file itexteditor.h.
typedef QList<Replacement_t> IAdvancedHTMLEditor::Replacements_t |
Definition at line 200 of file itexteditor.h.
|
inlinevirtual |
Definition at line 197 of file itexteditor.h.
|
pure virtual |
Executes the given js in the context of the content.
[in] | js | The JavaScript code to execute. |
|
pure virtual |
Inserts the given HTML at the current cursor position.
This function is somewhat analogous to DOM's
.
[in] | html | The HTML to insert. |
|
pure virtual |
Sets tags mapping for this editor widget.
This function should be set before ITextEditor::SetContents().
See the IAdvancedHTMLEditor class reference for more information about tags mappings.
[in] | rich2html | Mappings for view -> source view conversion. |
[in] | html2rich | Mappings for source view -> view conversion. |