1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-23 02:32:10 +02:00
falkonOfficial/src/lib/bookmarks/bookmarkstools.h

84 lines
2.3 KiB
C
Raw Normal View History

/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2014 David Rosca <nowrep@gmail.com>
*
* 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 BOOKMARKSTOOLS_H
#define BOOKMARKSTOOLS_H
#include <QMenu>
#include <QPushButton>
#include "qz_namespace.h"
class BookmarkItem;
class QT_QUPZILLA_EXPORT BookmarksFoldersMenu : public QMenu
{
Q_OBJECT
public:
explicit BookmarksFoldersMenu(QWidget* parent = 0);
BookmarkItem* selectedFolder() const;
signals:
void folderSelected(BookmarkItem* folder);
private slots:
void folderChoosed();
private:
void init();
void createMenu(QMenu* menu, BookmarkItem* parent);
BookmarkItem* m_selectedFolder;
};
class QT_QUPZILLA_EXPORT BookmarksFoldersButton : public QPushButton
{
Q_OBJECT
public:
explicit BookmarksFoldersButton(QWidget* parent, BookmarkItem* folder);
BookmarkItem* selectedFolder() const;
public slots:
void setSelectedFolder(BookmarkItem* folder);
private:
void init();
BookmarksFoldersMenu* m_menu;
BookmarkItem* m_selectedFolder;
};
class QupZilla;
class TabWidget;
class QT_QUPZILLA_EXPORT BookmarksTools
{
public:
static bool addBookmarkDialog(QWidget* parent, const QUrl &url, const QString &title, BookmarkItem* folder = 0);
static bool bookmarkAllTabsDialog(QWidget* parent, TabWidget* tabWidget, BookmarkItem* folder = 0);
static void openBookmark(QupZilla* window, BookmarkItem* item);
static void openBookmarkInNewTab(QupZilla* window, BookmarkItem* item);
static void openBookmarkInNewWindow(BookmarkItem* item);
};
#endif // BOOKMARKSTOOLS_H