digiKam
showfotofolderviewbookmarklist.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 : 2021-08-27
7  * Description : Showfoto folder view bookmarks list
8  *
9  * Copyright (C) 2021-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 SHOWFOTO_FOLDER_VIEW_BOOKMARK_LIST_H
25 #define SHOWFOTO_FOLDER_VIEW_BOOKMARK_LIST_H
26 
27 // Qt includes
28 
29 #include <QString>
30 #include <QPoint>
31 #include <QTreeWidget>
32 #include <QTreeWidgetItem>
33 #include <QDragEnterEvent>
34 #include <QDragMoveEvent>
35 #include <QDropEvent>
36 #include <QContextMenuEvent>
37 
38 namespace ShowFoto
39 {
40 
41 class ShowfotoFolderViewBookmarks;
42 class ShowfotoFolderViewBookmarkItem;
43 
44 class ShowfotoFolderViewBookmarkList : public QTreeWidget
45 {
46  Q_OBJECT
47 
48 public:
49 
52 
53  ShowfotoFolderViewBookmarkItem* bookmarkExists(const QString& path) const;
54  QString bookmarkBaseName(const QString& path) const;
55 
56 Q_SIGNALS:
57 
58  void signalAddBookmark(const QString& path);
59  void signalLoadContents(const QString& path);
60 
61 private Q_SLOTS:
62 
63  void slotContextMenu(const QPoint& pos);
64  void slotOpenInFileManager();
65  void slotLoadContents();
66 
67 private:
68 
69  void dragEnterEvent(QDragEnterEvent*);
70  void dragMoveEvent(QDragMoveEvent*);
71  void dropEvent(QDropEvent*);
72 
73 #if (QT_VERSION > QT_VERSION_CHECK(5, 99, 0))
74  QMimeData* mimeData(const QList<QTreeWidgetItem*>& items) const override;
75 #else
76  // cppcheck-suppress passedByValue
77  QMimeData* mimeData(const QList<QTreeWidgetItem*> items) const override; // clazy:exclude=function-args-by-ref
78 #endif
79 
80  void startDrag(Qt::DropActions supportedActions) override;
81 
82 private:
83 
84  class Private;
85  Private* const d;
86 };
87 
88 } // namespace ShowFoto
89 
90 #endif // SHOWFOTO_FOLDER_VIEW_BOOKMARK_LIST_H
Definition: piwigotalker.h:48
Definition: showfotofolderviewbookmarkitem.h:37
Definition: showfotofolderviewbookmarklist.h:45
ShowfotoFolderViewBookmarkList(ShowfotoFolderViewBookmarks *const parent)
Definition: showfotofolderviewbookmarklist.cpp:67
void signalLoadContents(const QString &path)
QString bookmarkBaseName(const QString &path) const
Definition: showfotofolderviewbookmarklist.cpp:299
~ShowfotoFolderViewBookmarkList() override
Definition: showfotofolderviewbookmarklist.cpp:93
ShowfotoFolderViewBookmarkItem * bookmarkExists(const QString &path) const
Definition: showfotofolderviewbookmarklist.cpp:275
void signalAddBookmark(const QString &path)
Definition: showfotofolderviewbookmarks.h:43
Definition: showfotofolderviewbar.cpp:52