2013-02-07 14:01:01 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2014-01-11 16:11:42 +01:00
|
|
|
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
|
|
|
* Copyright (C) 2013-2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
|
2013-02-07 14:01:01 +01:00
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
|
|
|
#ifndef MACMENURECEIVER_H
|
|
|
|
#define MACMENURECEIVER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2014-02-26 20:03:20 +01:00
|
|
|
#include "qzcommon.h"
|
2013-02-07 14:01:01 +01:00
|
|
|
|
2015-01-27 11:01:52 +01:00
|
|
|
class QWebEngineFrame;
|
2013-02-07 14:01:01 +01:00
|
|
|
class Menu;
|
|
|
|
class QMenu;
|
2013-02-08 15:21:00 +01:00
|
|
|
class QAction;
|
|
|
|
class QMenuBar;
|
2013-02-07 14:01:01 +01:00
|
|
|
|
2014-02-19 22:12:32 +01:00
|
|
|
class QUPZILLA_EXPORT MacMenuReceiver : public QObject
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
MacMenuReceiver(QObject* parent = 0);
|
|
|
|
|
2013-02-08 15:21:00 +01:00
|
|
|
inline QMenuBar* menuBar() { return m_macMenuBar; }
|
|
|
|
inline void setMenuBar(QMenuBar* menuBar) { m_macMenuBar = menuBar; }
|
2013-02-08 14:07:51 +01:00
|
|
|
|
|
|
|
inline bool bookmarksMenuChanged() { return m_bookmarksMenuChanged; }
|
|
|
|
inline void setBookmarksMenuChanged(bool changed) { m_bookmarksMenuChanged = changed; }
|
|
|
|
|
|
|
|
inline QAction* menuBookmarksAction() { return m_menuBookmarksAction; }
|
|
|
|
inline void setMenuBookmarksAction(QAction* action) { m_menuBookmarksAction = action; }
|
2013-02-07 15:01:25 +01:00
|
|
|
|
2013-03-16 10:36:29 +01:00
|
|
|
public slots:
|
|
|
|
void aboutToShowFileMenu(QMenu* menu = 0);
|
|
|
|
void aboutToShowEditMenu(QMenu* menu = 0);
|
|
|
|
void aboutToShowViewMenu(QMenu* menu = 0);
|
|
|
|
void aboutToShowHistoryMenu(QMenu* menu = 0);
|
|
|
|
void aboutToShowBookmarksMenu(QMenu* menu = 0);
|
|
|
|
void aboutToShowToolsMenu(QMenu* menu = 0);
|
|
|
|
|
2013-02-07 14:01:01 +01:00
|
|
|
private:
|
2013-02-07 22:48:10 +01:00
|
|
|
void setEnabledSelectedMenuActions(QMenu* menu, const QList<int> indexList = QList<int>());
|
2013-02-07 14:01:01 +01:00
|
|
|
void setDisabledSelectedMenuActions(QMenu* menu, const QList<int> indexList = QList<int>());
|
2013-02-09 12:40:20 +01:00
|
|
|
bool callSlot(const char* member, bool makeIfNoWindow = false,
|
2013-02-07 14:01:01 +01:00
|
|
|
QGenericArgument val0 = QGenericArgument(0),
|
|
|
|
QGenericArgument val1 = QGenericArgument());
|
|
|
|
|
2013-02-08 15:21:00 +01:00
|
|
|
QMenuBar* m_macMenuBar;
|
2013-02-08 14:07:51 +01:00
|
|
|
bool m_bookmarksMenuChanged;
|
|
|
|
QAction* m_menuBookmarksAction;
|
2013-02-08 15:21:00 +01:00
|
|
|
|
2013-02-07 14:01:01 +01:00
|
|
|
private slots:
|
|
|
|
void goNext();
|
|
|
|
void goBack();
|
|
|
|
void goHome();
|
|
|
|
void stop();
|
|
|
|
void reload();
|
|
|
|
void reloadByPassCache();
|
|
|
|
void aboutQupZilla();
|
|
|
|
void addTab();
|
|
|
|
void savePageScreen();
|
|
|
|
|
|
|
|
void aboutToHideFileMenu();
|
|
|
|
void aboutToHideHistoryMenu();
|
|
|
|
void aboutToShowClosedTabsMenu();
|
|
|
|
void aboutToHideViewMenu();
|
|
|
|
void aboutToHideEditMenu();
|
|
|
|
void aboutToHideToolsMenu();
|
|
|
|
void aboutToShowEncodingMenu();
|
|
|
|
|
|
|
|
void searchOnPage();
|
|
|
|
void showCookieManager();
|
|
|
|
void showHistoryManager();
|
|
|
|
void showBookmarksManager();
|
|
|
|
void showRSSManager();
|
|
|
|
void showDownloadManager();
|
|
|
|
void showMenubar();
|
|
|
|
void showNavigationToolbar();
|
|
|
|
void showStatusbar();
|
|
|
|
void showClearPrivateData();
|
|
|
|
void aboutToShowHistoryRecentMenu();
|
|
|
|
void aboutToShowHistoryMostMenu();
|
|
|
|
void showPreferences();
|
|
|
|
void showBookmarkImport();
|
|
|
|
|
|
|
|
void refreshHistory();
|
|
|
|
void bookmarkAllTabs();
|
|
|
|
void newWindow();
|
|
|
|
|
|
|
|
void openLocation();
|
|
|
|
void openFile();
|
|
|
|
void savePage();
|
|
|
|
void sendLink();
|
|
|
|
void webSearch();
|
|
|
|
|
|
|
|
// Edit menu actions
|
|
|
|
void editUndo();
|
|
|
|
void editRedo();
|
|
|
|
void editCut();
|
|
|
|
void editCopy();
|
|
|
|
void editPaste();
|
|
|
|
void editSelectAll();
|
|
|
|
|
|
|
|
void zoomIn();
|
|
|
|
void zoomOut();
|
|
|
|
void zoomReset();
|
2014-02-10 02:01:42 +01:00
|
|
|
void toggleFullScreen();
|
2013-02-09 12:40:20 +01:00
|
|
|
void changeEncoding(QObject* obj = 0);
|
2013-02-07 14:01:01 +01:00
|
|
|
|
|
|
|
void triggerCaretBrowsing();
|
2013-02-09 13:00:45 +01:00
|
|
|
void triggerTabsOnTop(bool enable);
|
2013-02-07 14:01:01 +01:00
|
|
|
|
|
|
|
void closeWindow();
|
|
|
|
void quitApp();
|
|
|
|
|
2015-01-27 11:01:52 +01:00
|
|
|
void printPage(QWebEngineFrame* frame = 0);
|
2013-02-07 14:01:01 +01:00
|
|
|
void showBookmarksToolbar();
|
2015-01-27 11:01:52 +01:00
|
|
|
void showSource(QWebEngineFrame* frame = 0, const QString &selectedHtml = QString());
|
2013-02-07 14:01:01 +01:00
|
|
|
void bookmarkPage();
|
|
|
|
void showPageInfo();
|
|
|
|
void showWebInspector(bool toggle = true);
|
|
|
|
|
|
|
|
void loadActionUrl(QObject* obj = 0);
|
|
|
|
void loadActionUrlInNewTab(QObject* obj = 0);
|
|
|
|
void loadActionUrlInNewNotSelectedTab(QObject* obj = 0);
|
2013-02-07 15:01:25 +01:00
|
|
|
|
|
|
|
void closeTab();
|
|
|
|
void restoreClosedTab(QObject* obj = 0);
|
|
|
|
void restoreAllClosedTabs();
|
|
|
|
void clearClosedTabsList();
|
2013-02-07 14:01:01 +01:00
|
|
|
};
|
|
|
|
#endif // MACMENURECEIVER_H
|