File indexing completed on 2024-04-28 15:39:07

0001 // SPDX-FileCopyrightText: 2020-2022 Tobias Leupold <tl at stonemx dot de>
0002 //
0003 // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 
0005 #ifndef PREVIEWWIDGET_H
0006 #define PREVIEWWIDGET_H
0007 
0008 // Local includes
0009 #include "KGeoTag.h"
0010 
0011 // Qt includes
0012 #include <QWidget>
0013 #include <QHash>
0014 #include <QModelIndex>
0015 
0016 // Local classes
0017 class SharedObjects;
0018 class CoordinatesFormatter;
0019 class ImagePreview;
0020 
0021 // Qt classes
0022 class QLabel;
0023 class QLocale;
0024 class QToolButton;
0025 
0026 class PreviewWidget : public QWidget
0027 {
0028     Q_OBJECT
0029 
0030 public:
0031     explicit PreviewWidget(SharedObjects *sharedObjects, QWidget *parent = nullptr);
0032     QString currentImage() const;
0033     void setCameraClockDeviation(int deviation);
0034     void reload();
0035 
0036 public Q_SLOTS:
0037     void setImage(const QModelIndex &index = QModelIndex());
0038 
0039 private Q_SLOTS:
0040     void openExternally();
0041 
0042 private: // Variables
0043     CoordinatesFormatter *m_formatter;
0044     const QLocale *m_locale;
0045 
0046     ImagePreview *m_preview;
0047 
0048     QLabel *m_path;
0049     QToolButton *m_openExternally;
0050     QLabel *m_dateTimeLabel;
0051     QLabel *m_date;
0052     QLabel *m_coordinates;
0053     QHash<KGeoTag::MatchType, QString> m_matchString;
0054     QString m_currentImage;
0055     QModelIndex m_currentIndex;
0056     int m_cameraClockDeviation = 0;
0057 
0058 };
0059 
0060 #endif // PREVIEWWIDGET_H