File indexing completed on 2025-01-05 03:59:46
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2004-09-18 0007 * Description : camera item info container 0008 * 0009 * SPDX-FileCopyrightText: 2004-2005 by Renchi Raju <renchi dot raju at gmail dot com> 0010 * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #ifndef DIGIKAM_CAMITEM_INFO_H 0017 #define DIGIKAM_CAMITEM_INFO_H 0018 0019 // Qt includes 0020 0021 #include <QList> 0022 #include <QByteArray> 0023 #include <QDateTime> 0024 #include <QDebug> 0025 #include <QUrl> 0026 0027 // Local includes 0028 0029 #include "photoinfocontainer.h" 0030 #include "videoinfocontainer.h" 0031 #include "digikam_export.h" 0032 0033 class QDataStream; 0034 0035 namespace Digikam 0036 { 0037 0038 class DIGIKAM_GUI_EXPORT CamItemInfo 0039 { 0040 0041 public: 0042 0043 enum DownloadStatus 0044 { 0045 DownloadUnknown = -1, ///< Download state is unknown 0046 DownloadedNo = 0, ///< Is not yet downloaded on computer 0047 DownloadedYes = 1, ///< Is already downloaded on computer 0048 DownloadFailed = 2, ///< Download is failed or have been aborted by user 0049 DownloadStarted = 3, ///< Download is under progress 0050 NewPicture = 4 ///< This is a new item from camera 0051 }; 0052 0053 public: 0054 0055 explicit CamItemInfo(); 0056 ~CamItemInfo(); 0057 0058 /** 0059 * Return true if all member in this container are null. 0060 */ 0061 bool isNull() const; 0062 0063 /** 0064 * Return the local file system (mounted on computer) url to the camera file. 0065 */ 0066 QUrl url() const; 0067 0068 /** 0069 * Compare for camera information equality, not including variable values. 0070 */ 0071 bool operator==(const CamItemInfo& info) const; 0072 0073 /** 0074 * Compare for camera information un-equality, not including variable values. 0075 */ 0076 bool operator!=(const CamItemInfo& info) const; 0077 0078 public: 0079 0080 /// Static values taken from camera. 0081 qint64 size; ///< Camera file size in bytes. 0082 0083 int width; ///< Image width in pixels 0084 int height; ///< Image height in pixels 0085 int readPermissions; ///< Read permission of camera file 0086 int writePermissions; ///< Write permission of camera file 0087 0088 QString name; ///< File name in camera file-system 0089 QString folder; ///< Folder path to access to file in camera 0090 QString mime; ///< Type mime of camera file 0091 0092 QDateTime ctime; ///< Created time stamp of camera file 0093 0094 PhotoInfoContainer photoInfo; ///< Photo Info from camera file (get from file metadata) 0095 0096 /// Variable values depending of user actions. 0097 int downloaded; ///< Download status of camera file. See DownloadStatus enum for details 0098 QString downloadName; ///< Preview of the file-name to use during download from camera 0099 0100 /// Unique image id 0101 qlonglong id; 0102 0103 int rating; ///< Pre-rating value of camera file. 0104 0105 int pickLabel; ///< Pre-picklabel value of camera file. 0106 0107 int colorLabel; ///< Pre-picklabel value of camera file. 0108 0109 QList<int> tagIds; ///< Pre-tags ids of camera file. 0110 bool previewPossible; 0111 }; 0112 0113 QDataStream& operator<<(QDataStream&, const CamItemInfo&); 0114 QDataStream& operator>>(QDataStream&, CamItemInfo&); 0115 0116 typedef QList<CamItemInfo> CamItemInfoList; 0117 0118 //! qDebug() stream operator. Writes property @a info to the debug output in a nicely formatted way. 0119 QDebug operator<<(QDebug dbg, const CamItemInfo& info); 0120 0121 } // namespace Digikam 0122 0123 #endif // DIGIKAM_CAMITEM_INFO_H