1 /* ============================================================
2  *
3  * This file is a part of KDE project
4  *
5  *
6  * Date        : 2011-02-19
7  * Description : a kipi plugin to export images to VKontakte.ru web service
8  *
9  * Copyright (C) 2011 by Roman Tsisyk <roman at tsisyk dot com>
10  * Copyright (C) 2011, 2015  Alexander Potashev <aspotashev@gmail.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 VKALBUMDIALOG_H
25 #define VKALBUMDIALOG_H
26 
27 // Qt includes
28 
29 #include <QDialog>
30 
31 class QComboBox;
32 class QTextEdit;
33 class QLineEdit;
34 
35 namespace KIPIVkontaktePlugin
36 {
37 
38 class VkontakteAlbumDialog : public QDialog
39 {
40     Q_OBJECT
41 
42 public:
43 
44     struct AlbumInfo
45     {
46         QString title;
47         QString description;
48         int privacy;
49         int commentPrivacy;
50     };
51 
52 public:
53 
54     /**
55      * @brief Album creation dialog
56      *
57      * @param parent Parent widget
58      */
59     VkontakteAlbumDialog(QWidget* const parent);
60 
61     /**
62      * @brief Album editing dialog
63      *
64      * @param parent Parent widget
65      * @param album Initial album properties
66      */
67     VkontakteAlbumDialog(QWidget* const parent, const AlbumInfo& album);
68 
69     ~VkontakteAlbumDialog();
70 
71     const AlbumInfo &album() const;
72 
73 protected Q_SLOTS:
74 
75     void accept() override;
76 
77 private:
78 
79     void initDialog(bool editing);
80 
81 private:
82 
83     QLineEdit* m_titleEdit;
84     QTextEdit* m_summaryEdit;
85     QComboBox* m_albumPrivacyCombo;
86     QComboBox* m_commentsPrivacyCombo;
87 
88     AlbumInfo  m_album;
89 };
90 
91 } // namespace KIPIVkontaktePlugin
92 
93 #endif // VKALBUMDIALOG_H
94