File indexing completed on 2025-01-19 03:50:48

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2013-03-14
0007  * Description : Table view column helpers: Photo properties
0008  *
0009  * SPDX-FileCopyrightText: 2017-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2013      by Michael G. Hansen <mike at mghansen dot de>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_TABLE_VIEW_COLUMN_PHOTO_H
0017 #define DIGIKAM_TABLE_VIEW_COLUMN_PHOTO_H
0018 
0019 // Qt includes
0020 
0021 #include <QStringList>
0022 
0023 // Local includes
0024 
0025 #include "tableview_columnfactory.h"
0026 
0027 class QComboBox;
0028 
0029 namespace Digikam
0030 {
0031 
0032 namespace TableViewColumns
0033 {
0034 
0035 class ColumnPhotoProperties : public TableViewColumn
0036 {
0037     Q_OBJECT
0038 
0039 public:
0040 
0041     enum SubColumn
0042     {
0043         SubColumnCameraMaker  = 0,
0044         SubColumnCameraModel  = 1,
0045         SubColumnLens         = 2,
0046         SubColumnAperture     = 3,
0047         SubColumnFocal        = 4,
0048         SubColumnExposure     = 5,
0049         SubColumnSensitivity  = 6,
0050         SubColumnModeProgram  = 7,
0051         SubColumnFlash        = 8,
0052         SubColumnWhiteBalance = 9
0053     };
0054 
0055 private:
0056 
0057     SubColumn subColumn;
0058 
0059 public:
0060 
0061     explicit ColumnPhotoProperties(TableViewShared* const tableViewShared,
0062                                    const TableViewColumnConfiguration& pConfiguration,
0063                                    const SubColumn pSubColumn,
0064                                    QObject* const parent = nullptr);
0065     ~ColumnPhotoProperties() override;
0066 
0067     QString getTitle()                                                                                const override;
0068     ColumnFlags getColumnFlags()                                                                      const override;
0069     QVariant data(TableViewModel::Item* const item, const int role)                                   const override;
0070     ColumnCompareResult compare(TableViewModel::Item* const itemA, TableViewModel::Item* const itemB) const override;
0071     TableViewColumnConfigurationWidget* getConfigurationWidget(QWidget* const parentWidget)           const override;
0072     void setConfiguration(const TableViewColumnConfiguration& newConfiguration) override;
0073 
0074     static TableViewColumnDescription getDescription();
0075     static QStringList getSubColumns();
0076 };
0077 
0078 // ----------------------------------------------------------------------------------------------------------------------
0079 
0080 class ColumnPhotoConfigurationWidget : public TableViewColumnConfigurationWidget
0081 {
0082     Q_OBJECT
0083 
0084 public:
0085 
0086     explicit ColumnPhotoConfigurationWidget(TableViewShared* const sharedObject,
0087                                             const TableViewColumnConfiguration& columnConfiguration,
0088                                             QWidget* const parentWidget);
0089     ~ColumnPhotoConfigurationWidget() override;
0090 
0091     TableViewColumnConfiguration getNewConfiguration() override;
0092 
0093 private Q_SLOTS:
0094 
0095     void slotUpdateUI();
0096 
0097 private:
0098 
0099     ColumnPhotoProperties::SubColumn subColumn;
0100     QComboBox*                       selectorExposureTimeFormat;
0101     QComboBox*                       selectorExposureTimeUnit;
0102 };
0103 
0104 } // namespace TableViewColumns
0105 
0106 } // namespace Digikam
0107 
0108 #endif // DIGIKAM_TABLE_VIEW_COLUMN_PHOTO_H