![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Interface for HTML/WYSIWYG editors with some advanced functionality. More...
#include "iadvancedhtmleditor.h"
Classes | |
struct | CustomTag |
Describes a single custom tag. More... | |
Public Types | |
typedef QPair< QRegExp, QString > | Replacement_t |
typedef QList< Replacement_t > | Replacements_t |
typedef QList< CustomTag > | CustomTags_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 | SetCustomTags (const CustomTags_t &tags)=0 |
Adds support for custom tags not present in HTML standard. More... | |
virtual QAction * | AddInlineTagInserter (const QString &tagName, const QVariantMap ¶ms)=0 |
Adds a custom action to wrap selected text into given tag. 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. This is done via the SetCustomTags() method, which operates on a list of CustomTag structures.
Each custom tag consists of a tag name that is used to identify the tag, and the function that makes HTML out of the given tag with the given attributes and contents. The converter function is invoked each time the web view is should be re-rendered after HTML edit has been modified. See the documentation of CustomTag for more information.
All of the above is implemented using XML parsing, so the document should be a valid XML document as well.
Definition at line 36 of file iadvancedhtmleditor.h.
Definition at line 115 of file iadvancedhtmleditor.h.
typedef QPair<QRegExp, QString> IAdvancedHTMLEditor::Replacement_t |
Definition at line 41 of file iadvancedhtmleditor.h.
Definition at line 42 of file iadvancedhtmleditor.h.
|
inlinevirtual |
Definition at line 39 of file iadvancedhtmleditor.h.
|
pure virtual |
Adds a custom action to wrap selected text into given tag.
For example, to insert an action to wrap selected text into <span style="font-weight: bold" id="sometext">...</span>
one should call this function like this:
[in] | tagName | The name of the tag to be inserted. |
[in] | params | The parameters of the tag. |
|
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 execCommand("insertHTML", ...)
.
[in] | html | The HTML to insert. |
|
pure virtual |
Adds support for custom tags not present in HTML standard.
This function should be called before ITextEditor::SetContents().
See the IAdvancedHTMLEditor class reference for more information about tags mappings.
[in] | tags | The tags mapping. |