LeechCraft  0.6.70-13729-g7046a9d2a7
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  * Boost Software License - Version 1.0 - August 17th, 2003
6  *
7  * Permission is hereby granted, free of charge, to any person or organization
8  * obtaining a copy of the software and accompanying documentation covered by
9  * this license (the "Software") to use, reproduce, display, distribute,
10  * execute, and transmit the Software, and to prepare derivative works of the
11  * Software, and to permit third-parties to whom the Software is furnished to
12  * do so, all subject to the following:
13  *
14  * The copyright notices in the Software and this entire statement, including
15  * the above license grant, this restriction and the following disclaimer,
16  * must be included in all copies of the Software, in whole or in part, and
17  * all derivative works of the Software, unless such copies or derivative
18  * works are solely in the form of machine-executable object code generated by
19  * a source language processor.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
24  * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
25  * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  **********************************************************************/
29 
30 #pragma once
31 
32 #include <QtPlugin>
33 #include <QUrl>
34 #include <QString>
35 #include <QList>
36 #include <QSize>
37 
38 namespace LC
39 {
46  {
49  QByteArray ID_;
50 
53  QString Name_;
54  };
55 
59 
63  {
66  QUrl Full_;
67 
70  QSize FullSize_;
71 
75  QUrl Preview_;
76 
80  QSize PreviewSize_;
81 
88  QUrl Thumb_;
89 
93  QSize ThumbSize_;
94 
97  QString Title_;
98  };
99 
103 }
104 
115 {
116 public:
118 
126  virtual QObject* GetQObject () = 0;
127 
135  virtual LC::RemoteImageInfos_t GetInfos () const = 0;
136 protected:
146  virtual void ready () = 0;
147 
158  virtual void error (const QString& text) = 0;
159 };
160 
168 {
169 public:
170  virtual ~IImgSource () {}
171 
178  virtual LC::ImageServiceInfos_t GetServices () const = 0;
179 
196  virtual IPendingImgSourceRequest* RequestImages (const QByteArray& serviceId) = 0;
197 
210 };
211 
212 Q_DECLARE_INTERFACE (IPendingImgSourceRequest, "org.Deviant.LeechCraft.IPendingImgSourceRequest/1.0")
213 Q_DECLARE_INTERFACE (IImgSource, "org.Deviant.LeechCraft.IImgSource/1.0")
QUrl Full_
The link to the full-sized image.
Definition: iimgsource.h:66
QUrl Thumb_
The thumbnail-sized version of the image, if applicable.
Definition: iimgsource.h:88
QSize FullSize_
The size of the full-sized image, if known.
Definition: iimgsource.h:70
QSize ThumbSize_
The size of the thumbnail-sized version of the image, if applicable.
Definition: iimgsource.h:93
QString Name_
The human-readable name of the service.
Definition: iimgsource.h:53
QUrl Preview_
The link to the preview version of the image, if applicable.
Definition: iimgsource.h:75
virtual QObject * GetQObject()=0
Returns this object as QObject.
QSize PreviewSize_
The size of the preview version of the image, if applicable.
Definition: iimgsource.h:80
virtual IPendingImgSourceRequest * StartDefaultChooser()=0
Requests the default image chooser to be opened.
Describes a remote image.
Definition: iimgsource.h:62
QList< ImageServiceInfo > ImageServiceInfos_t
The list of image storage service descriptions.
Definition: iimgsource.h:58
Interface for remote image storage plugins.
Definition: iimgsource.h:167
virtual LC::RemoteImageInfos_t GetInfos() const =0
Returns the information about the selected images.
virtual void error(const QString &text)=0
Emitted if there is an error obtaining information about the requested images.
QByteArray ID_
The unique ID of the service (including account ID).
Definition: iimgsource.h:49
virtual ~IImgSource()
Definition: iimgsource.h:170
virtual ~IPendingImgSourceRequest()
Definition: iimgsource.h:117
virtual IPendingImgSourceRequest * RequestImages(const QByteArray &serviceId)=0
Requests the images for the given service.
QList< RemoteImageInfo > RemoteImageInfos_t
A list of remote images.
Definition: iimgsource.h:102
virtual void ready()=0
Emitted when the information about the requested images becomes available.
virtual LC::ImageServiceInfos_t GetServices() const =0
Returns the list of supported services.
Definition: constants.h:35
QString Title_
The title of the image, if known.
Definition: iimgsource.h:97
Pending image request proxy object.
Definition: iimgsource.h:114
Describes a single image hosting service (including account).
Definition: iimgsource.h:45