LeechCraft Monocle 0.6.70-16373-g319c272718
Modular document viewer for LeechCraft
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 <QtPlugin>
13#include <QMetaType>
14#include "ilink.h"
15
16class QRectF;
17class QDateTime;
18class QPolygonF;
19
20namespace LC
21{
22namespace Monocle
23{
26 enum class AnnotationType
27 {
33
39
45
51
55 };
56
66 {
67 public:
68 virtual ~IAnnotation () {}
69
74 virtual QString GetAuthor () const = 0;
75
83 virtual QDateTime GetDate () const = 0;
84
93 virtual QRectF GetBoundary () const = 0;
94
99 virtual AnnotationType GetAnnotationType () const = 0;
100
106 virtual QString GetText () const = 0;
107 };
108
112 {
113 public:
114 virtual ~ITextAnnotation () {}
115
123 virtual bool IsInline () const = 0;
124 };
125
129 {
130 public:
132
150 virtual QList<QPolygonF> GetPolygons () const = 0;
151 };
152
164 {
165 public:
166 virtual ~ILinkAnnotation () {}
167
172 virtual ILink_ptr GetLink () const = 0;
173 };
174
178 {
179 public:
180 virtual ~ICaretAnnotation () {}
181 };
182
183 typedef std::shared_ptr<IAnnotation> IAnnotation_ptr;
184 typedef std::shared_ptr<ITextAnnotation> ITextAnnotation_ptr;
185 typedef std::shared_ptr<IHighlightAnnotation> IHighlightAnnotation_ptr;
186 typedef std::shared_ptr<ILinkAnnotation> ILinkAnnotation_ptr;
187 typedef std::shared_ptr<ICaretAnnotation> ICaretAnnotation_ptr;
188}
189}
190
191Q_DECLARE_INTERFACE (LC::Monocle::IAnnotation,
192 "org.LeechCraft.Monocle.IAnnotation/1.0")
193Q_DECLARE_INTERFACE (LC::Monocle::ITextAnnotation,
194 "org.LeechCraft.Monocle.ITextAnnotation/1.0")
195Q_DECLARE_INTERFACE (LC::Monocle::IHighlightAnnotation,
196 "org.LeechCraft.Monocle.IHighlightAnnotation/1.0")
197Q_DECLARE_INTERFACE (LC::Monocle::ILinkAnnotation,
198 "org.LeechCraft.Monocle.ILinkAnnotation/1.0")
199Q_DECLARE_INTERFACE (LC::Monocle::ICaretAnnotation,
200 "org.LeechCraft.Monocle.ICaretAnnotation/1.0")
201
202Q_DECLARE_METATYPE (LC::Monocle::IAnnotation_ptr)
Base interface for annotations.
Definition iannotation.h:66
virtual QRectF GetBoundary() const =0
Returns the bounding rectangle of the annotation.
virtual QDateTime GetDate() const =0
Returns the date the annotation was created.
virtual AnnotationType GetAnnotationType() const =0
Returns the type of the annotation.
virtual QString GetText() const =0
Returns the text contained in the annotation.
virtual QString GetAuthor() const =0
Returns the author of the annotation.
The interface for AnnotationType::Caret annotations.
The interface for AnnotationType::Highlight annotations.
virtual QList< QPolygonF > GetPolygons() const =0
Returns the shape of the highlight.
The interface for AnnotationType::Text annotations.
virtual bool IsInline() const =0
Returns whether this is an inline annotation.
std::shared_ptr< ILinkAnnotation > ILinkAnnotation_ptr
std::shared_ptr< IAnnotation > IAnnotation_ptr
std::shared_ptr< IHighlightAnnotation > IHighlightAnnotation_ptr
std::shared_ptr< ILink > ILink_ptr
Definition ilink.h:152
std::shared_ptr< ITextAnnotation > ITextAnnotation_ptr
std::shared_ptr< ICaretAnnotation > ICaretAnnotation_ptr
AnnotationType
Defines an annotation type.
Definition iannotation.h:27
@ Highlight
A highlighted block in the text.
Definition iannotation.h:38
@ Other
Another type of annotation.
Definition iannotation.h:54
@ Link
An annotation with a link.
Definition iannotation.h:44
@ Text
A simple text annotation.
Definition iannotation.h:32
@ Caret
A caret pointing to some text inserted.
Definition iannotation.h:50