digiKam
gpsitemlist.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 : 2010-03-22
7  * Description : A view to display a list of items with GPS info.
8  *
9  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2010 by Michael G. Hansen <mike at mghansen dot de>
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_GPS_ITEM_LIST_H
26 #define DIGIKAM_GPS_ITEM_LIST_H
27 
28 // Qt includes
29 
30 #include <QTreeView>
31 
32 // Local includes
33 
34 #include "gpsitemmodel.h"
35 #include "gpsitemsortproxymodel.h"
36 #include "digikam_export.h"
37 
38 class QWheelEvent;
39 class KConfigGroup;
40 
41 namespace Digikam
42 {
43 
44 class ItemListDragDropHandler;
45 
46 class DIGIKAM_EXPORT GPSItemList : public QTreeView
47 {
48  Q_OBJECT
49 
50 public:
51 
52  explicit GPSItemList(QWidget* const parent = nullptr);
53  ~GPSItemList() override;
54 
55  void setModelAndSelectionModel(GPSItemModel* const model, QItemSelectionModel* const selectionModel);
56  GPSItemModel* getModel() const;
57  QItemSelectionModel* getSelectionModel() const;
58  void setDragDropHandler(ItemListDragDropHandler* const dragDropHandler);
59  void setThumbnailSize(const int size);
60  GPSItemSortProxyModel* getSortProxyModel() const;
61 
62  void saveSettingsToGroup(KConfigGroup* const group);
63  void readSettingsFromGroup(const KConfigGroup* const group);
64  void setEditEnabled(const bool state);
65  void setDragEnabled(const bool state);
66 
67 Q_SIGNALS:
68 
69  void signalImageActivated(const QModelIndex& index);
70 
71 public Q_SLOTS:
72 
73  void slotIncreaseThumbnailSize();
74  void slotDecreaseThumbnailSize();
75  void slotUpdateActionsEnabled();
76 
77 private Q_SLOTS:
78 
79  void slotInternalTreeViewImageActivated(const QModelIndex& current, const QModelIndex& previous);
80  void slotThumbnailFromModel(const QPersistentModelIndex& index, const QPixmap& pixmap);
81  void slotColumnVisibilityActionTriggered(QAction* action);
82 
83 protected:
84 
85  bool eventFilter(QObject* watched, QEvent* event) override;
86  void startDrag(Qt::DropActions supportedActions) override;
87  void wheelEvent(QWheelEvent* we) override;
88 
89 private:
90 
91  class Private;
92  Private* const d;
93 };
94 
95 } // namespace Digikam
96 
97 #endif // DIGIKAM_GPS_ITEM_LIST_H
Definition: gpsitemlist.h:47
void signalImageActivated(const QModelIndex &index)
Definition: gpsitemmodel.h:43
Definition: gpsitemsortproxymodel.h:44
Definition: gpsitemlistdragdrophandler.h:41
Definition: datefolderview.cpp:43