2011-03-03 18:29:20 +01:00
|
|
|
/* ============================================================
|
2017-08-25 17:11:29 +02:00
|
|
|
* Falkon - Qt web browser
|
2014-01-11 16:11:42 +01:00
|
|
|
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
2011-03-03 18:29:20 +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/>.
|
|
|
|
* ============================================================ */
|
2011-03-02 16:57:41 +01:00
|
|
|
#ifndef SIDEBAR_H
|
|
|
|
#define SIDEBAR_H
|
|
|
|
|
2011-09-11 19:15:06 +02:00
|
|
|
#include <QWidget>
|
2012-04-01 16:36:38 +02:00
|
|
|
#include <QHash>
|
2012-12-20 14:45:35 +01:00
|
|
|
#include <QPointer>
|
2012-02-29 18:33:50 +01:00
|
|
|
|
2014-02-26 20:03:20 +01:00
|
|
|
#include "qzcommon.h"
|
2012-02-29 18:33:50 +01:00
|
|
|
|
|
|
|
class QVBoxLayout;
|
2012-04-01 16:36:38 +02:00
|
|
|
class QMenu;
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2011-04-15 20:45:22 +02:00
|
|
|
class DockTitleBarWidget;
|
2012-04-01 16:36:38 +02:00
|
|
|
class SideBarInterface;
|
|
|
|
class SideBarManager;
|
2014-02-19 22:07:21 +01:00
|
|
|
class BrowserWindow;
|
2012-02-29 18:33:50 +01:00
|
|
|
|
2017-08-25 17:11:29 +02:00
|
|
|
class FALKON_EXPORT SideBar : public QWidget
|
2011-03-02 16:57:41 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-02-19 22:07:21 +01:00
|
|
|
explicit SideBar(SideBarManager* manager, BrowserWindow* window);
|
2011-09-11 19:15:06 +02:00
|
|
|
|
2011-04-15 20:45:22 +02:00
|
|
|
void showBookmarks();
|
|
|
|
void showHistory();
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-04-01 16:36:38 +02:00
|
|
|
void setTitle(const QString &title);
|
|
|
|
void setWidget(QWidget* widget);
|
2011-03-02 16:57:41 +01:00
|
|
|
|
|
|
|
public slots:
|
2011-04-28 18:31:48 +02:00
|
|
|
void close();
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2011-04-15 20:45:22 +02:00
|
|
|
private:
|
2014-02-19 22:07:21 +01:00
|
|
|
BrowserWindow* m_window;
|
2011-09-11 19:15:06 +02:00
|
|
|
QVBoxLayout* m_layout;
|
2011-04-15 20:45:22 +02:00
|
|
|
DockTitleBarWidget* m_titleBar;
|
2012-04-01 16:36:38 +02:00
|
|
|
SideBarManager* m_manager;
|
|
|
|
};
|
|
|
|
|
2017-08-25 17:11:29 +02:00
|
|
|
class FALKON_EXPORT SideBarManager : public QObject
|
2012-04-01 16:36:38 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-02-19 22:07:21 +01:00
|
|
|
explicit SideBarManager(BrowserWindow* parent);
|
2012-04-01 16:36:38 +02:00
|
|
|
|
2014-03-10 16:55:11 +01:00
|
|
|
void createMenu(QMenu* menu);
|
2012-04-01 16:36:38 +02:00
|
|
|
|
2012-04-30 16:33:14 +02:00
|
|
|
void showSideBar(const QString &id, bool toggle = true);
|
2012-04-01 16:36:38 +02:00
|
|
|
void sideBarRemoved(const QString &id);
|
|
|
|
void closeSideBar();
|
|
|
|
|
2012-12-20 14:45:35 +01:00
|
|
|
static QHash<QString, QPointer<SideBarInterface> > s_sidebars;
|
2012-04-01 16:36:38 +02:00
|
|
|
static void addSidebar(const QString &id, SideBarInterface* interface);
|
|
|
|
static void removeSidebar(const QString &id);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slotShowSideBar();
|
|
|
|
|
|
|
|
private:
|
2014-02-19 22:07:21 +01:00
|
|
|
BrowserWindow* m_window;
|
2012-12-20 14:45:35 +01:00
|
|
|
QPointer<SideBar> m_sideBar;
|
2012-04-01 16:36:38 +02:00
|
|
|
QMenu* m_menu;
|
|
|
|
|
|
|
|
QString m_activeBar;
|
2011-03-02 16:57:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SIDEBAR_H
|