1 /* ============================================================
2  *
3  * This file is a part of KDE project
4  *
5  *
6  * Date        : 2008-12-01
7  * Description : a kipi plugin to import/export images to/from
8                  SmugMug web service
9  *
10  * Copyright (C) 2008-2009 by Luka Renko <lure at kubuntu dot org>
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 SMUGWIDGET_H
25 #define SMUGWIDGET_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 
31 class QLabel;
32 class QSpinBox;
33 class QCheckBox;
34 class QRadioButton;
35 class QPushButton;
36 class QComboBox;
37 class QLineEdit;
38 
39 namespace KIPI
40 {
41     class Interface;
42     class UploadWidget;
43 }
44 
45 namespace KIPIPlugins
46 {
47     class KPImagesList;
48     class KPProgressWidget;
49 }
50 
51 namespace KIPISmugPlugin
52 {
53 
54 class SmugWidget : public QWidget
55 {
56     Q_OBJECT
57 
58 public:
59 
60     SmugWidget(QWidget* const parent, KIPI::Interface* const iface, bool import);
61     ~SmugWidget();
62 
63     void updateLabels(const QString& email = QString(), const QString& name = QString(),
64                       const QString& nick = QString());
65 
66     bool isAnonymous() const;
67     void setAnonymous(bool checked);
68 
69     QString getNickName() const;
70     void    setNickName(const QString& nick);
71 
72     QString getSitePassword() const ;
73     QString getAlbumPassword() const;
74     QString getDestinationPath() const;
75 
76     KIPIPlugins::KPImagesList* imagesList() const;
77 
78     KIPIPlugins::KPProgressWidget* progressBar() const;
79 
80 Q_SIGNALS:
81 
82     void signalUserChangeRequest(bool anonymous);
83 
84 private Q_SLOTS:
85 
86     void slotAnonymousToggled(bool checked);
87     void slotChangeUserClicked();
88     void slotResizeChecked();
89 
90 private:
91 
92     QLabel*                        m_headerLbl;
93     QLabel*                        m_userNameLbl;
94     QLabel*                        m_userName;
95     QLabel*                        m_emailLbl;
96     QLabel*                        m_email;
97     QLabel*                        m_nickNameLbl;
98     QLabel*                        m_sitePasswordLbl;
99     QLabel*                        m_albumPasswordLbl;
100 
101     QRadioButton*                  m_anonymousRBtn;
102     QRadioButton*                  m_accountRBtn;
103 
104     QCheckBox*                     m_resizeChB;
105 
106     QSpinBox*                      m_dimensionSpB;
107     QSpinBox*                      m_imageQualitySpB;
108 
109     QComboBox*                     m_albumsCoB;
110 
111     QPushButton*                   m_newAlbumBtn;
112     QPushButton*                   m_reloadAlbumsBtn;
113     QPushButton*                   m_changeUserBtn;
114 
115     QLineEdit*                     m_albumPasswordEdt;
116     QLineEdit*                     m_nickNameEdt;
117     QLineEdit*                     m_sitePasswordEdt;
118 
119     KIPIPlugins::KPProgressWidget* m_progressBar;
120     KIPIPlugins::KPImagesList*     m_imgList;
121     KIPI::UploadWidget*            m_uploadWidget;
122 
123     friend class SmugWindow;
124 };
125 
126 } // namespace KIPISmugPlugin
127 
128 #endif // SMUGWIDGET_H
129