digiKam
wssettings.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 : 2017-01-24
7  * Description : Web Service settings container.
8  *
9  * Copyright (C) 2017-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2018 by Thanh Trung Dinh <dinhthanhtrung1996 at gmail dot com>
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 DIGIKAM_WS_SETTINGS_H
25 #define DIGIKAM_WS_SETTINGS_H
26 
27 // Qt includes
28 
29 #include <QObject>
30 #include <QtGlobal>
31 #include <QList>
32 #include <QString>
33 #include <QStringList>
34 #include <QUrl>
35 #include <QMap>
36 #include <QSettings>
37 
38 // Local includes
39 
40 #include "digikam_export.h"
41 #include "o0settingsstore.h"
42 
43 class KConfigGroup;
44 
45 namespace Digikam
46 {
47 
48 class DIGIKAM_EXPORT WSSettings : public QObject
49 {
50  Q_OBJECT
51 
52 public:
53 
55  enum Selection
56  {
57  EXPORT = 0,
58  IMPORT
59  };
60 
62  {
63  FLICKR = 0,
69  GPHOTO
70  };
71 
73  {
74  JPEG = 0,
75  PNG
76  };
77 
78 public:
79 
80  explicit WSSettings(QObject* const parent = nullptr);
81  ~WSSettings() override;
82 
85  void readSettings(KConfigGroup& group);
86  void writeSettings(KConfigGroup& group);
88 
89  QString format() const;
90 
93  static QMap<WebService, QString> webServiceNames();
94  static QMap<ImageFormat, QString> imageFormatNames();
96 
98  QStringList allUserNames(const QString& serviceName);
99 
100 public:
101 
103 
105 
108 
110 
112 
114 
116 
117  QString userName;
118 
119  QSettings* oauthSettings;
120  O0SettingsStore* oauthSettingsStore;
121 
122  QString currentAlbumId;
123 
125 
127 
128  QMap<QUrl, QUrl> itemsList;
129 };
130 
131 } // namespace Digikam
132 
133 #endif // DIGIKAM_WS_SETTINGS_H
Definition: wssettings.h:49
QSettings * oauthSettings
Definition: wssettings.h:119
ImageFormat imageFormat
Definition: wssettings.h:126
bool imagesChangeProp
Definition: wssettings.h:107
QMap< QUrl, QUrl > itemsList
Map of original item and attached item (can be resized).
Definition: wssettings.h:128
int imageCompression
Definition: wssettings.h:111
QString currentAlbumId
Selected album to upload to.
Definition: wssettings.h:122
WebService
Definition: wssettings.h:62
@ SMUGMUG
Definition: wssettings.h:67
@ DROPBOX
Definition: wssettings.h:64
@ FACEBOOK
Definition: wssettings.h:66
@ IMGUR
Definition: wssettings.h:65
@ GDRIVE
Definition: wssettings.h:68
O0SettingsStore * oauthSettingsStore
Definition: wssettings.h:120
ImageFormat
Definition: wssettings.h:73
QList< QUrl > inputImages
Selected items to upload.
Definition: wssettings.h:104
qint64 attLimitInMbytes
Definition: wssettings.h:113
int imageSize
Definition: wssettings.h:124
Selection
Images selection mode.
Definition: wssettings.h:56
WebService webService
Definition: wssettings.h:115
Selection selMode
Items selection mode.
Definition: wssettings.h:102
bool removeMetadata
Definition: wssettings.h:109
QString userName
Definition: wssettings.h:117
bool addFileProperties
Definition: wssettings.h:106
@ JPEG
Definition: panoactions.h:62
@ PNG
Definition: thumbsdb.h:55
Definition: datefolderview.cpp:43