-
Notifications
You must be signed in to change notification settings - Fork 2
/
projcontrollerpane.h
executable file
·113 lines (107 loc) · 3.67 KB
/
projcontrollerpane.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* Copyright 2016 Pascal COMBES <[email protected]>
*
* This file is part of ProSlideShower.
*
* ProSlideShower is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProSlideShower is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProSlideShower. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef PROJCONTROLLERPANE_H
#define PROJCONTROLLERPANE_H
#include <QWidget>
#include "galleryview.h"
class QToolButton;
class PresModel;
/*!
* \brief The ProjControllerPane class describes a auto-hide pane showing slide miniatures.
*
* This class allows to navigate very easily in the presentation
* by double-clicking the miniature of the target slide.
* It shows the miniatures of all the slides in a horizontal GalleryView.
* It also proposes some buttons:
* \li A close button, which closes all the windows of the application.
* \li An open master document button, which allows to open a master document.
*
* The code for the auto-hide feature is located in the ProjManager.
* It shows this widget when the mouse approaches and hides it
* when the mouse leaves it.
*/
class ProjControllerPane : public QWidget
{
Q_OBJECT
public:
/*!
* \brief Constructor
*
* Initializes the members and allocates the resources.
* \param parent The parent widget.
*/
ProjControllerPane(QWidget* parent = NULL);
/*!
* \brief Set the model
*
* Sets the PresModel from which slides are fetched.
* \param model The PresModel being presented.
* \sa model()
*/
void setModel(PresModel *model);
/*!
* \brief Get the model
*
* Gets the PresModel from which slides are fetched.
* \return The PresModel being presented.
* \sa setModel()
*/
inline QAbstractItemModel* model(void) const {return mSlidesView->model();}
signals:
/*!
* \brief Open master document request
*
* This signal is emitted when the user clicks
* the open master document button.
*/
void openDocumentRequest(void);
/*!
* \brief Configure request
*
* This signal is emitted when the user clicks
* the configure button.
*/
void configureRequest(void);
protected:
/*!
* \internal
* \brief Event filter
*
* Filters the events originating from children widget.
* This hack is necessary for children widget tooltips to appear.
*
* \param watched The object on which the event was filtered.
* \param event The filtered event.
* \return \c true if the event do not need further processing, \c false otherwise.
*/
bool eventFilter(QObject* watched, QEvent* event);
private slots:
/*!
* \brief Handles a slide change
*
* This slot is called when the current slide is changed (e.g. with arrow keys).
* It synchronizes the gallery view with the current slide in the presentation.
*/
void handlePageChange(void);
private:
GalleryView* mSlidesView; /*!< The gallery view displaying slides miniatures .*/
QToolButton* mOpenButton; /*!< Open master document button. */
QToolButton* mConfigButton; /*!< Configuration button (nothing implemented yet). */
QToolButton* mCloseButton; /*!< Close button. Closes the whole application. */
};
#endif // PROJCONTROLLERPANE_H