LeechCraft Monocle 0.6.70-16373-g319c272718
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
24{
25namespace Monocle
26{
32 {
35 QString Title_;
38 QString Subject_;
41 QString Description_;
44 QString Author_;
45
48 QStringList Genres_;
51 QStringList Keywords_;
52
55 QDateTime Date_;
56 };
57
81 {
82 public:
85 virtual ~IDocument () {}
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
193 virtual void printRequested (const QList<int>& pages) = 0;
194 };
195
198 typedef std::shared_ptr<IDocument> IDocument_ptr;
199}
200}
201
202Q_DECLARE_INTERFACE (LC::Monocle::IDocument,
203 "org.LeechCraft.Monocle.IDocument/1.0")
Basic interface for documents.
Definition idocument.h:81
virtual QFuture< QImage > RenderPage(int page, double xScale, double yScale)=0
Renders the given page at the given scale.
virtual int GetNumPages() const =0
Returns the number of pages in this document.
virtual void printRequested(const QList< int > &pages)=0
Emitted when printing is requested.
virtual bool IsValid() const =0
Returns whether this document is valid.
virtual ~IDocument()
Virtual destructor.
Definition idocument.h:85
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:198
Document metadata.
Definition idocument.h:32
QString Author_
The author of the document.
Definition idocument.h:44
QDateTime Date_
Date this document was created.
Definition idocument.h:55
QStringList Keywords_
Keywords corresponding to this document.
Definition idocument.h:51
QStringList Genres_
Genres of this document.
Definition idocument.h:48
QString Subject_
The subject line of this document.
Definition idocument.h:38
QString Title_
Document title.
Definition idocument.h:35
QString Description_
Description of the document.
Definition idocument.h:41