digiKam
wsimagespage.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-06-27
7  * Description : page visualizing photos user choosing to upload and
8  * user albums list to upload photos to. Creating new album
9  * is also available on this page.
10  *
11  * Copyright (C) 2017-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  * Copyright (C) 2018 by Thanh Trung Dinh <dinhthanhtrung1996 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_WS_IMAGES_PAGE_H
27 #define DIGIKAM_WS_IMAGES_PAGE_H
28 
29 // Qt includes
30 
31 #include <QObject>
32 #include <QList>
33 #include <QUrl>
34 #include <QString>
35 #include <QStringList>
36 #include <QTreeWidget>
37 #include <QTreeWidgetItem>
38 
39 // Local includes
40 
41 #include "dwizardpage.h"
42 #include "wsitem.h"
43 
44 using namespace Digikam;
45 
47 {
48 
49 class WSImagesPage : public DWizardPage
50 {
51  Q_OBJECT
52 
53 public:
54 
55  explicit WSImagesPage(QWizard* const dialog, const QString& title);
56  ~WSImagesPage();
57 
58  void initializePage();
59  bool validatePage();
60  bool isComplete() const;
61 
62  void setItemsList(const QList<QUrl>& urls);
63 
64 private:
65 
66  /*
67  * Get a structure from albums list and add it recursively to albums view
68  */
69  void addChildToTreeView(QTreeWidgetItem* const parent,
70  const QMap<QString, AlbumSimplified>& albumTree,
71  const QStringList& childrenAlbums);
72 
73  /*
74  * Set id for album chosen to upload photos.
75  *
76  * This method should be called in validatePage(), so that talker can get it
77  * from d->wizard later.
78  */
79  void setCurrentAlbumId(const QString& currentAlbumId);
80 
81 Q_SIGNALS:
82 
83  /*
84  * Signal to inform talker to list albums.
85  */
87 
88 private Q_SLOTS:
89 
90  /*
91  * Connected to signal signalListAlbumsDone of WSAuthentication to visualize albums list
92  */
93  void slotListAlbumsDone(const QMap<QString, AlbumSimplified>& albumTree,
94  const QStringList& rootAlbums,
95  const QString& currentAlbumId);
96 
97  /*
98  * Connected to signalCreatAlbumDone of WSAuthentication to refresh album list and point
99  * pre-selected album to new album
100  */
101  void slotCreateAlbumDone(int errCode, const QString& errMsg, const QString& newAlbumId);
102 
103 private:
104 
105  class Private;
106  Private* const d;
107 };
108 
109 } // namespace DigikamGenericUnifiedPlugin
110 
111 #endif // DIGIKAM_WS_IMAGES_PAGE_H
Definition: wsimagespage.h:50
Definition: dwizardpage.h:42
Definition: wsauthentication.cpp:56
Definition: datefolderview.cpp:43