Changeset View
Changeset View
Standalone View
Standalone View
ipfs/ipfsimageslist.h
- This file was added.
1 | | ||||
---|---|---|---|---|---|
2 | /* ============================================================ | ||||
3 | * | ||||
4 | * This file is a part of KDE project | ||||
5 | * | ||||
6 | * | ||||
7 | * Date : 2016-06-06 | ||||
8 | * Description : a kipi plugin to export images to the IPFS web service | ||||
9 | * | ||||
10 | * Copyright (C) 2018 by Amar Lakshya <amar dot lakshya at xaviers dot edu dot in> | ||||
11 | * | ||||
12 | * This program is free software; you can redistribute it | ||||
13 | * and/or modify it under the terms of the GNU General | ||||
14 | * Public License as published by the Free Software Foundation; | ||||
15 | * either version 2, or (at your option) any later version. | ||||
16 | * | ||||
17 | * This program is distributed in the hope that it will be useful, | ||||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
20 | * GNU General Public License for more details. | ||||
21 | * | ||||
22 | * ============================================================ */ | ||||
23 | | ||||
24 | #ifndef IMGURIMAGESLIST_H | ||||
25 | #define IMGURIMAGESLIST_H | ||||
26 | | ||||
27 | // Qt includes | ||||
28 | | ||||
29 | #include <QWidget> | ||||
30 | | ||||
31 | // Local includes | ||||
32 | | ||||
33 | #include "kpimageslist.h" | ||||
34 | #include "ipfsglobaluploadapi.h" | ||||
35 | | ||||
36 | using namespace KIPI; | ||||
37 | using namespace KIPIPlugins; | ||||
38 | | ||||
39 | namespace KIPIIPFSPlugin | ||||
40 | { | ||||
41 | | ||||
42 | class IPFSImageListViewItem; | ||||
43 | | ||||
44 | class IPFSImagesList : public KPImagesList | ||||
45 | { | ||||
46 | Q_OBJECT | ||||
47 | | ||||
48 | public: | ||||
49 | /* The different columns in a list. */ | ||||
50 | enum FieldType | ||||
51 | { | ||||
52 | Title = KPImagesListView::User1, | ||||
53 | Description = KPImagesListView::User2, | ||||
54 | URL = KPImagesListView::User3, | ||||
55 | }; | ||||
56 | | ||||
57 | IPFSImagesList(QWidget* const parent = 0); | ||||
58 | ~IPFSImagesList() override {} | ||||
59 | | ||||
60 | QList<const IPFSImageListViewItem*> getPendingItems(); | ||||
61 | | ||||
62 | public Q_SLOTS: | ||||
63 | void slotAddImages(const QList<QUrl>& list) override; | ||||
64 | void slotSuccess(const IPFSGLOBALUPLOADAPIResult& result); | ||||
65 | void slotDoubleClick(QTreeWidgetItem* element, int i); | ||||
66 | }; | ||||
67 | | ||||
68 | // ------------------------------------------------------------------------- | ||||
69 | | ||||
70 | class IPFSImageListViewItem : public KPImagesListViewItem | ||||
71 | { | ||||
72 | public: | ||||
73 | IPFSImageListViewItem(KPImagesListView* const view, const QUrl& url); | ||||
74 | ~IPFSImageListViewItem() override {} | ||||
75 | | ||||
76 | void setTitle(const QString& str); | ||||
77 | QString Title() const; | ||||
78 | | ||||
79 | void setDescription(const QString& str); | ||||
80 | QString Description() const; | ||||
81 | | ||||
82 | void setIPFSUrl(const QString& str); | ||||
83 | QString IPFSUrl() const; | ||||
84 | | ||||
85 | }; | ||||
86 | | ||||
87 | } // namespace KIPIIPFSPlugin | ||||
88 | | ||||
89 | #endif // IMGURIMAGESLIST_H |