digiKam
mediawikiwidget.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2011-02-11
7  * Description : a tool to export images to WikiMedia web service
8  *
9  * Copyright (C) 2011 by Alexandre Mendes <alex dot mendes1988 at gmail dot com>
10  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2012 by Parthasarathy Gopavarapu <gparthasarathy93 at gmail dot com>
12  * Copyright (C) 2013 by Peter Potrowl <peter dot potrowl at gmail dot com>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_MEDIAWIKI_WIDGET_H
27 #define DIGIKAM_MEDIAWIKI_WIDGET_H
28 
29 // Qt includes
30 
31 #include <QWidget>
32 #include <QStringList>
33 #include <QTreeWidgetItem>
34 #include <QUrl>
35 
36 // Local includes
37 
38 #include "dinfointerface.h"
39 #include "dprogresswdg.h"
40 #include "ditemslist.h"
41 
42 class KConfigGroup;
43 
44 using namespace Digikam;
45 
47 {
48 
50 {
55 };
56 
57 class MediaWikiWidget : public QWidget
58 {
59  Q_OBJECT
60 
61 public:
62 
63  explicit MediaWikiWidget(DInfoInterface* const iface, QWidget* const parent);
64  ~MediaWikiWidget() override;
65 
66 public:
67 
68  void updateLabels(const QString& userName = QString(),
69  const QString& wikiName = QString(),
70  const QString& url = QString());
71  void invertAccountLoginBox();
72 
73  DItemsList* imagesList() const;
74  DProgressWdg* progressBar() const;
75 
76  int dimension() const;
77  int quality() const;
78  bool resize() const;
79  bool removeMeta() const;
80  bool removeGeo() const;
81 
82  QString author() const;
83  QString source() const;
84  QString genCategories() const;
85  QString genText() const;
86  QString genComments() const;
87  QString license() const;
88  QString categories() const;
89  QString title() const;
90  QString description() const;
91  QString date() const;
92  QString latitude() const;
93  QString longitude() const;
94 
95  QMap <QString, QMap <QString, QString> > allImagesDesc();
96 
98  void readSettings(KConfigGroup& group);
99  void saveSettings(KConfigGroup& group);
100  void loadItemInfoFirstLoad();
101  void loadItemInfo(const QUrl& url);
102  void clearEditFields();
103 
104 Q_SIGNALS:
105 
107  void signalLoginRequest(const QString& login,
108  const QString& pass,
109  const QString& wikiName,
110  const QUrl& wikiUrl);
111 
112 private Q_SLOTS:
113 
114  void slotResizeChecked();
115  void slotRemoveMetaChecked();
116  void slotChangeUserClicked();
117  void slotLoginClicked();
118  void slotNewWikiClicked();
119  void slotAddWikiClicked();
120  void slotLoadImagesDesc(QTreeWidgetItem* item);
121  void slotRemoveImagesDesc();
122  void slotRestoreExtension();
123  void slotApplyTitle();
124  void slotApplyDate();
125  void slotApplyCategories();
126  void slotApplyDescription();
127  void slotApplyLatitude();
128  void slotApplyLongitude();
129 
130 private:
131 
132  class Private;
133  Private* const d;
134 
135  friend class WmWindow;
136 };
137 
138 } // namespace DigikamGenericMediaWikiPlugin
139 
140 #endif // DIGIKAM_MEDIAWIKI_WIDGET_H
Definition: mediawikiwidget.h:58
void signalLoginRequest(const QString &login, const QString &pass, const QString &wikiName, const QUrl &wikiUrl)
Definition: dinfointerface.h:56
Definition: ditemslist.h:196
Definition: dprogresswdg.h:39
Definition: mediawikiplugin.cpp:38
MediaWikiDownloadType
Definition: mediawikiwidget.h:50
@ MediaWikiPhotosMe
Definition: mediawikiwidget.h:53
@ MediaWikiPhotosFriend
Definition: mediawikiwidget.h:54
@ MediaWikiFriendAlbum
Definition: mediawikiwidget.h:52
@ MediaWikiMyAlbum
Definition: mediawikiwidget.h:51
Definition: datefolderview.cpp:43