digiKam
showfotofolderviewlist.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 : List-view for the Showfoto folder view.
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_LIST_H
25 #define SHOWFOTO_FOLDER_VIEW_LIST_H
26 
27 // QT includes
28 
29 #include <QTreeView>
30 #include <QMouseEvent>
31 #include <QContextMenuEvent>
32 #include <QModelIndex>
33 
34 // Local includes
35 
37 
38 namespace ShowFoto
39 {
40 
41 class ShowfotoFolderViewBar;
42 
43 class ShowfotoFolderViewList : public QTreeView
44 {
45  Q_OBJECT
46 
47 public:
48 
50  {
51  ShortView = 0,
53  };
54 
56  {
57  FileName = 0,
60  FileDate
61  };
62 
63 public:
64 
66  ShowfotoFolderViewBar* const bar);
67  ~ShowfotoFolderViewList() override;
68 
69 public Q_SLOTS:
70 
71  void slotIconSizeChanged(int);
72 
73 Q_SIGNALS:
74 
76 
77 private:
78 
79  void mouseDoubleClickEvent(QMouseEvent*) override;
80  void contextMenuEvent(QContextMenuEvent*) override;
81  void mouseMoveEvent(QMouseEvent*) override;
82  void wheelEvent(QWheelEvent*) override;
83  void keyPressEvent(QKeyEvent*) override;
84  void focusOutEvent(QFocusEvent*) override;
85  void leaveEvent(QEvent*) override;
86 
87  void hideToolTip();
88  bool acceptToolTip(const QModelIndex& index) const;
89 
90 private Q_SLOTS:
91 
92  void slotToolTip();
93  void slotOpenInFileManager();
94 
95 private:
96 
97  class Private;
98  Private* const d;
99 };
100 
101 } // namespace ShowFoto
102 
103 #endif // SHOWFOTO_FOLDER_VIEW_LIST_H
Definition: showfotofolderviewbar.h:48
Definition: showfotofolderviewlist.h:44
ShowfotoFolderViewList(ShowfotoFolderViewSideBar *const view, ShowfotoFolderViewBar *const bar)
Definition: showfotofolderviewlist.cpp:78
~ShowfotoFolderViewList() override
Definition: showfotofolderviewlist.cpp:109
void slotIconSizeChanged(int)
Definition: showfotofolderviewlist.cpp:138
FolderViewMode
Definition: showfotofolderviewlist.h:50
@ ShortView
Definition: showfotofolderviewlist.h:51
@ DetailledView
Definition: showfotofolderviewlist.h:52
FolderViewRole
Definition: showfotofolderviewlist.h:56
@ FileType
Definition: showfotofolderviewlist.h:59
@ FileSize
Definition: showfotofolderviewlist.h:58
@ FileDate
Modifier date.
Definition: showfotofolderviewlist.h:60
@ FileName
Definition: showfotofolderviewlist.h:57
Definition: showfotofolderviewsidebar.h:52
Definition: showfotofolderviewbar.cpp:52