LeechCraft Monocle 0.6.70-19424-g027e980fd1
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 <QMetaType>
13#include "ilink.h"
14
15class QDateTime;
16class QPolygonF;
17
18namespace LC
19{
20namespace Monocle
21{
24 enum class AnnotationType
25 {
31
37
43
49
53 };
54
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
106 {
107 public:
108 virtual ~ITextAnnotation () {}
109
117 virtual bool IsInline () const = 0;
118 };
119
123 {
124 public:
126
144 virtual QList<QPolygonF> GetPolygons () const = 0;
145 };
146
158 {
159 public:
160 virtual ~ILinkAnnotation () {}
161
166 virtual ILink_ptr GetLink () const = 0;
167 };
168
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
185Q_DECLARE_METATYPE (LC::Monocle::IAnnotation_ptr)
Base interface for annotations.
Definition iannotation.h:64
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:25
@ Highlight
A highlighted block in the text.
Definition iannotation.h:36
@ Other
Another type of annotation.
Definition iannotation.h:52
@ Link
An annotation with a link.
Definition iannotation.h:42
@ Text
A simple text annotation.
Definition iannotation.h:30
@ Caret
A caret pointing to some text inserted.
Definition iannotation.h:48