digiKam
fbwindow.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 : 2008-12-26
7  * Description : a tool to export items to Facebook web service
8  *
9  * Copyright (C) 2005-2008 by Vardhman Jain <vardhman at gmail dot com>
10  * Copyright (C) 2008-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2008-2009 by Luka Renko <lure at kubuntu dot org>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_FB_WINDOW_H
26 #define DIGIKAM_FB_WINDOW_H
27 
28 // Qt includes
29 
30 #include <QList>
31 
32 // Local includes
33 
34 #include "dinfointerface.h"
35 #include "wstooldialog.h"
36 
37 class QCloseEvent;
38 class QUrl;
39 
40 using namespace Digikam;
41 
43 {
44 
45 class FbAlbum;
46 
47 class FbWindow : public WSToolDialog
48 {
49  Q_OBJECT
50 
51 public:
52 
53  explicit FbWindow(DInfoInterface* const iface, QWidget* const parent);
54  ~FbWindow() override;
55 
56 private Q_SLOTS:
57 
58  void slotBusy(bool val);
59  void slotLoginProgress(int step, int maxStep, const QString& label);
60  void slotLoginDone(int errCode, const QString& errMsg);
61  void slotAddPhotoDone(int errCode, const QString& errMsg);
62  void slotCreateAlbumDone(int errCode, const QString& errMsg,
63  const QString& newAlbumID);
64  void slotListAlbumsDone(int errCode, const QString& errMsg,
65  const QList<FbAlbum>& albumsList);
66 
67  void slotUserChangeRequest();
68  void slotReloadAlbumsRequest(long long userID);
69  void slotNewAlbumRequest();
70  void slotStartTransfer();
71  void slotImageListChanged();
72  void slotStopAndCloseProgressBar();
73 
74  void slotFinished();
75  void slotCancelClicked();
76 
77 private:
78 
79  void setProfileAID(long long userID);
80  QString getImageCaption(const QString& fileName);
81  bool prepareImageForUpload(const QString& imgPath, QString& caption);
82 
83  void uploadNextPhoto();
84 
85  void readSettings();
86  void writeSettings();
87 
88  void authenticate(bool forceLogin);
89 
90  void buttonStateChange(bool state);
91 
92  void closeEvent(QCloseEvent*) override;
93 
94 private:
95 
96  class Private;
97  Private* const d;
98 };
99 
100 } // namespace DigikamGenericFaceBookPlugin
101 
102 #endif // DIGIKAM_FB_WINDOW_H
Definition: dinfointerface.h:56
Definition: wstooldialog.h:43
Definition: piwigotalker.h:48
Definition: fbitem.h:38
Definition: datefolderview.cpp:43