File indexing completed on 2025-01-05 03:53:43

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2008-12-01
0007  * Description : a tool to export images to Smugmug web service
0008  *
0009  * SPDX-FileCopyrightText: 2008-2009 by Luka Renko <lure at kubuntu dot org>
0010  * SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_SMUG_WIDGET_H
0017 #define DIGIKAM_SMUG_WIDGET_H
0018 
0019 // Qt includes
0020 
0021 #include <QWidget>
0022 
0023 // Local includes
0024 
0025 #include "dinfointerface.h"
0026 #include "dprogresswdg.h"
0027 #include "ditemslist.h"
0028 
0029 class QLabel;
0030 class QSpinBox;
0031 class QCheckBox;
0032 class QRadioButton;
0033 class QPushButton;
0034 class QComboBox;
0035 class QLineEdit;
0036 
0037 using namespace Digikam;
0038 
0039 namespace DigikamGenericSmugPlugin
0040 {
0041 
0042 class SmugWidget : public QWidget
0043 {
0044     Q_OBJECT
0045 
0046 public:
0047 
0048     explicit SmugWidget(QWidget* const parent,
0049                         DInfoInterface* const iface,
0050                         bool import);
0051     ~SmugWidget() override;
0052 
0053 public:
0054 
0055     void updateLabels(const QString& email = QString(),
0056                       const QString& name = QString(),
0057                       const QString& nick = QString());
0058 
0059     bool isAnonymous()           const;
0060     void setAnonymous(bool checked);
0061 
0062     QString getNickName()        const;
0063     void    setNickName(const QString& nick);
0064 
0065     QString getSitePassword()    const;
0066     QString getAlbumPassword()   const;
0067     QString getDestinationPath() const;
0068 
0069     DItemsList* imagesList()     const;
0070     DProgressWdg* progressBar()  const;
0071 
0072 Q_SIGNALS:
0073 
0074     void signalUserChangeRequest(bool anonymous);
0075 
0076 private Q_SLOTS:
0077 
0078     void slotAnonymousToggled(bool checked);
0079     void slotChangeUserClicked();
0080     void slotResizeChecked();
0081 
0082 private:
0083 
0084     QLabel*         m_headerLbl;
0085     QLabel*         m_userNameLbl;
0086     QLabel*         m_userName;
0087     QLabel*         m_emailLbl;
0088     QLabel*         m_email;
0089     QLabel*         m_nickNameLbl;
0090     QLabel*         m_sitePasswordLbl;
0091     QLabel*         m_albumPasswordLbl;
0092 
0093     QRadioButton*   m_anonymousRBtn;
0094     QRadioButton*   m_accountRBtn;
0095 
0096     QCheckBox*      m_resizeChB;
0097 
0098     QSpinBox*       m_dimensionSpB;
0099     QSpinBox*       m_imageQualitySpB;
0100 
0101     QComboBox*      m_albumsCoB;
0102 
0103     QPushButton*    m_newAlbumBtn;
0104     QPushButton*    m_reloadAlbumsBtn;
0105     QPushButton*    m_changeUserBtn;
0106 
0107     QLineEdit*      m_albumPasswordEdt;
0108     QLineEdit*      m_nickNameEdt;
0109     QLineEdit*      m_sitePasswordEdt;
0110 
0111     DInfoInterface* m_iface;
0112     DProgressWdg*   m_progressBar;
0113     DItemsList*     m_imgList;
0114     QWidget*        m_uploadWidget;
0115 
0116 private:
0117 
0118     friend class SmugWindow;
0119 };
0120 
0121 } // namespace DigikamGenericSmugPlugin
0122 
0123 #endif // DIGIKAM_SMUG_WIDGET_H