LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
iadvancedhtmleditor.h
Go to the documentation of this file.
1
/**********************************************************************
2
* LeechCraft - modular cross-platform feature rich internet client.
3
* Copyright (C) 2006-2014 Georg Rudoy
4
*
5
* Distributed under the Boost Software License, Version 1.0.
6
* (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7
**********************************************************************/
8
9
#pragma once
10
11
#include <functional>
12
#include <QPair>
13
#include <QList>
14
#include <QRegularExpression>
15
16
class
QDomElement;
17
36
class
Q_DECL_EXPORT
IAdvancedHTMLEditor
37
{
38
public
:
39
virtual
~IAdvancedHTMLEditor
() {}
40
41
typedef
QPair<QRegularExpression, QString>
Replacement_t
;
42
typedef
QList<Replacement_t>
Replacements_t
;
43
46
struct
CustomTag
47
{
50
QString
TagName_
;
51
52
enum class
TagType
53
{
54
Empty,
55
Inline,
56
Block
57
};
58
59
TagType
TagType_
=
TagType::Inline
;
60
81
std::function<void (QDomElement&)>
ToKnown_
;
82
113
std::function<bool (QDomElement&)>
FromKnown_
;
114
};
115
typedef
QList<CustomTag>
CustomTags_t
;
116
124
virtual
void
InsertHTML
(
const
QString& html) = 0;
125
135
virtual
void
SetCustomTags
(
const
CustomTags_t
& tags) = 0;
136
154
virtual
QAction*
AddInlineTagInserter
(
const
QString& tagName,
const
QVariantMap& params) = 0;
155
160
virtual
void
ExecJS
(
const
QString& js) = 0;
161
};
162
163
Q_DECLARE_INTERFACE (
IAdvancedHTMLEditor
,
"org.Deviant.LeechCraft.IAdvancedHTMLEditor/1.0"
)
IAdvancedHTMLEditor
Interface for HTML/WYSIWYG editors with some advanced functionality.
Definition
iadvancedhtmleditor.h:37
IAdvancedHTMLEditor::InsertHTML
virtual void InsertHTML(const QString &html)=0
Inserts the given HTML at the current cursor position.
IAdvancedHTMLEditor::AddInlineTagInserter
virtual QAction * AddInlineTagInserter(const QString &tagName, const QVariantMap ¶ms)=0
Adds a custom action to wrap selected text into given tag.
IAdvancedHTMLEditor::Replacement_t
QPair< QRegularExpression, QString > Replacement_t
Definition
iadvancedhtmleditor.h:41
IAdvancedHTMLEditor::~IAdvancedHTMLEditor
virtual ~IAdvancedHTMLEditor()
Definition
iadvancedhtmleditor.h:39
IAdvancedHTMLEditor::ExecJS
virtual void ExecJS(const QString &js)=0
Executes the given js in the context of the content.
IAdvancedHTMLEditor::Replacements_t
QList< Replacement_t > Replacements_t
Definition
iadvancedhtmleditor.h:42
IAdvancedHTMLEditor::CustomTags_t
QList< CustomTag > CustomTags_t
Definition
iadvancedhtmleditor.h:115
IAdvancedHTMLEditor::SetCustomTags
virtual void SetCustomTags(const CustomTags_t &tags)=0
Adds support for custom tags not present in HTML standard.
QList
Definition
ianrulesstorage.h:14
IAdvancedHTMLEditor::CustomTag
Describes a single custom tag.
Definition
iadvancedhtmleditor.h:47
IAdvancedHTMLEditor::CustomTag::FromKnown_
std::function< bool(QDomElement &)> FromKnown_
The converter of an instance of the tag from HTML.
Definition
iadvancedhtmleditor.h:113
IAdvancedHTMLEditor::CustomTag::TagType_
TagType TagType_
Definition
iadvancedhtmleditor.h:59
IAdvancedHTMLEditor::CustomTag::TagName_
QString TagName_
The name of the custom tag, like lj.
Definition
iadvancedhtmleditor.h:50
IAdvancedHTMLEditor::CustomTag::ToKnown_
std::function< void(QDomElement &)> ToKnown_
The converter of an instance of the tag to HTML.
Definition
iadvancedhtmleditor.h:81
IAdvancedHTMLEditor::CustomTag::TagType
TagType
Definition
iadvancedhtmleditor.h:53
IAdvancedHTMLEditor::CustomTag::TagType::Inline
@ Inline
Definition
iadvancedhtmleditor.h:55
src
interfaces
iadvancedhtmleditor.h
Generated by
1.17.0