File indexing completed on 2025-03-09 03:52:09

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2007-02-13
0007  * Description : slide show settings container.
0008  *
0009  * SPDX-FileCopyrightText: 2007-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2019-2020 by Minh Nghia Duong <minhnghiaduong997 at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_SLIDESHOW_SETTINGS_PLUGIN_H
0017 #define DIGIKAM_SLIDESHOW_SETTINGS_PLUGIN_H
0018 
0019 // Qt includes
0020 
0021 #include <QMap>
0022 #include <QColor>
0023 #include <QString>
0024 #include <QFont>
0025 #include <QUrl>
0026 
0027 // Local includes
0028 
0029 #include "digikam_export.h"
0030 #include "previewsettings.h"
0031 #include "dinfointerface.h"
0032 #include "dplugingeneric.h"
0033 
0034 using namespace Digikam;
0035 
0036 namespace DigikamGenericSlideShowPlugin
0037 {
0038 
0039 /**
0040  * This class contain all settings to perform a slide show of a group of pictures
0041  */
0042 class SlideShowSettings
0043 {
0044 
0045 public:
0046 
0047     explicit SlideShowSettings();
0048     ~SlideShowSettings();
0049 
0050     void readFromConfig();
0051     void writeToConfig();
0052 
0053     int  indexOf(const QUrl&) const;
0054     int  count()              const;
0055 
0056     void suffleImages();
0057 
0058 public:
0059 
0060     /// Global Slide Show Settings
0061 
0062     /**
0063      * Start Slide with current selected item
0064      */
0065     bool                         startWithCurrent;
0066 
0067     /**
0068      * Auto-rotate image accordingly with Exif Rotation tag
0069      */
0070     bool                         exifRotate;
0071 
0072     /**
0073      * Print picture file name while slide
0074      */
0075     bool                         printName;
0076 
0077     /**
0078      * Print picture creation date while slide
0079      */
0080     bool                         printDate;
0081 
0082     /**
0083      * Print camera Aperture and Focal while slide
0084      */
0085     bool                         printApertureFocal;
0086 
0087     /**
0088      * Print camera Make and Model while slide
0089      */
0090     bool                         printMakeModel;
0091 
0092     /**
0093      * Print camera Lens model while slide
0094      */
0095     bool                         printLensModel;
0096 
0097     /**
0098      * Print camera Exposure and Sensitivity while slide
0099      */
0100     bool                         printExpoSensitivity;
0101 
0102     /**
0103      * Print picture comment while slide
0104      */
0105     bool                         printComment;
0106 
0107     /**
0108      * Print image title while slide
0109      */
0110     bool                         printTitle;
0111 
0112     /**
0113      * Print image captions if no title available while slide
0114      */
0115     bool                         printCapIfNoTitle;
0116 
0117     /**
0118      * Print tag names while slide
0119      */
0120     bool                         printTags;
0121 
0122     /**
0123      * Print color label and pick label while slide
0124      */
0125     bool                         printLabels;
0126 
0127     /**
0128      * Print rating while slide
0129      */
0130     bool                         printRating;
0131 
0132     /**
0133      * Slide pictures in loop
0134      */
0135     bool                         loop;
0136 
0137     /**
0138      * Suffle pictures
0139      */
0140     bool                         suffle;
0141 
0142     /**
0143      * Delay in seconds
0144      */
0145     int                          delay;
0146 
0147     /**
0148      * Whether to enable the auto-move feature.
0149      */
0150     bool                         autoPlayEnabled;
0151 
0152     /**
0153      * Screen to use in case of multi-monitor computer.
0154      */
0155     int                          slideScreen;
0156 
0157     /**
0158      * Show progress indicator
0159      */
0160     bool                         showProgressIndicator;
0161 
0162     /**
0163      * Load images (previews) in full size, not reduced version
0164      */
0165     PreviewSettings              previewSettings;
0166 
0167     /**
0168      * List of pictures URL to slide
0169      */
0170     QList<QUrl>                  fileList;
0171 
0172     /**
0173      * Original list of pictures URL to slide
0174      */
0175     QList<QUrl>                  originalFileList;
0176 
0177     /**
0178      * URL of the first image to show if requested
0179      */
0180     QUrl                         imageUrl;
0181 
0182     /**
0183      * Font for the display of caption text
0184      */
0185     QFont                        captionFont;
0186 
0187     /**
0188      * Interface to access to host application data
0189      */
0190     DInfoInterface*              iface;
0191 
0192     /**
0193      * The plugin instance.
0194      */
0195     DPluginGeneric*              plugin;
0196 
0197 private:
0198 
0199     static const QString         configGroupName;
0200     static const QString         configSlideShowStartCurrentEntry;
0201     static const QString         configSlideShowDelayEntry;
0202     static const QString         configSlideShowLoopEntry;
0203     static const QString         configSlideShowSuffleEntry;
0204     static const QString         configSlideShowPrintApertureFocalEntry;
0205     static const QString         configSlideShowPrintCommentEntry;
0206     static const QString         configSlideShowPrintTitleEntry;
0207     static const QString         configSlideShowPrintCapIfNoTitleEntry;
0208     static const QString         configSlideShowPrintDateEntry;
0209     static const QString         configSlideShowPrintExpoSensitivityEntry;
0210     static const QString         configSlideShowPrintMakeModelEntry;
0211     static const QString         configSlideShowPrintLensModelEntry;
0212     static const QString         configSlideShowPrintNameEntry;
0213     static const QString         configSlideShowPrintTagsEntry;
0214     static const QString         configSlideShowPrintLabelsEntry;
0215     static const QString         configSlideShowPrintRatingEntry;
0216     static const QString         configSlideShowProgressIndicatorEntry;
0217     static const QString         configSlideShowCaptionFontEntry;
0218     static const QString         configSlideScreenEntry;
0219 };
0220 
0221 } // namespace DigikamGenericSlideShowPlugin
0222 
0223 #endif // DIGIKAM_SLIDESHOW_SETTINGS_PLUGIN_H