1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date        : 2008-10-05
7  * Description : a presentation tool.
8  *
9  * Copyright (C) 2008      by Valerio Fuoglio <valerio dot fuoglio at gmail dot com>
10  * Copyright (C) 2021      by Phuoc Khanh Le <phuockhanhnk94 at gmail dot com>
11  * Copyright (C) 2012-2021 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option) 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_PRESENTATION_CTRL_WIDGET_H
26 #define DIGIKAM_PRESENTATION_CTRL_WIDGET_H
27 
28 // Qt includes
29 
30 #include <QWidget>
31 #include <QKeyEvent>
32 
33 // Local includes
34 
35 #include "ui_presentationctrlwidget.h"
36 #include "presentationcontainer.h"
37 
38 namespace DigikamGenericPresentationPlugin
39 {
40 
41 class PresentationCtrlWidget : public QWidget,
42                                public Ui::PresentationCtrlWidget
43 {
44     Q_OBJECT
45 
46 public:
47 
48     explicit PresentationCtrlWidget(QWidget* const parent,
49                                     PresentationContainer* const sharedData);
50     ~PresentationCtrlWidget()            override;
51 
52     bool canHide()  const;
53     bool isPaused() const;
54     void setPaused(bool val);
55 
56     void setEnabledPlay(bool val);
57     void setEnabledNext(bool val);
58     void setEnabledPrev(bool val);
59 
60 Q_SIGNALS:
61 
62     void signalNext();
63     void signalPrev();
64     void signalClose();
65     void signalPlay();
66     void signalPause();
67     void signalRemoveImageFromList();
68 
69 protected:
70 
71     void keyPressEvent(QKeyEvent* event) override;
72 
73 private Q_SLOTS:
74 
75     void slotPlayButtonToggled();
76     void slotNexPrevClicked();
77     void slotChangeDelayButtonPressed();
78     void slotMoveToTrash();
79 
80 private:
81 
82     bool                    m_canHide;
83     PresentationContainer*  m_sharedData;
84 
85     friend class PresentationWidget;
86     friend class PresentationGL;
87 };
88 
89 } // namespace DigikamGenericPresentationPlugin
90 
91 #endif // DIGIKAM_PRESENTATION_CTRL_WIDGET_H
92