1 | /* |
---|
2 | |
---|
3 | Copyright 2013 Adam Reichold |
---|
4 | |
---|
5 | This file is part of qpdfview. |
---|
6 | |
---|
7 | qpdfview is free software: you can redistribute it and/or modify |
---|
8 | it under the terms of the GNU General Public License as published by |
---|
9 | the Free Software Foundation, either version 2 of the License, or |
---|
10 | (at your option) any later version. |
---|
11 | |
---|
12 | qpdfview is distributed in the hope that it will be useful, |
---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | GNU General Public License for more details. |
---|
16 | |
---|
17 | You should have received a copy of the GNU General Public License |
---|
18 | along with qpdfview. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef RECENTLYCLOSEDMENU_H |
---|
23 | #define RECENTLYCLOSEDMENU_H |
---|
24 | |
---|
25 | #include <QMenu> |
---|
26 | |
---|
27 | namespace qpdfview |
---|
28 | { |
---|
29 | |
---|
30 | class RecentlyClosedMenu : public QMenu |
---|
31 | { |
---|
32 | Q_OBJECT |
---|
33 | |
---|
34 | public: |
---|
35 | explicit RecentlyClosedMenu(int count, QWidget *parent = 0); |
---|
36 | |
---|
37 | void addTabAction(QAction* tabAction); |
---|
38 | |
---|
39 | signals: |
---|
40 | void tabActionTriggered(QAction* tabAction); |
---|
41 | |
---|
42 | public slots: |
---|
43 | void triggerFirstTabAction(); |
---|
44 | void triggerLastTabAction(); |
---|
45 | |
---|
46 | protected slots: |
---|
47 | void on_tabAction_triggered(QAction* tabAction); |
---|
48 | void on_clearList_triggered(); |
---|
49 | |
---|
50 | private: |
---|
51 | Q_DISABLE_COPY(RecentlyClosedMenu) |
---|
52 | |
---|
53 | int m_count; |
---|
54 | |
---|
55 | QActionGroup* m_tabActionGroup; |
---|
56 | QAction* m_separatorAction; |
---|
57 | QAction* m_clearListAction; |
---|
58 | |
---|
59 | }; |
---|
60 | |
---|
61 | } // qpdfview |
---|
62 | |
---|
63 | #endif // RECENTLYCLOSEDMENU_H |
---|