LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
iimgsource.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 <QtPlugin>
12 #include <QUrl>
13 #include <QString>
14 #include <QList>
15 #include <QSize>
16 
17 namespace LC
18 {
24  struct ImageServiceInfo
25  {
28  QByteArray ID_;
29 
32  QString Name_;
33  };
34 
38 
41  struct RemoteImageInfo
42  {
45  QUrl Full_;
46 
49  QSize FullSize_;
50 
54  QUrl Preview_;
55 
59  QSize PreviewSize_;
60 
67  QUrl Thumb_;
68 
72  QSize ThumbSize_;
73 
76  QString Title_;
77  };
78 
82 }
83 
94 {
95 public:
97 
105  virtual QObject* GetQObject () = 0;
106 
114  virtual LC::RemoteImageInfos_t GetInfos () const = 0;
115 protected:
125  virtual void ready () = 0;
126 
137  virtual void error (const QString& text) = 0;
138 };
139 
147 {
148 public:
149  virtual ~IImgSource () {}
150 
157  virtual LC::ImageServiceInfos_t GetServices () const = 0;
158 
175  virtual IPendingImgSourceRequest* RequestImages (const QByteArray& serviceId) = 0;
176 
189 };
190 
191 Q_DECLARE_INTERFACE (IPendingImgSourceRequest, "org.Deviant.LeechCraft.IPendingImgSourceRequest/1.0")
192 Q_DECLARE_INTERFACE (IImgSource, "org.Deviant.LeechCraft.IImgSource/1.0")
QList
Definition: ianrulesstorage.h:14
IPendingImgSourceRequest::GetQObject
virtual QObject * GetQObject()=0
Returns this object as QObject.
LC::RemoteImageInfo::Preview_
QUrl Preview_
The link to the preview version of the image, if applicable.
Definition: iimgsource.h:60
IPendingImgSourceRequest
Pending image request proxy object.
Definition: iimgsource.h:93
LC::ImageServiceInfo::ID_
QByteArray ID_
The unique ID of the service (including account ID).
Definition: iimgsource.h:40
IImgSource
Interface for remote image storage plugins.
Definition: iimgsource.h:146
LC::RemoteImageInfo::FullSize_
QSize FullSize_
The size of the full-sized image, if known.
Definition: iimgsource.h:55
IImgSource::GetServices
virtual LC::ImageServiceInfos_t GetServices() const =0
Returns the list of supported services.
LC::RemoteImageInfo::Thumb_
QUrl Thumb_
The thumbnail-sized version of the image, if applicable.
Definition: iimgsource.h:73
IImgSource::StartDefaultChooser
virtual IPendingImgSourceRequest * StartDefaultChooser()=0
Requests the default image chooser to be opened.
LC::ImageServiceInfos_t
QList< ImageServiceInfo > ImageServiceInfos_t
The list of image storage service descriptions.
Definition: iimgsource.h:43
LC::RemoteImageInfo::ThumbSize_
QSize ThumbSize_
The size of the thumbnail-sized version of the image, if applicable.
Definition: iimgsource.h:78
IImgSource::~IImgSource
virtual ~IImgSource()
Definition: iimgsource.h:149
IPendingImgSourceRequest::GetInfos
virtual LC::RemoteImageInfos_t GetInfos() const =0
Returns the information about the selected images.
IPendingImgSourceRequest::error
virtual void error(const QString &text)=0
Emitted if there is an error obtaining information about the requested images.
LC
Definition: constants.h:14
IPendingImgSourceRequest::~IPendingImgSourceRequest
virtual ~IPendingImgSourceRequest()
Definition: iimgsource.h:96
LC::RemoteImageInfo::Title_
QString Title_
The title of the image, if known.
Definition: iimgsource.h:82
LC::RemoteImageInfo::PreviewSize_
QSize PreviewSize_
The size of the preview version of the image, if applicable.
Definition: iimgsource.h:65
IPendingImgSourceRequest::ready
virtual void ready()=0
Emitted when the information about the requested images becomes available.
LC::ImageServiceInfo::Name_
QString Name_
The human-readable name of the service.
Definition: iimgsource.h:44
LC::RemoteImageInfos_t
QList< RemoteImageInfo > RemoteImageInfos_t
A list of remote images.
Definition: iimgsource.h:87
IImgSource::RequestImages
virtual IPendingImgSourceRequest * RequestImages(const QByteArray &serviceId)=0
Requests the images for the given service.
LC::RemoteImageInfo::Full_
QUrl Full_
The link to the full-sized image.
Definition: iimgsource.h:51