File indexing completed on 2025-01-19 03:59:41

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2003-02-03
0007  * Description : Cameras list container
0008  *
0009  * SPDX-FileCopyrightText: 2003-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_CAMERA_LIST_H
0017 #define DIGIKAM_CAMERA_LIST_H
0018 
0019 // Qt includes
0020 
0021 #include <QList>
0022 #include <QObject>
0023 
0024 // Local includes
0025 
0026 #include "digikam_export.h"
0027 
0028 class QString;
0029 class QDateTime;
0030 class QAction;
0031 
0032 namespace Digikam
0033 {
0034 
0035 class CameraType;
0036 
0037 class DIGIKAM_GUI_EXPORT CameraList : public QObject
0038 {
0039     Q_OBJECT
0040 
0041 public:
0042 
0043     CameraList(QObject* const parent, const QString& file);
0044     ~CameraList() override;
0045 
0046     bool load();
0047     bool save();
0048     void clear();
0049 
0050     void insert(CameraType* const ctype);
0051     void remove(CameraType* const ctype);
0052 
0053     CameraType*         autoDetect(bool& retry);
0054     CameraType*         find(const QString& title) const;
0055     QList<CameraType*>* cameraList()               const;
0056 
0057     bool changeCameraStartIndex(const QString& cameraTitle, int startIndex);
0058 
0059     static bool findConnectedCamera(int vendorId, int productId, QString& model, QString& port);
0060 
0061     static CameraList* defaultList();
0062 
0063 Q_SIGNALS:
0064 
0065     void signalCameraAdded(CameraType*);
0066     void signalCameraRemoved(QAction*);
0067 
0068 private:
0069 
0070     void insertPrivate(CameraType* const ctype);
0071     void removePrivate(CameraType* const ctype);
0072 
0073 private:
0074 
0075     static CameraList* m_defaultList;
0076 
0077     class Private;
0078     Private* const d;
0079 };
0080 
0081 } // namespace Digikam
0082 
0083 #endif // DIGIKAM_CAMERA_LIST_H