digiKam
itemfullscreenoverlay.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 : 2015-08-30
7  * Description : fullscreen overlay
8  *
9  * Copyright (C) 2015 by Luca Carlon <carlon dot luca at gmail dot com>
10  * Copyright (C) 2015-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_ITEM_FULL_SCREEN_OVERLAY_H
26 #define DIGIKAM_ITEM_FULL_SCREEN_OVERLAY_H
27 
28 // Qt includes
29 
30 #include <QAbstractButton>
31 #include <QAbstractItemView>
32 
33 // Local includes
34 
35 #include "itemviewhoverbutton.h"
36 #include "itemdelegateoverlay.h"
37 
38 namespace Digikam
39 {
40 
42 {
43  Q_OBJECT
44 
45 public:
46 
47  explicit ItemFullScreenOverlayButton(QAbstractItemView* const parentView);
48  QSize sizeHint() const override;
49 
50 protected:
51 
52  QIcon icon() override;
53  void updateToolTip() override;
54 };
55 
56 // --------------------------------------------------------------------
57 
59 {
60  Q_OBJECT
61 
62 public:
63 
64  explicit ItemFullScreenOverlay(QObject* const parent);
65  void setActive(bool active) override;
66 
67  static ItemFullScreenOverlay* instance(QObject* const parent);
68 
69 Q_SIGNALS:
70 
71  void signalFullscreen(const QList<QModelIndex>& indexes);
72 
73 protected:
74 
76  void updateButton(const QModelIndex& index) override;
77  bool checkIndex(const QModelIndex& index) const override;
78  void widgetEnterEvent() override;
79  void widgetLeaveEvent() override;
80 
81 private Q_SLOTS:
82 
83  void slotClicked();
84 };
85 
86 } // namespace Digikam
87 
88 #endif // DIGIKAM_ITEM_FULL_SCREEN_OVERLAY_H
Definition: itemdelegateoverlay.h:225
Definition: itemfullscreenoverlay.h:42
QIcon icon() override
Definition: itemfullscreenoverlay.cpp:52
QSize sizeHint() const override
Definition: itemfullscreenoverlay.cpp:47
ItemFullScreenOverlayButton(QAbstractItemView *const parentView)
Definition: itemfullscreenoverlay.cpp:41
void updateToolTip() override
Definition: itemfullscreenoverlay.cpp:57
Definition: itemfullscreenoverlay.h:59
void setActive(bool active) override
Definition: itemfullscreenoverlay.cpp:74
static ItemFullScreenOverlay * instance(QObject *const parent)
Definition: itemfullscreenoverlay.cpp:69
void widgetEnterEvent() override
Definition: itemfullscreenoverlay.cpp:121
bool checkIndex(const QModelIndex &index) const override
Definition: itemfullscreenoverlay.cpp:113
ItemFullScreenOverlay(QObject *const parent)
Definition: itemfullscreenoverlay.cpp:64
ItemViewHoverButton * createButton() override
Definition: itemfullscreenoverlay.cpp:87
void updateButton(const QModelIndex &index) override
Definition: itemfullscreenoverlay.cpp:92
void widgetLeaveEvent() override
Definition: itemfullscreenoverlay.cpp:126
void signalFullscreen(const QList< QModelIndex > &indexes)
Definition: itemviewhoverbutton.h:42
Definition: datefolderview.cpp:43