digiKam
itempreviewview.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 : 2006-21-12
7  * Description : a embedded view to show item preview widget.
8  *
9  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2009-2012 by Andi Clemens <andi dot clemens at gmail dot com>
11  * Copyright (C) 2010-2011 by Aditya Bhatt <adityabhatt1991 at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_ITEM_PREVIEW_VIEW_H
27 #define DIGIKAM_ITEM_PREVIEW_VIEW_H
28 
29 // Local includes
30 
31 #include "graphicsdimgview.h"
32 #include "iteminfo.h"
33 
34 class QPixmap;
35 class QDragMoveEvent;
36 class QDropEvent;
37 class QDragEnterEvent;
38 
39 namespace Digikam
40 {
41 
42 class Album;
43 class LoadingDescription;
44 
46 {
47  Q_OBJECT
48 
49 public:
50 
51  enum Mode
52  {
55  };
56 
57 public:
58 
59  explicit ItemPreviewView(QWidget* const parent,
60  Mode mode=IconViewPreview,
61  Album* const currAlbum = nullptr);
62  ~ItemPreviewView() override;
63 
64  void setItemInfo(const ItemInfo& info = ItemInfo(),
65  const ItemInfo& previous = ItemInfo(),
66  const ItemInfo& next = ItemInfo());
67 
68  ItemInfo getItemInfo() const;
69 
70  void reload();
71  void setImagePath(const QString& path=QString());
72  void setPreviousNextPaths(const QString& previous, const QString& next);
73 
74 Q_SIGNALS:
75 
79  void signalPreviewLoaded(bool success);
83 
88 
89 protected:
90 
91  bool acceptsMouseClick(QMouseEvent* e) override;
92  void mousePressEvent(QMouseEvent* e) override;
93  void leaveEvent(QEvent* e) override;
94  void showEvent(QShowEvent* e) override;
95  void dropEvent(QDropEvent* e) override;
96  void dragMoveEvent(QDragMoveEvent* e) override;
97  void dragEnterEvent(QDragEnterEvent* e) override;
98 
99 #if (QT_VERSION > QT_VERSION_CHECK(5, 99, 0))
100  void enterEvent(QEnterEvent*) override;
101 #else
102  void enterEvent(QEvent*) override;
103 #endif
104 
105 
106 private Q_SLOTS:
107 
108  void imageLoaded();
109  void imageLoadingFailed();
110 
111  void slotAssignTag(int tagID);
112  void slotRemoveTag(int tagID);
113  void slotAssignRating(int rating);
114  void slotAssignPickLabel(int pickId);
115  void slotAssignColorLabel(int colorId);
116 
117  void slotThemeChanged();
118  void slotSetupChanged();
119 
120  void slotRotateLeft();
121  void slotRotateRight();
122  void slotDeleteItem();
123 
128  void slotUpdateFaces();
129 
130  void slotShowContextMenu(QGraphicsSceneContextMenuEvent* event);
131 
132  void slotSlideShowCurrent();
133 
134 private:
135 
136  class Private;
137  Private* const d;
138 };
139 
140 } // namespace Digikam
141 
142 #endif // DIGIKAM_ITEM_PREVIEW_VIEW_H
Abstract base class for all album types.
Definition: album.h:67
Definition: graphicsdimgview.h:44
Definition: iteminfo.h:78
Definition: itempreviewview.h:46
void showEvent(QShowEvent *e) override
Definition: itempreviewview.cpp:421
Mode
Definition: itempreviewview.h:52
@ IconViewPreview
Definition: itempreviewview.h:53
void mousePressEvent(QMouseEvent *e) override
Definition: itempreviewview.cpp:718
void setImagePath(const QString &path=QString())
void setPreviousNextPaths(const QString &previous, const QString &next)
void dragMoveEvent(QDragMoveEvent *e) override
Definition: itempreviewview.cpp:663
void signalGotoAlbumAndItem(const ItemInfo &)
void signalPreviewLoaded(bool success)
void dragEnterEvent(QDragEnterEvent *e) override
Definition: itempreviewview.cpp:674
void signalGotoDateAndItem(const ItemInfo &)
void enterEvent(QEvent *) override
Definition: itempreviewview.cpp:410
~ItemPreviewView() override
Definition: itempreviewview.cpp:322
void setItemInfo(const ItemInfo &info=ItemInfo(), const ItemInfo &previous=ItemInfo(), const ItemInfo &next=ItemInfo())
Definition: itempreviewview.cpp:369
void reload()
Definition: itempreviewview.cpp:329
ItemPreviewView(QWidget *const parent, Mode mode=IconViewPreview, Album *const currAlbum=nullptr)
Definition: itempreviewview.cpp:152
void dropEvent(QDropEvent *e) override
Definition: itempreviewview.cpp:685
ItemInfo getItemInfo() const
Definition: itempreviewview.cpp:392
void signalAddToExistingQueue(int)
void leaveEvent(QEvent *e) override
Definition: itempreviewview.cpp:416
bool acceptsMouseClick(QMouseEvent *e) override
Definition: itempreviewview.cpp:397
Definition: lighttablepreview.h:43
@ Album
Definition: coredbfields.h:58
Definition: datefolderview.cpp:43