LeechCraft Monocle
0.6.70-19424-g027e980fd1
Modular document viewer for LeechCraft
Toggle main menu visibility
Loading...
Searching...
No Matches
iannotation.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 <memory>
12
#include <QMetaType>
13
#include "
ilink.h
"
14
15
class
QDateTime;
16
class
QPolygonF;
17
18
namespace
LC
19
{
20
namespace
Monocle
21
{
24
enum class
AnnotationType
25
{
30
Text
,
31
36
Highlight
,
37
42
Link
,
43
48
Caret
,
49
52
Other
53
};
54
63
class
IAnnotation
64
{
65
public
:
66
virtual
~IAnnotation
() {}
67
72
virtual
QString
GetAuthor
()
const
= 0;
73
81
virtual
QDateTime
GetDate
()
const
= 0;
82
87
virtual
PageRelativeRectBase
GetBoundary
()
const
= 0;
88
93
virtual
AnnotationType
GetAnnotationType
()
const
= 0;
94
100
virtual
QString
GetText
()
const
= 0;
101
};
102
105
class
ITextAnnotation
:
public
IAnnotation
106
{
107
public
:
108
virtual
~ITextAnnotation
() {}
109
117
virtual
bool
IsInline
()
const
= 0;
118
};
119
122
class
IHighlightAnnotation
:
public
IAnnotation
123
{
124
public
:
125
virtual
~IHighlightAnnotation
() {}
126
144
virtual
QList<QPolygonF>
GetPolygons
()
const
= 0;
145
};
146
157
class
ILinkAnnotation
:
public
IAnnotation
158
{
159
public
:
160
virtual
~ILinkAnnotation
() {}
161
166
virtual
ILink_ptr
GetLink
()
const
= 0;
167
};
168
171
class
ICaretAnnotation
:
public
IAnnotation
172
{
173
public
:
174
virtual
~ICaretAnnotation
() {}
175
};
176
177
typedef
std::shared_ptr<IAnnotation>
IAnnotation_ptr
;
178
typedef
std::shared_ptr<ITextAnnotation>
ITextAnnotation_ptr
;
179
typedef
std::shared_ptr<IHighlightAnnotation>
IHighlightAnnotation_ptr
;
180
typedef
std::shared_ptr<ILinkAnnotation>
ILinkAnnotation_ptr
;
181
typedef
std::shared_ptr<ICaretAnnotation>
ICaretAnnotation_ptr
;
182
}
183
}
184
185
Q_DECLARE_METATYPE (
LC::Monocle::IAnnotation_ptr
)
LC::Monocle::IAnnotation
Base interface for annotations.
Definition
iannotation.h:64
LC::Monocle::IAnnotation::GetDate
virtual QDateTime GetDate() const =0
Returns the date the annotation was created.
LC::Monocle::IAnnotation::GetAnnotationType
virtual AnnotationType GetAnnotationType() const =0
Returns the type of the annotation.
LC::Monocle::IAnnotation::GetText
virtual QString GetText() const =0
Returns the text contained in the annotation.
LC::Monocle::IAnnotation::~IAnnotation
virtual ~IAnnotation()
Definition
iannotation.h:66
LC::Monocle::IAnnotation::GetBoundary
virtual PageRelativeRectBase GetBoundary() const =0
Returns the bounding rectangle of the annotation.
LC::Monocle::IAnnotation::GetAuthor
virtual QString GetAuthor() const =0
Returns the author of the annotation.
LC::Monocle::ICaretAnnotation
The interface for AnnotationType::Caret annotations.
Definition
iannotation.h:172
LC::Monocle::ICaretAnnotation::~ICaretAnnotation
virtual ~ICaretAnnotation()
Definition
iannotation.h:174
LC::Monocle::IHighlightAnnotation
The interface for AnnotationType::Highlight annotations.
Definition
iannotation.h:123
LC::Monocle::IHighlightAnnotation::~IHighlightAnnotation
virtual ~IHighlightAnnotation()
Definition
iannotation.h:125
LC::Monocle::IHighlightAnnotation::GetPolygons
virtual QList< QPolygonF > GetPolygons() const =0
Returns the shape of the highlight.
LC::Monocle::ILinkAnnotation
The interface for AnnotationType::Link annotations.
Definition
iannotation.h:158
LC::Monocle::ILinkAnnotation::~ILinkAnnotation
virtual ~ILinkAnnotation()
Definition
iannotation.h:160
LC::Monocle::ILinkAnnotation::GetLink
virtual ILink_ptr GetLink() const =0
Returns the link corresponding to this annotation.
LC::Monocle::ITextAnnotation
The interface for AnnotationType::Text annotations.
Definition
iannotation.h:106
LC::Monocle::ITextAnnotation::~ITextAnnotation
virtual ~ITextAnnotation()
Definition
iannotation.h:108
LC::Monocle::ITextAnnotation::IsInline
virtual bool IsInline() const =0
Returns whether this is an inline annotation.
ilink.h
LC::Monocle
Definition
coordsbase.h:15
LC::Monocle::ILinkAnnotation_ptr
std::shared_ptr< ILinkAnnotation > ILinkAnnotation_ptr
Definition
iannotation.h:180
LC::Monocle::IAnnotation_ptr
std::shared_ptr< IAnnotation > IAnnotation_ptr
Definition
iannotation.h:177
LC::Monocle::IHighlightAnnotation_ptr
std::shared_ptr< IHighlightAnnotation > IHighlightAnnotation_ptr
Definition
iannotation.h:179
LC::Monocle::ILink_ptr
std::shared_ptr< ILink > ILink_ptr
Definition
ilink.h:146
LC::Monocle::ITextAnnotation_ptr
std::shared_ptr< ITextAnnotation > ITextAnnotation_ptr
Definition
iannotation.h:178
LC::Monocle::ICaretAnnotation_ptr
std::shared_ptr< ICaretAnnotation > ICaretAnnotation_ptr
Definition
iannotation.h:181
LC::Monocle::AnnotationType
AnnotationType
Defines an annotation type.
Definition
iannotation.h:25
LC::Monocle::AnnotationType::Highlight
@ Highlight
A highlighted block in the text.
Definition
iannotation.h:36
LC::Monocle::AnnotationType::Other
@ Other
Another type of annotation.
Definition
iannotation.h:52
LC::Monocle::AnnotationType::Link
@ Link
An annotation with a link.
Definition
iannotation.h:42
LC::Monocle::AnnotationType::Text
@ Text
A simple text annotation.
Definition
iannotation.h:30
LC::Monocle::AnnotationType::Caret
@ Caret
A caret pointing to some text inserted.
Definition
iannotation.h:48
LC
Definition
coordsbase.h:15
LC::Monocle::PageRelativeRectBase
Definition
coordsbase.h:209
src
plugins
monocle
interfaces
monocle
iannotation.h
Generated by
1.18.0