LeechCraft Monocle 0.6.70-14794-g33744ae6ce
Modular document viewer for LeechCraft
Loading...
Searching...
No Matches
ilink.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 <QRectF>
13#include <QMetaType>
14
15namespace LC
16{
17namespace Monocle
18{
25 enum class LinkType
26 {
37
40 URL,
41
44 Command,
45
49 };
50
57 class ILink
58 {
59 public:
62 virtual ~ILink () {}
63
68 virtual LinkType GetLinkType () const = 0;
69
80 virtual QRectF GetArea () const = 0;
81
87 virtual void Execute () = 0;
88 };
89 typedef std::shared_ptr<ILink> ILink_ptr;
90
99 {
100 public:
103 virtual ~IPageLink () {}
104
113 virtual QString GetDocumentFilename () const = 0;
114
119 virtual int GetPageNumber () const = 0;
120
128 virtual double NewX () const = 0;
129
137 virtual double NewY () const = 0;
138
143 virtual double NewZoom () const = 0;
144 };
145}
146}
147
148Q_DECLARE_INTERFACE (LC::Monocle::ILink, "org.LeechCraft.Monocle.ILink/1.0")
149Q_DECLARE_INTERFACE (LC::Monocle::IPageLink, "org.LeechCraft.Monocle.IPageLink/1.0")
std::shared_ptr< ILink > ILink_ptr
Definition: ilink.h:89
LinkType
Describes various link types known to Monocle.
Definition: ilink.h:26
@ OtherLink
Other link type.
@ URL
A link to an URL.
@ Command
Some standard command like printing.
@ PageLink
A link to a page.
Definition: iannotation.h:21