2011-03-03 18:29:20 +01:00
|
|
|
/* ============================================================
|
2017-08-25 17:11:29 +02:00
|
|
|
* Falkon - Qt web browser
|
2017-01-14 17:54:08 +01:00
|
|
|
* Copyright (C) 2010-2017 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 BOOKMARKSTOOLBAR_H
|
|
|
|
#define BOOKMARKSTOOLBAR_H
|
|
|
|
|
2012-02-29 18:33:50 +01:00
|
|
|
#include <QWidget>
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2014-02-26 20:03:20 +01:00
|
|
|
#include "qzcommon.h"
|
2011-04-15 20:45:22 +02:00
|
|
|
|
2012-02-29 18:33:50 +01:00
|
|
|
class QHBoxLayout;
|
2014-02-10 11:54:58 +01:00
|
|
|
class QTimer;
|
2012-02-29 18:33:50 +01:00
|
|
|
|
2014-02-19 22:07:21 +01:00
|
|
|
class BrowserWindow;
|
2014-02-05 15:26:51 +01:00
|
|
|
class Bookmarks;
|
2014-02-10 11:54:58 +01:00
|
|
|
class BookmarkItem;
|
2014-02-10 17:09:42 +01:00
|
|
|
class BookmarksToolbarButton;
|
2012-02-29 18:33:50 +01:00
|
|
|
|
2017-08-25 17:11:29 +02:00
|
|
|
class FALKON_EXPORT BookmarksToolbar : public QWidget
|
2011-03-02 16:57:41 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2014-02-19 22:07:21 +01:00
|
|
|
explicit BookmarksToolbar(BrowserWindow* window, QWidget* parent = 0);
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2011-04-15 20:45:22 +02:00
|
|
|
private slots:
|
2014-02-10 11:54:58 +01:00
|
|
|
void contextMenuRequested(const QPoint &pos);
|
2011-10-28 17:52:42 +02:00
|
|
|
|
2014-02-10 11:54:58 +01:00
|
|
|
void refresh();
|
|
|
|
void bookmarksChanged();
|
2014-02-10 12:58:34 +01:00
|
|
|
void showOnlyIconsChanged(bool state);
|
2015-12-11 01:49:32 +01:00
|
|
|
void showOnlyTextChanged(bool state);
|
2011-10-28 17:52:42 +02:00
|
|
|
|
2014-02-10 11:54:58 +01:00
|
|
|
void openBookmarkInNewTab();
|
|
|
|
void openBookmarkInNewWindow();
|
2016-02-25 21:14:53 +01:00
|
|
|
void openBookmarkInNewPrivateWindow();
|
2016-02-09 14:16:50 +01:00
|
|
|
void editBookmark();
|
2014-02-10 11:54:58 +01:00
|
|
|
void deleteBookmark();
|
2011-10-28 17:52:42 +02:00
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
private:
|
2014-02-10 11:54:58 +01:00
|
|
|
void clear();
|
|
|
|
void addItem(BookmarkItem* item);
|
2014-02-10 17:09:42 +01:00
|
|
|
BookmarksToolbarButton* buttonAt(const QPoint &pos);
|
2014-02-10 11:54:58 +01:00
|
|
|
|
2011-12-17 16:04:04 +01:00
|
|
|
void dropEvent(QDropEvent* e);
|
|
|
|
void dragEnterEvent(QDragEnterEvent* e);
|
2011-12-17 14:26:34 +01:00
|
|
|
|
2014-02-19 22:07:21 +01:00
|
|
|
BrowserWindow* m_window;
|
2014-02-05 15:26:51 +01:00
|
|
|
Bookmarks* m_bookmarks;
|
2014-02-10 11:54:58 +01:00
|
|
|
BookmarkItem* m_clickedBookmark;
|
2011-09-11 19:15:06 +02:00
|
|
|
QHBoxLayout* m_layout;
|
2014-02-10 11:54:58 +01:00
|
|
|
QTimer* m_updateTimer;
|
2017-01-14 17:54:08 +01:00
|
|
|
QAction* m_actShowOnlyIcons = nullptr;
|
|
|
|
QAction* m_actShowOnlyText = nullptr;
|
2011-03-02 16:57:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BOOKMARKSTOOLBAR_H
|