digiKam
umscamera.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 : 2004-12-21
7  * Description : USB Mass Storage camera interface
8  *
9  * Copyright (C) 2004-2005 by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
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_UMS_CAMERA_H
26 #define DIGIKAM_UMS_CAMERA_H
27 
28 // Qt includes
29 
30 #include <QStringList>
31 
32 // Local includes
33 
34 #include "dkcamera.h"
35 
36 namespace Digikam
37 {
38 
39 class DMetadata;
40 
44 class UMSCamera : public DKCamera
45 {
46  Q_OBJECT
47 
48 public:
49 
50  explicit UMSCamera(const QString& title, const QString& model, const QString& port, const QString& path);
51  ~UMSCamera() override;
52 
53  QByteArray cameraMD5ID() override;
55 
56  bool doConnect() override;
57  void cancel() override;
58 
59  bool getFolders(const QString& folder) override;
60  bool getItemsInfoList(const QString& folder, bool useMetadata, CamItemInfoList& infoList) override;
61  void getItemInfo(const QString& folder, const QString& itemName, CamItemInfo& info, bool useMetadata) override;
62 
63  bool getThumbnail(const QString& folder, const QString& itemName, QImage& thumbnail) override;
64  bool getMetadata(const QString& folder, const QString& itemName, DMetadata& meta) override;
65 
66  bool setLockItem(const QString& folder, const QString& itemName, bool lock) override;
67 
68  bool downloadItem(const QString& folder, const QString& itemName, const QString& saveFile) override;
69  bool deleteItem(const QString& folder, const QString& itemName) override;
70  bool uploadItem(const QString& folder, const QString& itemName, const QString& localFile, CamItemInfo& info) override;
71 
72  bool cameraSummary(QString& summary) override;
73  bool cameraManual(QString& manual) override;
74  bool cameraAbout(QString& about) override;
75 
76  bool getFreeSpace(unsigned long& kBSize, unsigned long& kBAvail) override;
77 
78  bool getPreview(QImage& preview) override;
79  bool capture(CamItemInfo& itemInfo) override;
80 
81 private:
82 
88  void getUUIDFromSolid();
89 
90 private:
91 
92  bool m_cancel;
93 
94 private:
95 
96  // Disable
97  explicit UMSCamera(QObject*) = delete;
98 };
99 
100 } // namespace Digikam
101 
102 #endif // DIGIKAM_UMS_CAMERA_H
Definition: camiteminfo.h:48
Definition: dkcamera.h:45
CameraDriverType
Definition: dkcamera.h:51
QString path() const
Definition: dkcamera.cpp:80
QString title() const
Definition: dkcamera.cpp:65
QString port() const
Definition: dkcamera.cpp:75
QString model() const
Definition: dkcamera.cpp:70
Definition: dmetadata.h:55
Definition: umscamera.h:45
void cancel() override
Definition: umscamera.cpp:157
bool cameraAbout(QString &about) override
Definition: umscamera.cpp:617
void getItemInfo(const QString &folder, const QString &itemName, CamItemInfo &info, bool useMetadata) override
Definition: umscamera.cpp:215
bool getMetadata(const QString &folder, const QString &itemName, DMetadata &meta) override
Definition: umscamera.cpp:349
bool getFolders(const QString &folder) override
Definition: umscamera.cpp:164
bool setLockItem(const QString &folder, const QString &itemName, bool lock) override
Definition: umscamera.cpp:432
bool deleteItem(const QString &folder, const QString &itemName) override
Definition: umscamera.cpp:459
bool getItemsInfoList(const QString &folder, bool useMetadata, CamItemInfoList &infoList) override
If getImageDimensions is false, the camera shall set width and height to -1 if the values are not imm...
Definition: umscamera.cpp:191
bool getFreeSpace(unsigned long &kBSize, unsigned long &kBAvail) override
NOTE: implemented in gui, outside the camera thread.
Definition: umscamera.cpp:122
QByteArray cameraMD5ID() override
Definition: umscamera.cpp:104
bool uploadItem(const QString &folder, const QString &itemName, const QString &localFile, CamItemInfo &info) override
Definition: umscamera.cpp:487
DKCamera::CameraDriverType cameraDriverType() override
Definition: umscamera.cpp:99
bool doConnect() override
Definition: umscamera.cpp:127
UMSCamera(const QString &title, const QString &model, const QString &port, const QString &path)
Definition: umscamera.cpp:75
bool cameraManual(QString &manual) override
Definition: umscamera.cpp:609
bool capture(CamItemInfo &itemInfo) override
Method not supported by UMS camera.
Definition: umscamera.cpp:94
bool getPreview(QImage &preview) override
Method not supported by UMS camera.
Definition: umscamera.cpp:88
bool getThumbnail(const QString &folder, const QString &itemName, QImage &thumbnail) override
Definition: umscamera.cpp:265
~UMSCamera() override
Definition: umscamera.cpp:83
bool downloadItem(const QString &folder, const QString &itemName, const QString &saveFile) override
Definition: umscamera.cpp:381
bool cameraSummary(QString &summary) override
Definition: umscamera.cpp:577
Definition: datefolderview.cpp:43