1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date        : 2014-09-19
7  * Description : slide properties widget
8  *
9  * Copyright (C) 2014-2021 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2019-2020 by Minh Nghia Duong <minhnghiaduong997 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)
16  * 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_SLIDE_PROPERTIES_PLUGIN_H
26 #define DIGIKAM_SLIDE_PROPERTIES_PLUGIN_H
27 
28 #include <QWidget>
29 #include <QPainter>
30 #include <QString>
31 #include <QColor>
32 #include <QUrl>
33 
34 // Local includes
35 
36 #include "slideshowsettings.h"
37 
38 namespace DigikamGenericSlideShowPlugin
39 {
40 
41 class SlideProperties : public QWidget
42 {
43     Q_OBJECT
44 
45 public:
46 
47     explicit SlideProperties(SlideShowSettings* const settings, QWidget* const parent);
48     ~SlideProperties()              override;
49 
50     void setCurrentUrl(const QUrl& url);
51     void togglePaintEnabled();
52 
53 private:
54 
55     void printInfoText(QPainter& p, int& offset, const QString& str, const QColor& pcol = Qt::white);
56     void printComments(QPainter& p, int& offset, const QString& comments);
57     void printTags(QPainter& p, int& offset, QStringList& tags);
58     void paintEvent(QPaintEvent*)   override;
59 
60 private:
61 
62     class Private;
63     Private* const d;
64 };
65 
66 } // namespace DigikamGenericSlideShowPlugin
67 
68 #endif // DIGIKAM_SLIDE_PROPERTIES_PLUGIN_H
69