LeechCraft Monocle 0.6.70-17335-ge406ffdcaf
Modular document viewer for LeechCraft
Loading...
Searching...
No Matches
idocument.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 <QImage>
13#include <QMetaType>
14#include <QStringList>
15#include <QDateTime>
16#include "ilink.h"
17
18class QUrl;
19
20template<typename>
21class QFuture;
22
23namespace LC::Monocle
24{
30 {
33 QString Title_;
36 QString Subject_;
39 QString Description_;
42 QString Author_;
43
46 QStringList Genres_;
49 QStringList Keywords_;
50
53 QDateTime Date_;
54 };
55
56 class DocumentSignals;
57
81 {
82 public:
85 virtual ~IDocument () = default;
86
96 virtual QObject* GetBackendPlugin () const = 0;
97
105 virtual QObject* GetQObject () = 0;
106
114 virtual bool IsValid () const = 0;
115
120 virtual DocumentInfo GetDocumentInfo () const = 0;
121
126 virtual int GetNumPages () const = 0;
127
140 virtual QSize GetPageSize (int page) const = 0;
141
159 virtual QFuture<QImage> RenderPage (int page, double xScale, double yScale) = 0;
160
173 virtual QList<ILink_ptr> GetPageLinks (int page) = 0;
174
183 virtual QUrl GetDocURL () const = 0;
184
192 virtual const DocumentSignals* GetDocumentSignals () const = 0;
193 };
194
197 typedef std::shared_ptr<IDocument> IDocument_ptr;
198}
199
200
201Q_DECLARE_INTERFACE (LC::Monocle::IDocument,
202 "org.LeechCraft.Monocle.IDocument/1.0")
Basic interface for documents.
Definition idocument.h:81
virtual ~IDocument()=default
Virtual destructor.
virtual QFuture< QImage > RenderPage(int page, double xScale, double yScale)=0
Renders the given page at the given scale.
virtual const DocumentSignals * GetDocumentSignals() const =0
Returns the type-safe connector for various document signals.
virtual int GetNumPages() const =0
Returns the number of pages in this document.
virtual bool IsValid() const =0
Returns whether this document is valid.
virtual QSize GetPageSize(int page) const =0
Returns the size in points of the given page.
virtual QObject * GetBackendPlugin() const =0
Returns the parent backend plugin.
virtual QObject * GetQObject()=0
Returns this object as a QObject.
virtual QUrl GetDocURL() const =0
Returns the URL of the document.
virtual DocumentInfo GetDocumentInfo() const =0
Returns the document metadata.
virtual QList< ILink_ptr > GetPageLinks(int page)=0
Returns the links found at the given page.
std::shared_ptr< IDocument > IDocument_ptr
Shared pointer to a document.
Definition idocument.h:197
Document metadata.
Definition idocument.h:30
QString Author_
The author of the document.
Definition idocument.h:42
QDateTime Date_
Date this document was created.
Definition idocument.h:53
QStringList Keywords_
Keywords corresponding to this document.
Definition idocument.h:49
QStringList Genres_
Genres of this document.
Definition idocument.h:46
QString Subject_
The subject line of this document.
Definition idocument.h:36
QString Title_
Document title.
Definition idocument.h:33
QString Description_
Description of the document.
Definition idocument.h:39