File indexing completed on 2025-01-05 03:56:30

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2010-08-20
0007  * Description : central place for MetaEngine settings
0008  *
0009  * SPDX-FileCopyrightText: 2010-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_META_ENGINE_SETTINGS_H
0016 #define DIGIKAM_META_ENGINE_SETTINGS_H
0017 
0018 // Qt includes
0019 
0020 #include <QObject>
0021 
0022 // Local includes
0023 
0024 #include "digikam_export.h"
0025 #include "metaenginesettingscontainer.h"
0026 
0027 namespace Digikam
0028 {
0029 
0030 class DIGIKAM_EXPORT MetaEngineSettings : public QObject
0031 {
0032     Q_OBJECT
0033 
0034 public:
0035 
0036     /**
0037      * Global container for Metadata settings. All accessor methods are thread-safe.
0038      */
0039     static MetaEngineSettings* instance();
0040 
0041     /**
0042      * Returns the current Metadata settings.
0043      */
0044     MetaEngineSettingsContainer settings() const;
0045 
0046     /**
0047      * Sets the current Metadata settings and writes them to config.
0048      */
0049     void setSettings(const MetaEngineSettingsContainer& settings);
0050 
0051     /**
0052      * Shortcut to get exif rotation settings from container.
0053      */
0054     bool exifRotate()                      const;
0055 
0056 Q_SIGNALS:
0057 
0058     void signalSettingsChanged();
0059 
0060     void signalMetaEngineSettingsChanged(const MetaEngineSettingsContainer& current,
0061                                          const MetaEngineSettingsContainer& previous);
0062 
0063 private:
0064 
0065     // Disabled
0066     MetaEngineSettings();
0067     explicit MetaEngineSettings(QObject*);
0068     ~MetaEngineSettings() override;
0069 
0070     void readFromConfig();
0071 
0072 private:
0073 
0074     class Private;
0075     Private* const d;
0076 
0077     friend class MetaEngineSettingsCreator;
0078 };
0079 
0080 } // namespace Digikam
0081 
0082 #endif // DIGIKAM_META_ENGINE_SETTINGS_H