digiKam
importpreviewview.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 : 2012-14-07
7  * Description : An embedded view to show the cam item preview widget.
8  *
9  * Copyright (C) 2012 by Islam Wazery <wazery at ubuntu 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_IMPORT_PREVIEW_VIEW_H
25 #define DIGIKAM_IMPORT_PREVIEW_VIEW_H
26 
27 // Local includes
28 
29 #include "graphicsdimgview.h"
30 #include "camiteminfo.h"
31 
32 namespace Digikam
33 {
34 
36 {
37  Q_OBJECT
38 
39 public:
40 
41  enum Mode
42  {
44  };
45 
46 public:
47 
48  explicit ImportPreviewView(QWidget* const parent, Mode mode = IconViewPreview);
49  ~ImportPreviewView() override;
50 
51  void setCamItemInfo(const CamItemInfo& info = CamItemInfo(),
52  const CamItemInfo& previous = CamItemInfo(),
53  const CamItemInfo& next = CamItemInfo());
54 
56 
57  void reload();
58  void setCamItemPath(const QString& path = QString());
59  void setPreviousNextPaths(const QString& previous, const QString& next);
60 
61  void showContextMenu(const CamItemInfo& info, QGraphicsSceneContextMenuEvent* event);
62 
63 private:
64 
65  QString identifyCategoryforMime(const QString& mime);
66 
67 Q_SIGNALS:
68 
72  void signalPreviewLoaded(bool success);
74 /*
75  FIXME
76  void signalAddToExistingQueue(int);
77  void signalGotoFolderAndItem(const CamItemInfo&);
78  void signalGotoDateAndItem(const CamItemInfo&);
79  void signalGotoTagAndItem(int);
80  void signalPopupTagsView();
81 */
84  void signalAssignRating(int);
85 
86 
87 protected:
88 
89  bool acceptsMouseClick(QMouseEvent* e) override;
90  void leaveEvent(QEvent* e) override;
91  void showEvent(QShowEvent* e) override;
92 
93 #if (QT_VERSION > QT_VERSION_CHECK(5, 99, 0))
94  void enterEvent(QEnterEvent*) override;
95 #else
96  void enterEvent(QEvent*) override;
97 #endif
98 
99 private Q_SLOTS:
100 
101  void camItemLoaded();
102  void camItemLoadingFailed();
103 /*
104  TODO: Implement Tags and Labels in Import Tool
105  void slotAssignTag(int tagID);
106  void slotRemoveTag(int tagID);
107  void slotAssignPickLabel(int pickId);
108  void slotAssignColorLabel(int colorId);
109 */
110  void slotThemeChanged();
111  void slotSetupChanged();
112 
113  void slotRotateLeft();
114  void slotRotateRight();
115  void slotDeleteItem();
116 
117 private:
118 
119  class Private;
120  Private* const d;
121 };
122 
123 } // namespace Digikam
124 
125 #endif // DIGIKAM_IMPORT_PREVIEW_VIEW_H
Definition: camiteminfo.h:48
Definition: graphicsdimgview.h:44
Definition: importpreviewview.h:36
~ImportPreviewView() override
Definition: importpreviewview.cpp:291
void reload()
Definition: importpreviewview.cpp:297
CamItemInfo getCamItemInfo() const
Definition: importpreviewview.cpp:355
bool acceptsMouseClick(QMouseEvent *e) override
Definition: importpreviewview.cpp:360
void signalPreviewLoaded(bool success)
void showContextMenu(const CamItemInfo &info, QGraphicsSceneContextMenuEvent *event)
Definition: importpreviewview.cpp:405
void showEvent(QShowEvent *e) override
Definition: importpreviewview.cpp:396
void enterEvent(QEvent *) override
Definition: importpreviewview.cpp:377
void leaveEvent(QEvent *e) override
Definition: importpreviewview.cpp:387
void setPreviousNextPaths(const QString &previous, const QString &next)
ImportPreviewView(QWidget *const parent, Mode mode=IconViewPreview)
Definition: importpreviewview.cpp:186
void setCamItemPath(const QString &path=QString())
Mode
Definition: importpreviewview.h:42
@ IconViewPreview
Definition: importpreviewview.h:43
void setCamItemInfo(const CamItemInfo &info=CamItemInfo(), const CamItemInfo &previous=CamItemInfo(), const CamItemInfo &next=CamItemInfo())
Definition: importpreviewview.cpp:324
Definition: datefolderview.cpp:43