From 9643e146c35a3a3e9abf0bf332c7c1efd00be9c2 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 15 Jan 2020 13:19:46 +0200 Subject: Move BookmarksWidget out of libbookmarks --- src/bookmarks/bookmarkswidget.h | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/bookmarks/bookmarkswidget.h (limited to 'src/bookmarks/bookmarkswidget.h') diff --git a/src/bookmarks/bookmarkswidget.h b/src/bookmarks/bookmarkswidget.h new file mode 100644 index 0000000..149d2a6 --- /dev/null +++ b/src/bookmarks/bookmarkswidget.h @@ -0,0 +1,50 @@ +/* + * This file is part of smolbote. It's copyrighted by the contributors recorded + * in the version control history of the file, available from its original + * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote + * + * SPDX-License-Identifier: GPL-3.0 + */ + +#ifndef BOOKMARKSDIALOG_H +#define BOOKMARKSDIALOG_H + +#include +#include +#include +#include + +namespace Ui +{ +class BookmarksDialog; +} + +class BookmarksView; +class BookmarkModel; +class BookmarksWidget : public QWidget +{ + Q_OBJECT + +public: + explicit BookmarksWidget(const QString &path, QWidget *parent = nullptr); + ~BookmarksWidget() override; + +protected: + void editBookmark(const QModelIndex &index); + +signals: + void showContextMenu(const QUrl &url, const QPoint &pos); + void openUrl(const QUrl &url); + +public slots: + void save(); + void addBookmark(const QString &title, const QString &url); + void search(const QString &term, const std::function &callback) const; + +private: + Ui::BookmarksDialog *ui; + QString m_bookmarksPath; + BookmarkModel *model; +}; + +#endif // BOOKMARKSDIALOG_H -- cgit v1.2.1