1 /*
2  *  SPDX-FileCopyrightText: 2015 Boudhayan Gupta <me@BaloneyGeek.com>
3  *  SPDX-FileCopyrightText: 2010 Pau Garcia i Quiles <pgquiles@elpauer.org>
4  *  Essentially a rip-off of code for Kamoso by:
5  *  SPDX-FileCopyrightText: 2008-2009 Aleix Pol <aleixpol@kde.org>
6  *  SPDX-FileCopyrightText: 2008-2009 Alex Fiestas <alex@eyeos.org>
7  *
8  *  SPDX-License-Identifier: LGPL-2.0-or-later
9  */
10 
11 #include "KSGKipiInterface.h"
12 #include "KSGKipiImageCollectionSelector.h"
13 #include "KSGKipiImageCollectionShared.h"
14 #include "KSGKipiInfoShared.h"
15 
KSGKipiInterface(QObject * parent)16 KSGKipiInterface::KSGKipiInterface(QObject *parent)
17     : KIPI::Interface(parent)
18 {
19 }
20 
~KSGKipiInterface()21 KSGKipiInterface::~KSGKipiInterface()
22 {
23 }
24 
25 // no-op single image handlers
26 
addImage(const QUrl &,QString &)27 bool KSGKipiInterface::addImage(const QUrl &, QString &)
28 {
29     return true;
30 }
delImage(const QUrl &)31 void KSGKipiInterface::delImage(const QUrl &)
32 {
33 }
refreshImages(const QList<QUrl> &)34 void KSGKipiInterface::refreshImages(const QList<QUrl> &)
35 {
36 }
37 
38 // album handlers. mostly no-op
39 
currentAlbum()40 KIPI::ImageCollection KSGKipiInterface::currentAlbum()
41 {
42     return KIPI::ImageCollection(new KSGKipiImageCollectionShared);
43 }
44 
currentSelection()45 KIPI::ImageCollection KSGKipiInterface::currentSelection()
46 {
47     return currentAlbum();
48 }
49 
allAlbums()50 QList<KIPI::ImageCollection> KSGKipiInterface::allAlbums()
51 {
52     return QList<KIPI::ImageCollection>({currentAlbum()});
53 }
54 
55 // features and info
56 
info(const QUrl & url)57 KIPI::ImageInfo KSGKipiInterface::info(const QUrl &url)
58 {
59     return KIPI::ImageInfo(new KSGKipiInfoShared(this, url));
60 }
61 
features() const62 int KSGKipiInterface::features() const
63 {
64     return KIPI::ImagesHasTime;
65 }
66 
67 // widgets and selectors
68 
imageCollectionSelector(QWidget * parent)69 KIPI::ImageCollectionSelector *KSGKipiInterface::imageCollectionSelector(QWidget *parent)
70 {
71     return new KSGKipiImageCollectionSelector(this, parent);
72 }
73 
uploadWidget(QWidget * parent)74 KIPI::UploadWidget *KSGKipiInterface::uploadWidget(QWidget *parent)
75 {
76     return new KIPI::UploadWidget(parent);
77 }
78 
79 // deal with api breakage
80 
createReadWriteLock(const QUrl & url) const81 KIPI::FileReadWriteLock *KSGKipiInterface::createReadWriteLock(const QUrl &url) const
82 {
83     Q_UNUSED(url);
84     return nullptr;
85 }
86 
createMetadataProcessor() const87 KIPI::MetadataProcessor *KSGKipiInterface::createMetadataProcessor() const
88 {
89     return nullptr;
90 }
91