File indexing completed on 2024-05-12 04:58:06

0001 /* ============================================================
0002 * Falkon - Qt web browser
0003 * Copyright (C) 2014-2018 David Rosca <nowrep@gmail.com>
0004 *
0005 * This program is free software: you can redistribute it and/or modify
0006 * it under the terms of the GNU General Public License as published by
0007 * the Free Software Foundation, either version 3 of the License, or
0008 * (at your option) any later version.
0009 *
0010 * This program is distributed in the hope that it will be useful,
0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013 * GNU General Public License for more details.
0014 *
0015 * You should have received a copy of the GNU General Public License
0016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017 * ============================================================ */
0018 #ifndef HISTORYMENU_H
0019 #define HISTORYMENU_H
0020 
0021 #include <QPointer>
0022 
0023 #include "enhancedmenu.h"
0024 #include "qzcommon.h"
0025 
0026 class BrowserWindow;
0027 
0028 class FALKON_EXPORT HistoryMenu : public Menu
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033     explicit HistoryMenu(QWidget* parent = nullptr);
0034 
0035     void setMainWindow(BrowserWindow* window);
0036 
0037 private Q_SLOTS:
0038     void goBack();
0039     void goForward();
0040     void goHome();
0041     void showHistoryManager();
0042 
0043     void aboutToShow();
0044     void aboutToHide();
0045 
0046     void aboutToShowMostVisited();
0047     void aboutToShowClosedTabs();
0048     void aboutToShowClosedWindows();
0049 
0050     void historyEntryActivated();
0051     void historyEntryCtrlActivated();
0052     void historyEntryShiftActivated();
0053 
0054     void openUrl(const QUrl &url);
0055     void openUrlInNewTab(const QUrl &url);
0056     void openUrlInNewWindow(const QUrl &url);
0057 
0058 private:
0059     void init();
0060 
0061     QPointer<BrowserWindow> m_window;
0062     Menu* m_menuMostVisited;
0063     Menu* m_menuClosedTabs;
0064     Menu *m_menuClosedWindows;
0065 };
0066 
0067 #endif // HISTORYMENU_H