Falkon Develop
Cross-platform Qt-based web browser
mainmenu.h
Go to the documentation of this file.
1/* ============================================================
2* Falkon - Qt web browser
3* Copyright (C) 2014-2018 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#ifndef MAINMENU_H
19#define MAINMENU_H
20
21#include <QMenu>
22#include <QHash>
23#include <QPointer>
24
25#include "qzcommon.h"
26
27class QMenuBar;
28
29class Preferences;
30class HistoryMenu;
31class BookmarksMenu;
32class BrowserWindow;
33
34class FALKON_EXPORT MainMenu : public QMenu
35{
36 Q_OBJECT
37
38public:
39 explicit MainMenu(BrowserWindow* window, QWidget* parent = nullptr);
40
41
42 void initMenuBar(QMenuBar* menuBar) const;
43 void initSuperMenu(QMenu* superMenu) const;
44
45 QAction* action(const QString &name) const;
46
47public Q_SLOTS:
48 void setWindow(BrowserWindow* window);
49
50private Q_SLOTS:
51 // Standard actions
52 void showAboutDialog();
53 void showPreferences();
54 void quitApplication();
55
56 // File menu
57 void newTab();
58 void newWindow();
59 void newPrivateWindow();
60 void openLocation();
61 void openFile();
62 void closeWindow();
63 void savePageAs();
64 void sendLink();
65 void printPage();
66
67 // Edit menu
68 void editUndo();
69 void editRedo();
70 void editCut();
71 void editCopy();
72 void editPaste();
73 void editSelectAll();
74 void editFind();
75
76 // View menu
77 void showStatusBar();
78 void stop();
79 void reload();
80 void zoomIn();
81 void zoomOut();
82 void zoomReset();
83 void showPageSource();
84 void showFullScreen();
85
86 // Tools menu
87 void webSearch();
88 void showSiteInfo();
89 void showDownloadManager();
90 void showCookieManager();
91 void toggleWebInspector();
92 void showClearRecentHistoryDialog();
93
94 // Help menu
95 void aboutQt();
96 void showInfoAboutApp();
97 void showConfigInfo();
98 void reportIssue();
99
100 // Other actions
101 void restoreClosedTab();
102
103 void aboutToShowFileMenu();
104 void aboutToShowViewMenu();
105 void aboutToShowEditMenu();
106 void aboutToShowToolsMenu();
107 void aboutToShowSuperMenu();
108
109 void aboutToShowToolbarsMenu();
110 void aboutToShowSidebarsMenu();
111 void aboutToShowEncodingMenu();
112
113private:
114 void init();
115 void addActionsToWindow();
116 void callSlot(const char* slot);
117
118 QHash<QString, QAction*> m_actions;
119 QPointer<BrowserWindow> m_window;
120 QPointer<Preferences> m_preferences;
121
122 QMenu* m_menuFile;
123 QMenu* m_menuEdit;
124 QMenu* m_menuView;
125 QMenu* m_menuTools;
126 QMenu* m_menuHelp;
127 QMenu* m_submenuExtensions;
128 HistoryMenu* m_menuHistory;
129 BookmarksMenu* m_menuBookmarks;
130};
131
132#endif // MAINMENU_H
#define FALKON_EXPORT
Definition: qzcommon.h:28