digiKam
bookmarksdlg.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2017-05-15
7  * Description : Managemenet dialogs for bookmarks
8  *
9  * Copyright (C) 2017-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_BOOKMARKS_DLG_H
25 #define DIGIKAM_BOOKMARKS_DLG_H
26 
27 // Qt includes
28 
29 #include <QDialog>
30 #include <QTreeView>
31 #include <QComboBox>
32 #include <QAbstractItemModel>
33 
34 // Local includes
35 
36 #include "searchtextbar.h"
37 #include "bookmarksmngr.h"
38 #include "digikam_export.h"
39 
40 namespace Digikam
41 {
42 
43 class DIGIKAM_EXPORT AddBookmarkDialog : public QDialog
44 {
45  Q_OBJECT
46 
47 public:
48 
49  explicit AddBookmarkDialog(const QString& url,
50  const QString& title,
51  QWidget* const parent = nullptr,
52  BookmarksManager* const mngr = nullptr);
53  ~AddBookmarkDialog() override;
54 
55 private Q_SLOTS:
56 
57  void accept() override;
58 
59 private:
60 
61  class Private;
62  Private* const d;
63 };
64 
65 // --------------------------------------------------------------------
66 
67 class DIGIKAM_EXPORT BookmarksDialog : public QDialog
68 {
69  Q_OBJECT
70 
71 public:
72 
73  explicit BookmarksDialog(QWidget* const parent = nullptr, BookmarksManager* const mngr = nullptr);
74  ~BookmarksDialog() override;
75 
76 private Q_SLOTS:
77 
78  void slotCustomContextMenuRequested(const QPoint&);
79  void accept() override;
80  void slotOpenInMap(const QModelIndex&);
81  void slotNewFolder();
82  void slotRemoveOne();
83 
84 protected:
85 
86  void closeEvent(QCloseEvent*) override;
87 
88 private:
89 
90  void expandNodes(BookmarkNode* const node);
91  bool saveExpandedNodes(const QModelIndex& parent);
92  void readSettings();
93  void saveSettings();
94 
95 private:
96 
97  class Private;
98  Private* const d;
99 };
100 
101 } // namespace Digikam
102 
103 #endif // DIGIKAM_BOOKMARKS_DLG_H
Definition: bookmarksdlg.h:44
Definition: bookmarknode.h:41
Definition: bookmarksdlg.h:68
Definition: bookmarksmngr.h:214
Definition: datefolderview.cpp:43