summaryrefslogtreecommitdiff
path: root/src/panels/bookmarkspanel.hpp
blob: 9dc969a777663ce8449d2068537fc0b85da6165c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* ============================================================
 *     The rekonq project
 * ============================================================
 * SPDX-License-Identifier: GPL-3.0-only
 * Copyright (C) 2022 aqua <aqua@iserlohn-fortress.net>
 * ============================================================
 * Description: A QTreeView that displays bookmarks and handles
 *              BookmarksTreeItem edits
 * ============================================================ */

#pragma once

#include "rekonq.hpp"
#include <QTreeView>

class BookmarksTreeModel;

class BookmarksPanel : public QTreeView {
  Q_OBJECT

public:
  explicit BookmarksPanel(QWidget *parent = nullptr);
  ~BookmarksPanel() = default;

signals:
  void loadUrl(const QUrl &url, rekonq::OpenType type);

private slots:
  void customContextMenu(const QPoint &pos);

  void open(const QModelIndex &index, rekonq::OpenType type = rekonq::CurrentTab);
  void remove(const QModelIndex &index);

private:
  [[nodiscard]] BookmarksTreeModel *model() const;
};