File indexing completed on 2025-04-27 03:58:26

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2006-06-23
0007  * Description : a tab widget to display ICC profile infos
0008  *
0009  * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_ICC_PROFILE_WIDGET_H
0016 #define DIGIKAM_ICC_PROFILE_WIDGET_H
0017 
0018 // Qt includes
0019 
0020 #include <QWidget>
0021 #include <QString>
0022 
0023 // Local includes
0024 
0025 #include "metadatawidget.h"
0026 #include "digikam_export.h"
0027 
0028 namespace Digikam
0029 {
0030 
0031 class IccProfile;
0032 
0033 class DIGIKAM_EXPORT ICCProfileWidget : public MetadataWidget
0034 {
0035     Q_OBJECT
0036 
0037 public:
0038 
0039     explicit ICCProfileWidget(QWidget* const parent, int w = 256, int h = 256);
0040     ~ICCProfileWidget() override;
0041 
0042     bool    loadFromURL(const QUrl& url)                  override;
0043     bool    loadFromProfileData(const QString& fileName,
0044                                 const QByteArray& data);
0045     bool    loadProfile(const QString& fileName,
0046                         const IccProfile& data);
0047 
0048     QString getTagDescription(const QString& key)         override;
0049     QString getTagTitle(const QString& key)               override;
0050 
0051     QString getMetadataTitle()                      const override;
0052 
0053     void    setLoadingFailed();
0054     void    setDataLoading();
0055     void    setUncalibratedColor();
0056 
0057     bool  setProfile(const IccProfile& profile);
0058     IccProfile getProfile()                         const;
0059 
0060 protected Q_SLOTS:
0061 
0062     void slotSaveMetadataToFile()                         override;
0063 
0064 private:
0065 
0066     bool decodeMetadata()                                 override;
0067     void buildView()                                      override;
0068 
0069 private:
0070 
0071     class Private;
0072     Private* const d;
0073 };
0074 
0075 } // namespace Digikam
0076 
0077 #endif // DIGIKAM_ICC_PROFILE_WIDGET_H