1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date        : 2004-10-05
7  * Description : a tool bar for slideshow
8  *
9  * Copyright (C) 2004-2005 by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2006-2021 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2019-2020 by Minh Nghia Duong <minhnghiaduong997 at gmail dot com>
12  * Copyright (C)      2021 by Phuoc Khanh Le <phuockhanhnk94 at gmail dot com>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option)
18  * any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * ============================================================ */
26 
27 #ifndef DIGIKAM_SLIDE_TOOL_BAR_PLUGIN_H
28 #define DIGIKAM_SLIDE_TOOL_BAR_PLUGIN_H
29 
30 // Qt includes
31 
32 #include <QWidget>
33 #include <QKeyEvent>
34 
35 // Local includes
36 
37 #include "digikam_export.h"
38 #include "slideshowsettings.h"
39 #include "dlayoutbox.h"
40 
41 class QAction;
42 
43 namespace DigikamGenericSlideShowPlugin
44 {
45 
46 class SlideToolBar : public DHBox
47 {
48     Q_OBJECT
49 
50 public:
51 
52     explicit SlideToolBar(SlideShowSettings* const settings, QWidget* const parent);
53     ~SlideToolBar()                  override;
54 
55     bool isPaused() const;
56     void pause(bool val);
57 
58     void setEnabledPlay(bool val);
59     void setEnabledNext(bool val);
60     void setEnabledPrev(bool val);
61 
62     void closeConfigurationDialog();
63 
64 protected:
65 
66     void keyPressEvent(QKeyEvent* e) override;
67 
68 Q_SIGNALS:
69 
70     void signalNext();
71     void signalPrev();
72     void signalClose();
73     void signalPlay();
74     void signalPause();
75     void signalUpdateSettings();
76     void signalScreenSelected(int);
77     void signalRemoveImageFromList();
78 
79 private Q_SLOTS:
80 
81     void slotPlayBtnToggled();
82     void slotNexPrevClicked();
83     void slotRemoveImage();
84     void slotScreenSelected(QAction*);
85     void slotMenuSlideShowConfiguration();
86     void slotConfigurationAccepted();
87     void slotChangeDelayButtonPressed();
88 
89 private:
90 
91     class Private;
92     Private* const d;
93 
94     friend class SlideShowLoader;
95 };
96 
97 } // namespace DigikamGenericSlideShowPlugin
98 
99 #endif // DIGIKAM_SLIDE_TOOL_BAR_PLUGIN_H
100