MauiKit Image Tools

picinfomodel.h
1// Copyright 2018-2020 Camilo Higuita <milo.h@aol.com>
2// Copyright 2018-2020 Nitrux Latinoamericana S.C.
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5
6#pragma once
7
8#include <QAbstractListModel>
9#include <QObject>
10
11#include <MauiKit4/Core/mauilist.h>
12
13#include <QFileInfo>
14
15class Exiv2Extractor;
16
17/**
18 * @brief
19 */
20class PicInfoModel : public MauiList
21{
23
24 /**
25 *
26 */
27 Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
28 Q_PROPERTY(QString fileName MEMBER m_fileName NOTIFY fileNameChanged FINAL)
29 Q_PROPERTY(double lat READ latitude NOTIFY dataReady FINAL)
30 Q_PROPERTY(double lon READ longitude NOTIFY dataReady FINAL)
31
32public:
33 enum ROLES { KEY, VALUE };
34 explicit PicInfoModel(QObject *parent = nullptr);
35
36 QUrl url() const;
37 void componentComplete() override final;
38
39public Q_SLOTS:
40 void setUrl(QUrl url);
41
42 double latitude() const;
43 double longitude() const;
44
45 bool removeTag(const QString &tag);
46 bool editTag(const QString &tag, const QString &value);
47
48private:
49 Exiv2Extractor *m_extractor;
50 QUrl m_url;
51 QString m_fileName;
52 FMH::MODEL_LIST m_data;
53
54 double m_longitude;
55 double m_latitude;
56
57 void parse();
58
60 void urlChanged(QUrl url);
61 void fileNameChanged();
62 void dataReady();
63
64 // MauiList interface
65public:
66 const FMH::MODEL_LIST &items() const override;
67};
Image metadata extractor.
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:32:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.