Warning, file /network/falkon/src/lib/tabwidget/tabcontextmenu.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* ============================================================
0002 * Falkon - Qt web browser
0003 * Copyright (C) 2010-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 TABCONTEXTMENU_H
0019 #define TABCONTEXTMENU_H
0020 
0021 #include <QMenu>
0022 
0023 #include "qzcommon.h"
0024 
0025 class BrowserWindow;
0026 class TabWidget;
0027 
0028 class FALKON_EXPORT TabContextMenu : public QMenu
0029 {
0030     Q_OBJECT
0031 
0032 public:
0033     enum Option {
0034         InvalidOption = 0,
0035         HorizontalTabs = 1 << 0,
0036         VerticalTabs = 1 << 1,
0037         ShowCloseOtherTabsActions = 1 << 2,
0038         ShowDetachTabAction = 1 << 3,
0039 
0040         DefaultOptions = HorizontalTabs | ShowCloseOtherTabsActions | ShowDetachTabAction
0041     };
0042     Q_DECLARE_FLAGS(Options, Option)
0043 
0044     explicit TabContextMenu(int index, BrowserWindow *window, Options options = DefaultOptions);
0045 
0046 Q_SIGNALS:
0047     void reloadTab(int index);
0048     void stopTab(int index);
0049     void tabCloseRequested(int index);
0050     void closeAllButCurrent(int index);
0051     void closeToRight(int index);
0052     void closeToLeft(int index);
0053     void duplicateTab(int index);
0054     void detachTab(int index);
0055     void loadTab(int index);
0056     void unloadTab(int index);
0057 
0058 private Q_SLOTS:
0059     void reloadTab() { Q_EMIT reloadTab(m_clickedTab); }
0060     void stopTab() { Q_EMIT stopTab(m_clickedTab); }
0061     void closeTab() { Q_EMIT tabCloseRequested(m_clickedTab); }
0062     void duplicateTab() { Q_EMIT duplicateTab(m_clickedTab); }
0063     void detachTab() { Q_EMIT detachTab(m_clickedTab); }
0064     void loadTab() { Q_EMIT loadTab(m_clickedTab); }
0065     void unloadTab() { Q_EMIT unloadTab(m_clickedTab); }
0066 
0067     void pinTab();
0068     void muteTab();
0069 
0070     void closeAllButCurrent();
0071     void closeToRight();
0072     void closeToLeft();
0073 
0074 private:
0075     void init();
0076 
0077     int m_clickedTab;
0078     BrowserWindow *m_window;
0079     Options m_options = InvalidOption;
0080 };
0081 
0082 Q_DECLARE_OPERATORS_FOR_FLAGS(TabContextMenu::Options)
0083 
0084 #endif // TABCONTEXTMENU_H