LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
itexteditor.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 <QVariantMap>
12
13
class
QWidget;
14
class
QString;
15
class
QAction;
16
class
QColor;
17
18
namespace
LC
19
{
22
enum class
ContentType
23
{
27
HTML
,
28
31
PlainText
32
};
33
41
enum class
EditorAction
42
{
45
Find
,
46
49
Replace
,
50
};
51
}
52
75
class
Q_DECL_EXPORT
IEditorWidget
76
{
77
public
:
78
virtual
~IEditorWidget
() {}
79
95
virtual
QString
GetContents
(
LC::ContentType
type)
const
= 0;
96
117
virtual
void
SetContents
(QString contents,
LC::ContentType
type) = 0;
118
127
virtual
QAction*
GetEditorAction
(
LC::EditorAction
action) = 0;
128
139
virtual
void
AppendAction
(QAction *action) = 0;
140
143
virtual
void
AppendSeparator
() = 0;
144
154
virtual
void
RemoveAction
(QAction *action) = 0;
155
167
virtual
void
SetBackgroundColor
(
const
QColor& color,
LC::ContentType
editor) = 0;
168
173
virtual
QWidget*
GetWidget
() = 0;
174
179
virtual
QObject*
GetQObject
() = 0;
180
protected
:
186
virtual
void
textChanged
() = 0;
187
};
188
198
class
Q_DECL_EXPORT
ITextEditor
199
{
200
public
:
201
virtual
~ITextEditor
() {}
202
212
virtual
bool
SupportsEditor
(
LC::ContentType
type)
const
= 0;
213
228
virtual
QWidget*
GetTextEditor
(
LC::ContentType
type) = 0;
229
};
230
231
Q_DECLARE_INTERFACE (
IEditorWidget
,
"org.Deviant.LeechCraft.IEditorWidget/1.0"
)
232
Q_DECLARE_INTERFACE (
ITextEditor
,
"org.Deviant.LeechCraft.ITextEditor/1.0"
)
IEditorWidget
Interface to be implemented by editor widgets returned from ITextEditor::GetTextEditor().
Definition
itexteditor.h:76
IEditorWidget::GetEditorAction
virtual QAction * GetEditorAction(LC::EditorAction action)=0
Returns a standard editor action.
IEditorWidget::GetWidget
virtual QWidget * GetWidget()=0
Returns this editor as a QWidget.
IEditorWidget::AppendAction
virtual void AppendAction(QAction *action)=0
Adds a custom action to the editor toolbar, if any.
IEditorWidget::GetQObject
virtual QObject * GetQObject()=0
Returns this editor as a QObject.
IEditorWidget::RemoveAction
virtual void RemoveAction(QAction *action)=0
Removes a custom action from the editor.
IEditorWidget::textChanged
virtual void textChanged()=0
Notifies about contents changes.
IEditorWidget::AppendSeparator
virtual void AppendSeparator()=0
Appens an empty separator action to the editor toolbar.
IEditorWidget::~IEditorWidget
virtual ~IEditorWidget()
Definition
itexteditor.h:78
IEditorWidget::GetContents
virtual QString GetContents(LC::ContentType type) const =0
Returns the editor contents for the given type.
IEditorWidget::SetContents
virtual void SetContents(QString contents, LC::ContentType type)=0
Sets contents of this widget interpreted as of the given type.
IEditorWidget::SetBackgroundColor
virtual void SetBackgroundColor(const QColor &color, LC::ContentType editor)=0
Sets the background color of the editor to color.
ITextEditor
Interface for plugins implementing a text editor component.
Definition
itexteditor.h:199
ITextEditor::GetTextEditor
virtual QWidget * GetTextEditor(LC::ContentType type)=0
Creates and returns a new text editor for the given type.
ITextEditor::SupportsEditor
virtual bool SupportsEditor(LC::ContentType type) const =0
Whether this editor plugin supports editing the content type.
ITextEditor::~ITextEditor
virtual ~ITextEditor()
Definition
itexteditor.h:201
LC
Definition
constants.h:15
LC::ContentType
ContentType
Definition
itexteditor.h:23
LC::ContentType::HTML
@ HTML
Definition
itexteditor.h:27
LC::ContentType::PlainText
@ PlainText
Definition
itexteditor.h:31
LC::EditorAction
EditorAction
Enumeration for some standard editor actions.
Definition
itexteditor.h:42
LC::EditorAction::Replace
@ Replace
Open "Replace" dialog.
Definition
itexteditor.h:49
LC::EditorAction::Find
@ Find
Open "Find" dialog.
Definition
itexteditor.h:45
src
interfaces
itexteditor.h
Generated by
1.17.0