File indexing completed on 2025-01-19 03:50:43

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2006-21-12
0007  * Description : a embedded item-view to show the canvas preview widget.
0008  *
0009  * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier  <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2009-2012 by Andi Clemens <andi dot clemens at gmail dot com>
0011  * SPDX-FileCopyrightText: 2010-2011 by Aditya Bhatt <adityabhatt1991 at gmail dot com>
0012  *
0013  * SPDX-License-Identifier: GPL-2.0-or-later
0014  *
0015  * ============================================================ */
0016 
0017 #ifndef DIGIKAM_ITEM_PREVIEW_CANVAS_H
0018 #define DIGIKAM_ITEM_PREVIEW_CANVAS_H
0019 
0020 // Local includes
0021 
0022 #include "digikam_config.h"
0023 #include "dimgpreviewitem.h"
0024 #include "iteminfo.h"
0025 
0026 class QGraphicsSceneContextMenuEvent;
0027 class QGraphicsSceneHoverEvent;
0028 
0029 namespace Digikam
0030 {
0031 
0032 class FaceGroup;
0033 
0034 class ItemPreviewCanvas : public DImgPreviewItem
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039 
0040     explicit ItemPreviewCanvas();
0041     ~ItemPreviewCanvas()                                      override;
0042 
0043     void setItemInfo(const ItemInfo& info);
0044     ItemInfo imageInfo()                            const;
0045 
0046     void setFaceGroup(FaceGroup* const group);
0047 
0048 protected:
0049 
0050     void hoverEnterEvent(QGraphicsSceneHoverEvent* e)         override;
0051     void hoverLeaveEvent(QGraphicsSceneHoverEvent* e)         override;
0052     void hoverMoveEvent(QGraphicsSceneHoverEvent* e)          override;
0053 
0054 private:
0055 
0056     // Disable
0057     ItemPreviewCanvas(QObject*) = delete;
0058 
0059 private:
0060 
0061     class Private;
0062     Private* const d;
0063 };
0064 
0065 } // namespace Digikam
0066 
0067 #endif // DIGIKAM_ITEM_PREVIEW_CANVAS_H