1 /* ============================================================
2  *
3  * This file is a part of KDE project
4  *
5  *
6  * Date        : 2015-07-28
7  * Description : Common widgets shared by plugins
8  *
9  * Copyright (C) 2013 by Pankaj Kumar <me at panks dot me>
10  * Copyright (C) 2015 by Shourya Singh Gupta <shouryasgupta 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 KPSETTINGSWIDGET_H
25 #define KPSETTINGSWIDGET_H
26 
27 //Qt includes
28 
29 #include <QWidget>
30 
31 // Local includes
32 
33 #include "kipiplugins_export.h"
34 #include "kpimageslist.h"
35 #include "kpprogresswidget.h"
36 
37 class QLabel;
38 class QSpinBox;
39 class QCheckBox;
40 class QButtonGroup;
41 class QComboBox;
42 class QPushButton;
43 class QGroupBox;
44 class QGridLayout;
45 class QVBoxLayout;
46 class QHBoxLayout;
47 
48 namespace KIPI
49 {
50     class Interface;
51     class UploadWidget;
52 }
53 
54 namespace KIPIPlugins
55 {
56 
57 class KIPIPLUGINS_EXPORT KPSettingsWidget : public QWidget
58 {
59     Q_OBJECT
60 
61 public:
62 
63     KPSettingsWidget(QWidget* const parent, KIPI::Interface* const iface, const QString& pluginName);
64     ~KPSettingsWidget();
65 
66     virtual void updateLabels(const QString& name = QString(), const QString& url = QString()) = 0;
67     QString getDestinationPath()    const;
68 
69     KPImagesList*     imagesList()  const;
70     KPProgressWidget* progressBar() const;
71     void              replaceImageList(QWidget* const widget);
72 
73     QWidget*          getSettingsBox() const;
74     QVBoxLayout*      getSettingsBoxLayout() const;
75     void              addWidgetToSettingsBox(QWidget* const widget);
76 
77     QGroupBox*        getAlbumBox() const;
78     QGridLayout*      getAlbumBoxLayout() const;
79 
80     QGroupBox*        getOptionsBox() const;
81     QGridLayout*      getOptionsBoxLayout() const;
82 
83     QGroupBox*        getUploadBox() const;
84     QVBoxLayout*      getUploadBoxLayout() const;
85 
86     QGroupBox*        getSizeBox() const;
87     QVBoxLayout*      getSizeBoxLayout() const;
88 
89     QGroupBox*        getAccountBox() const;
90     QGridLayout*      getAccountBoxLayout() const;
91 
92     QLabel*           getHeaderLbl() const;
93     QLabel*           getUserNameLabel() const;
94     QPushButton*      getChangeUserBtn() const;
95     QComboBox*        getDimensionCoB() const;
96     QPushButton*      getNewAlbmBtn() const;
97     QPushButton*      getReloadBtn() const;
98     QCheckBox*        getOriginalCheckBox() const;
99     QCheckBox*        getResizeCheckBox() const;
100     QSpinBox*         getDimensionSpB() const;
101     QSpinBox*         getImgQualitySpB() const;
102     QComboBox*        getAlbumsCoB() const;
103 
104 protected Q_SLOTS:
105 
106     void slotResizeChecked();
107 
108 private:
109 
110     class Private;
111     Private* const d;
112 };
113 
114 } // namespace KIPIPlugins
115 
116 #endif /* KPSETTINGSWIDGET_H */
117