LeechCraft Monocle 0.6.70-17335-ge406ffdcaf
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 QDateTime;
17class QPolygonF;
18
19namespace LC
20{
21namespace Monocle
22{
25 enum class AnnotationType
26 {
32
38
44
50
54 };
55
65 {
66 public:
67 virtual ~IAnnotation () {}
68
73 virtual QString GetAuthor () const = 0;
74
82 virtual QDateTime GetDate () const = 0;
83
88 virtual PageRelativeRectBase GetBoundary () const = 0;
89
94 virtual AnnotationType GetAnnotationType () const = 0;
95
101 virtual QString GetText () const = 0;
102 };
103
107 {
108 public:
109 virtual ~ITextAnnotation () {}
110
118 virtual bool IsInline () const = 0;
119 };
120
124 {
125 public:
127
145 virtual QList<QPolygonF> GetPolygons () const = 0;
146 };
147
159 {
160 public:
161 virtual ~ILinkAnnotation () {}
162
167 virtual ILink_ptr GetLink () const = 0;
168 };
169
173 {
174 public:
175 virtual ~ICaretAnnotation () {}
176 };
177
178 typedef std::shared_ptr<IAnnotation> IAnnotation_ptr;
179 typedef std::shared_ptr<ITextAnnotation> ITextAnnotation_ptr;
180 typedef std::shared_ptr<IHighlightAnnotation> IHighlightAnnotation_ptr;
181 typedef std::shared_ptr<ILinkAnnotation> ILinkAnnotation_ptr;
182 typedef std::shared_ptr<ICaretAnnotation> ICaretAnnotation_ptr;
183}
184}
185
186Q_DECLARE_METATYPE (LC::Monocle::IAnnotation_ptr)
Base interface for annotations.
Definition iannotation.h:65
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 PageRelativeRectBase GetBoundary() const =0
Returns the bounding rectangle of 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:146
std::shared_ptr< ITextAnnotation > ITextAnnotation_ptr
std::shared_ptr< ICaretAnnotation > ICaretAnnotation_ptr
AnnotationType
Defines an annotation type.
Definition iannotation.h:26
@ Highlight
A highlighted block in the text.
Definition iannotation.h:37
@ Other
Another type of annotation.
Definition iannotation.h:53
@ Link
An annotation with a link.
Definition iannotation.h:43
@ Text
A simple text annotation.
Definition iannotation.h:31
@ Caret
A caret pointing to some text inserted.
Definition iannotation.h:49