diff --git a/core/utilities/setup/setupslideshow.cpp b/core/utilities/setup/setupslideshow.cpp index a318562293..a7639c780a 100644 --- a/core/utilities/setup/setupslideshow.cpp +++ b/core/utilities/setup/setupslideshow.cpp @@ -1,286 +1,296 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2005-05-21 * Description : setup tab for slideshow options. * * Copyright (C) 2005-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "setupslideshow.h" // Qt includes #include #include #include #include #include #include #include #include // KDE includes #include // Local includes #include "dlayoutbox.h" #include "dnuminput.h" +#include "dfontselect.h" #include "digikam_debug.h" #include "slideshowsettings.h" namespace Digikam { class Q_DECL_HIDDEN SetupSlideShow::Private { public: explicit Private() : startWithCurrent(0), loopMode(0), showName(0), showDate(0), showApertureFocal(0), showExpoSensitivity(0), showMakeModel(0), showLabels(0), showRating(0), showComment(0), showTitle(0), showTags(0), showCapIfNoTitle(0), showProgress(0), screenPlacement(0), + captionFont(0), delayInput(0) { } QCheckBox* startWithCurrent; QCheckBox* loopMode; QCheckBox* showName; QCheckBox* showDate; QCheckBox* showApertureFocal; QCheckBox* showExpoSensitivity; QCheckBox* showMakeModel; QCheckBox* showLabels; QCheckBox* showRating; QCheckBox* showComment; QCheckBox* showTitle; QCheckBox* showTags; QCheckBox* showCapIfNoTitle; QCheckBox* showProgress; QComboBox* screenPlacement; + + DFontSelect* captionFont; DIntNumInput* delayInput; }; // -------------------------------------------------------- SetupSlideShow::SetupSlideShow(QWidget* const parent) : QScrollArea(parent), d(new Private) { QWidget* const panel = new QWidget(viewport()); setWidget(panel); setWidgetResizable(true); const int spacing = QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing); QVBoxLayout* const layout = new QVBoxLayout(panel); DHBox* const hbox1 = new DHBox(panel); QLabel* const lbl1 = new QLabel(i18n("Delay between images:"), hbox1); lbl1->setAlignment(Qt::AlignLeft | Qt::AlignTop); hbox1->setStretchFactor(lbl1, 5); QWidget* const space = new QWidget(hbox1); hbox1->setStretchFactor(space, 5); d->delayInput = new DIntNumInput(hbox1); d->delayInput->setDefaultValue(5); d->delayInput->setRange(1, 3600, 1); d->delayInput->setWhatsThis(i18n("The delay, in seconds, between images.")); hbox1->setStretchFactor(d->delayInput, 10); d->startWithCurrent = new QCheckBox(i18n("Start with current image"), panel); d->startWithCurrent->setWhatsThis(i18n("If this option is enabled, the Slideshow will be started " "with the current image selected in the images list.")); d->loopMode = new QCheckBox(i18n("Slideshow runs in a loop"), panel); d->loopMode->setWhatsThis(i18n("Run the slideshow in a loop.")); d->showProgress = new QCheckBox(i18n("Show progress indicator"), panel); d->showProgress->setWhatsThis(i18n("Show a progress indicator with pending items to show and time progression.")); d->showName = new QCheckBox(i18n("Show image file name"), panel); d->showName->setWhatsThis(i18n("Show the image file name at the bottom of the screen.")); d->showDate = new QCheckBox(i18n("Show image creation date"), panel); d->showDate->setWhatsThis(i18n("Show the image creation time/date at the bottom of the screen.")); d->showApertureFocal = new QCheckBox(i18n("Show camera aperture and focal length"), panel); d->showApertureFocal->setWhatsThis(i18n("Show the camera aperture and focal length at the bottom of the screen.")); d->showExpoSensitivity = new QCheckBox(i18n("Show camera exposure and sensitivity"), panel); d->showExpoSensitivity->setWhatsThis(i18n("Show the camera exposure and sensitivity at the bottom of the screen.")); d->showMakeModel = new QCheckBox(i18n("Show camera make and model"), panel); d->showMakeModel->setWhatsThis(i18n("Show the camera make and model at the bottom of the screen.")); d->showComment = new QCheckBox(i18n("Show image caption"), panel); d->showComment->setWhatsThis(i18n("Show the image caption at the bottom of the screen.")); d->showTitle = new QCheckBox(i18n("Show image title"), panel); d->showTitle->setWhatsThis(i18n("Show the image title at the bottom of the screen.")); d->showCapIfNoTitle = new QCheckBox(i18n("Show image caption if it has not title"), panel); d->showCapIfNoTitle->setWhatsThis(i18n("Show the image caption at the bottom of the screen if no titles existed.")); d->showTags = new QCheckBox(i18n("Show image tags"), panel); d->showTags->setWhatsThis(i18n("Show the digiKam image tag names at the bottom of the screen.")); d->showLabels = new QCheckBox(i18n("Show image labels"), panel); d->showLabels->setWhatsThis(i18n("Show the digiKam image color label and pick label at the bottom of the screen.")); d->showRating = new QCheckBox(i18n("Show image rating"), panel); d->showRating->setWhatsThis(i18n("Show the digiKam image rating at the bottom of the screen.")); + d->captionFont = new DFontSelect(i18n("Caption font:"), panel); + d->captionFont->setToolTip(i18n("Select here the font used to display text in the slideshow.")); + DHBox* const screenSelectBox = new DHBox(panel); new QLabel(i18n("Screen placement:"), screenSelectBox); d->screenPlacement = new QComboBox(screenSelectBox); d->screenPlacement->setToolTip(i18n("In case of multi-screen computer, select here the monitor to slide contents.")); QStringList choices; choices.append(i18nc("@label:listbox The current screen, for the presentation mode", "Current Screen")); choices.append(i18nc("@label:listbox The default screen for the presentation mode", "Default Screen")); for (int i = 0 ; i < qApp->desktop()->numScreens() ; i++ ) { choices.append(i18nc("@label:listbox %1 is the screen number (0, 1, ...)", "Screen %1", i)); } d->screenPlacement->addItems(choices); // Disable and uncheck the "Show captions if no title" checkbox if the "Show comment" checkbox enabled connect(d->showComment, SIGNAL(stateChanged(int)), this, SLOT(slotSetUnchecked(int))); connect(d->showComment, SIGNAL(toggled(bool)), d->showCapIfNoTitle, SLOT(setDisabled(bool))); // Only digiKam support this feature, showFoto do not support digiKam database information. if (qApp->applicationName() == QLatin1String("showfoto")) { d->showCapIfNoTitle->hide(); d->showLabels->hide(); d->showRating->hide(); d->showTitle->hide(); d->showTags->hide(); } layout->addWidget(hbox1); layout->addWidget(d->startWithCurrent); layout->addWidget(d->loopMode); layout->addWidget(d->showProgress); layout->addWidget(d->showName); layout->addWidget(d->showDate); layout->addWidget(d->showApertureFocal); layout->addWidget(d->showExpoSensitivity); layout->addWidget(d->showMakeModel); layout->addWidget(d->showComment); layout->addWidget(d->showTitle); layout->addWidget(d->showCapIfNoTitle); layout->addWidget(d->showTags); layout->addWidget(d->showLabels); layout->addWidget(d->showRating); + layout->addWidget(d->captionFont); layout->addWidget(screenSelectBox); layout->addStretch(); layout->setContentsMargins(spacing, spacing, spacing, spacing); layout->setSpacing(spacing); readSettings(); } SetupSlideShow::~SetupSlideShow() { delete d; } void SetupSlideShow::slotSetUnchecked(int) { d->showCapIfNoTitle->setCheckState(Qt::Unchecked); } void SetupSlideShow::applySettings() { SlideShowSettings settings; settings.delay = d->delayInput->value(); settings.startWithCurrent = d->startWithCurrent->isChecked(); settings.loop = d->loopMode->isChecked(); settings.printName = d->showName->isChecked(); settings.printDate = d->showDate->isChecked(); settings.printApertureFocal = d->showApertureFocal->isChecked(); settings.printExpoSensitivity = d->showExpoSensitivity->isChecked(); settings.printMakeModel = d->showMakeModel->isChecked(); settings.printComment = d->showComment->isChecked(); settings.printTitle = d->showTitle->isChecked(); settings.printCapIfNoTitle = d->showCapIfNoTitle->isChecked(); settings.printTags = d->showTags->isChecked(); settings.printLabels = d->showLabels->isChecked(); settings.printRating = d->showRating->isChecked(); settings.showProgressIndicator = d->showProgress->isChecked(); + settings.captionFont = d->captionFont->font(); settings.slideScreen = d->screenPlacement->currentIndex() - 2; settings.writeToConfig(); } void SetupSlideShow::readSettings() { SlideShowSettings settings; settings.readFromConfig(); d->delayInput->setValue(settings.delay); d->startWithCurrent->setChecked(settings.startWithCurrent); d->loopMode->setChecked(settings.loop); d->showName->setChecked(settings.printName); d->showDate->setChecked(settings.printDate); d->showApertureFocal->setChecked(settings.printApertureFocal); d->showExpoSensitivity->setChecked(settings.printExpoSensitivity); d->showMakeModel->setChecked(settings.printMakeModel); d->showComment->setChecked(settings.printComment); d->showTitle->setChecked(settings.printTitle); d->showCapIfNoTitle->setChecked(settings.printCapIfNoTitle); d->showTags->setChecked(settings.printTags); d->showLabels->setChecked(settings.printLabels); d->showRating->setChecked(settings.printRating); d->showProgress->setChecked(settings.showProgressIndicator); + d->captionFont->setFont(settings.captionFont); const int screen = settings.slideScreen; if (screen >= -2 && screen < qApp->desktop()->numScreens()) { d->screenPlacement->setCurrentIndex(screen + 2); } else { d->screenPlacement->setCurrentIndex(0); settings.slideScreen = -2; settings.writeToConfig(); } } } // namespace Digikam diff --git a/core/utilities/slideshow/slideproperties.cpp b/core/utilities/slideshow/slideproperties.cpp index 86aa4157e3..edecc7086e 100644 --- a/core/utilities/slideshow/slideproperties.cpp +++ b/core/utilities/slideshow/slideproperties.cpp @@ -1,364 +1,365 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2014-09-19 * Description : slide properties widget * * Copyright (C) 2014-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "slideproperties.h" // Qt includes #include #include #include #include #include #include #include // KDE includes #include // Local includes #include "digikam_debug.h" #include "dinfointerface.h" #include "itempropertiestab.h" namespace Digikam { class Q_DECL_HIDDEN SlideProperties::Private { public: explicit Private() : maxStringLen(80) { } const int maxStringLen; QUrl url; SlideShowSettings settings; }; SlideProperties::SlideProperties(const SlideShowSettings& settings, QWidget* const parent) : QWidget(parent), d(new Private) { d->settings = settings; setFixedSize(QApplication::desktop()->availableGeometry(parentWidget()).size()/2); setMouseTracking(true); } SlideProperties::~SlideProperties() { delete d; } void SlideProperties::setCurrentUrl(const QUrl& url) { d->url = url; update(); } void SlideProperties::paintEvent(QPaintEvent*) { QPainter p(this); DInfoInterface::DInfoMap info = d->settings.iface->itemInfo(d->url); DItemInfo item(info); QString str; //PhotoInfoContainer photoInfo = d->info.photoInfo; QString comment = item.comment(); QString title = item.title(); QStringList tags = item.keywords(); int offset = 0; // Display tag names. if (d->settings.printTags) { printTags(p, offset, tags); } // Display Titles. if (d->settings.printTitle) { str.clear(); if (!title.isEmpty()) { str += title; printInfoText(p, offset, str); } } // Display Captions if no Titles. if (d->settings.printCapIfNoTitle) { str.clear(); if (title.isEmpty()) { str += comment; printComments(p, offset, str); } } // Display Comments. if (d->settings.printComment) { str = comment; printComments(p, offset, str); } // Display Make and Model. if (d->settings.printMakeModel) { str.clear(); QString make = item.make(); QString model = item.model(); if (!make.isEmpty()) { ItemPropertiesTab::shortenedMakeInfo(make); str = make; } if (!model.isEmpty()) { if (!make.isEmpty()) { str += QLatin1String(" / "); } ItemPropertiesTab::shortenedModelInfo(model); str += model; } printInfoText(p, offset, str); } // Display Exposure and Sensitivity. if (d->settings.printExpoSensitivity) { str.clear(); QString exposureTime = item.exposureTime(); QString sensitivity = item.sensitivity(); if (!exposureTime.isEmpty()) { str = exposureTime; } if (!sensitivity.isEmpty()) { if (!exposureTime.isEmpty()) { str += QLatin1String(" / "); } str += i18n("%1 ISO", sensitivity); } printInfoText(p, offset, str); } // Display Aperture and Focal. if (d->settings.printApertureFocal) { str.clear(); QString aperture = item.aperture(); QString focalLength = item.focalLength(); QString focalLength35mm = item.focalLength35mm(); if (!aperture.isEmpty()) { str = aperture; } if (focalLength35mm.isEmpty()) { if (!focalLength.isEmpty()) { if (!aperture.isEmpty()) { str += QLatin1String(" / "); } str += focalLength; } } else { if (!aperture.isEmpty()) { str += QLatin1String(" / "); } if (!focalLength.isEmpty()) { str += QString::fromUtf8("%1 (%2)").arg(focalLength).arg(focalLength35mm); } else { str += QString::fromUtf8("%1").arg(focalLength35mm); } } printInfoText(p, offset, str); } // Display Creation Date. if (d->settings.printDate) { QDateTime dateTime = item.dateTime(); if (dateTime.isValid()) { str = QLocale().toString(dateTime, QLocale::ShortFormat); printInfoText(p, offset, str); } } // Display image File Name. if (d->settings.printName) { printInfoText(p, offset, d->url.fileName()); } } void SlideProperties::printInfoText(QPainter& p, int& offset, const QString& str, const QColor& pcol) { if (!str.isEmpty()) { + p.setFont(d->settings.captionFont); offset += QFontMetrics(p.font()).lineSpacing(); p.setPen(Qt::black); for (int x = -1; x <= 1; ++x) { for (int y = offset + 1; y >= offset - 1; --y) { p.drawText(x, p.window().height() - y, str); } } p.setPen(pcol); p.drawText(0, p.window().height() - offset, str); } } void SlideProperties::printComments(QPainter& p, int& offset, const QString& comments) { QStringList commentsByLines; uint commentsIndex = 0; // Comments QString index while (commentsIndex < (uint)comments.length()) { QString newLine; bool breakLine = false; // End Of Line found uint currIndex; // Comments QString current index // Check minimal lines dimension uint commentsLinesLengthLocal = d->maxStringLen; for (currIndex = commentsIndex ; currIndex < (uint)comments.length() && !breakLine ; ++currIndex) { if (comments.at(currIndex) == QLatin1Char('\n') || comments.at(currIndex).isSpace()) { breakLine = true; } } if (commentsLinesLengthLocal <= (currIndex - commentsIndex)) { commentsLinesLengthLocal = (currIndex - commentsIndex); } breakLine = false; for (currIndex = commentsIndex ; currIndex <= commentsIndex + commentsLinesLengthLocal && currIndex < (uint)comments.length() && !breakLine ; ++currIndex) { breakLine = (comments.at(currIndex) == QLatin1Char('\n')) ? true : false; if (breakLine) { newLine.append(QLatin1Char(' ')); } else { newLine.append(comments.at(currIndex)); } } commentsIndex = currIndex; // The line is ended if (commentsIndex != (uint)comments.length()) { while (!newLine.endsWith(QLatin1Char(' '))) { newLine.truncate(newLine.length() - 1); --commentsIndex; } } commentsByLines.prepend(newLine.trimmed()); } for (int i = 0 ; i < (int)commentsByLines.count() ; ++i) { printInfoText(p, offset, commentsByLines.at(i)); } } void SlideProperties::printTags(QPainter& p, int& offset, QStringList& tags) { tags.sort(); QString str = tags.join(QLatin1String(", ")); if (!str.isEmpty()) { printInfoText(p, offset, str, qApp->palette().color(QPalette::Link).name()); } } } // namespace Digikam diff --git a/core/utilities/slideshow/slideshowsettings.cpp b/core/utilities/slideshow/slideshowsettings.cpp index 485eddb79e..e3604d9cc2 100644 --- a/core/utilities/slideshow/slideshowsettings.cpp +++ b/core/utilities/slideshow/slideshowsettings.cpp @@ -1,141 +1,150 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2007-02-13 * Description : slide show settings container. * * Copyright (C) 2007-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "slideshowsettings.h" +// Qt includes + +#include + // KDE includes #include #include // Local includes #include "metaenginesettings.h" namespace Digikam { const QString SlideShowSettings::configGroupName(QLatin1String("ImageViewer Settings")); const QString SlideShowSettings::configSlideShowStartCurrentEntry(QLatin1String("SlideShowStartCurrent")); const QString SlideShowSettings::configSlideShowDelayEntry(QLatin1String("SlideShowDelay")); const QString SlideShowSettings::configSlideShowLoopEntry(QLatin1String("SlideShowLoop")); const QString SlideShowSettings::configSlideShowPrintApertureFocalEntry(QLatin1String("SlideShowPrintApertureFocal")); const QString SlideShowSettings::configSlideShowPrintCommentEntry(QLatin1String("SlideShowPrintComment")); const QString SlideShowSettings::configSlideShowPrintTitleEntry(QLatin1String("SlideShowPrintTitle")); const QString SlideShowSettings::configSlideShowPrintCapIfNoTitleEntry(QLatin1String("SlideShowPrintCapIfNoTitle")); const QString SlideShowSettings::configSlideShowPrintDateEntry(QLatin1String("SlideShowPrintDate")); const QString SlideShowSettings::configSlideShowPrintExpoSensitivityEntry(QLatin1String("SlideShowPrintExpoSensitivity")); const QString SlideShowSettings::configSlideShowPrintMakeModelEntry(QLatin1String("SlideShowPrintMakeModel")); const QString SlideShowSettings::configSlideShowPrintNameEntry(QLatin1String("SlideShowPrintName")); const QString SlideShowSettings::configSlideShowPrintTagsEntry(QLatin1String("SlideShowPrintTags")); const QString SlideShowSettings::configSlideShowPrintLabelsEntry(QLatin1String("SlideShowPrintLabels")); const QString SlideShowSettings::configSlideShowPrintRatingEntry(QLatin1String("SlideShowPrintRating")); const QString SlideShowSettings::configSlideShowProgressIndicatorEntry(QLatin1String("SlideShowProgressIndicator")); +const QString SlideShowSettings::configSlideShowCaptionFontEntry(QLatin1String("SlideShowCaptionFont")); const QString SlideShowSettings::configSlideScreenEntry(QLatin1String("SlideScreen")); SlideShowSettings::SlideShowSettings() { startWithCurrent = false; exifRotate = true; loop = false; delay = 5; printName = true; printDate = false; printComment = false; printTitle = false; printCapIfNoTitle = false; printLabels = false; printRating = false; printApertureFocal = false; printMakeModel = false; printExpoSensitivity = false; printTags = false; showProgressIndicator = true; slideScreen = -2; autoPlayEnabled = true; + captionFont = QFontDatabase::systemFont(QFontDatabase::GeneralFont); iface = 0; } SlideShowSettings::~SlideShowSettings() { } void SlideShowSettings::readFromConfig() { KSharedConfig::Ptr config = KSharedConfig::openConfig(); KConfigGroup group = config->group(configGroupName); startWithCurrent = group.readEntry(configSlideShowStartCurrentEntry, false); delay = group.readEntry(configSlideShowDelayEntry, 5); loop = group.readEntry(configSlideShowLoopEntry, false); printName = group.readEntry(configSlideShowPrintNameEntry, true); printDate = group.readEntry(configSlideShowPrintDateEntry, false); printApertureFocal = group.readEntry(configSlideShowPrintApertureFocalEntry, false); printExpoSensitivity = group.readEntry(configSlideShowPrintExpoSensitivityEntry, false); printMakeModel = group.readEntry(configSlideShowPrintMakeModelEntry, false); printComment = group.readEntry(configSlideShowPrintCommentEntry, false); printTitle = group.readEntry(configSlideShowPrintTitleEntry, false); printCapIfNoTitle = group.readEntry(configSlideShowPrintCapIfNoTitleEntry, false); printTags = group.readEntry(configSlideShowPrintTagsEntry, false); printLabels = group.readEntry(configSlideShowPrintLabelsEntry, false); printRating = group.readEntry(configSlideShowPrintRatingEntry, false); showProgressIndicator = group.readEntry(configSlideShowProgressIndicatorEntry, true); + captionFont = group.readEntry(configSlideShowCaptionFontEntry, + QFontDatabase::systemFont(QFontDatabase::GeneralFont)); slideScreen = group.readEntry(configSlideScreenEntry, -2); exifRotate = MetaEngineSettings::instance()->settings().exifRotate; } void SlideShowSettings::writeToConfig() { KSharedConfig::Ptr config = KSharedConfig::openConfig(); KConfigGroup group = config->group(configGroupName); group.writeEntry(configSlideShowStartCurrentEntry, startWithCurrent); group.writeEntry(configSlideShowDelayEntry, delay); group.writeEntry(configSlideShowLoopEntry, loop); group.writeEntry(configSlideShowPrintNameEntry, printName); group.writeEntry(configSlideShowPrintDateEntry, printDate); group.writeEntry(configSlideShowPrintApertureFocalEntry, printApertureFocal); group.writeEntry(configSlideShowPrintExpoSensitivityEntry, printExpoSensitivity); group.writeEntry(configSlideShowPrintMakeModelEntry, printMakeModel); group.writeEntry(configSlideShowPrintCommentEntry, printComment); group.writeEntry(configSlideShowPrintTitleEntry, printTitle); group.writeEntry(configSlideShowPrintCapIfNoTitleEntry, printCapIfNoTitle); group.writeEntry(configSlideShowPrintTagsEntry, printTags); group.writeEntry(configSlideShowPrintLabelsEntry, printLabels); group.writeEntry(configSlideShowPrintRatingEntry, printRating); group.writeEntry(configSlideShowProgressIndicatorEntry, showProgressIndicator); + group.writeEntry(configSlideShowCaptionFontEntry, captionFont); group.writeEntry(configSlideScreenEntry, slideScreen); group.sync(); } int SlideShowSettings::indexOf(const QUrl& url) const { return fileList.indexOf(url); } int SlideShowSettings::count() const { return fileList.count(); } } // namespace Digikam diff --git a/core/utilities/slideshow/slideshowsettings.h b/core/utilities/slideshow/slideshowsettings.h index bf0b085add..3ff10c1f73 100644 --- a/core/utilities/slideshow/slideshowsettings.h +++ b/core/utilities/slideshow/slideshowsettings.h @@ -1,174 +1,180 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2007-02-13 * Description : slide show settings container. * * Copyright (C) 2007-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_SLIDESHOW_SETTINGS_H #define DIGIKAM_SLIDESHOW_SETTINGS_H // Qt includes #include #include #include +#include #include // Local includes #include "digikam_export.h" #include "previewsettings.h" #include "dinfointerface.h" namespace Digikam { /** This class contain all settings to perform a slide show of a group of pictures */ class DIGIKAM_EXPORT SlideShowSettings { public: explicit SlideShowSettings(); ~SlideShowSettings(); void readFromConfig(); void writeToConfig(); int indexOf(const QUrl&) const; int count() const; public: // Global Slide Show Settings /** Start Slide with current selected item */ bool startWithCurrent; /** Auto-rotate image accordingly with Exif Rotation tag */ bool exifRotate; /** Print picture file name while slide */ bool printName; /** Print picture creation date while slide */ bool printDate; /** Print camera Aperture and Focal while slide */ bool printApertureFocal; /** Print camera Make and Model while slide */ bool printMakeModel; /** Print camera Exposure and Sensitivity while slide */ bool printExpoSensitivity; /** Print picture comment while slide */ bool printComment; /** Print image title while slide */ bool printTitle; /** Print image captions if no title available while slide */ bool printCapIfNoTitle; /** Print tag names while slide */ bool printTags; /** Print color label and pick label while slide */ bool printLabels; /** Print rating while slide */ bool printRating; /** Slide pictures in loop */ bool loop; /** Delay in seconds */ int delay; /** Whether to enable the auto-move feature. */ bool autoPlayEnabled; /** Screen to use in case of multi-monitor computer. */ int slideScreen; /** Show progress indicator */ bool showProgressIndicator; /** Load images (previews) in full size, not reduced version */ PreviewSettings previewSettings; /** List of pictures URL to slide */ QList fileList; /** URL of the first image to show if requested */ QUrl imageUrl; - + + /** Font for the display of caption text + */ + QFont captionFont; + /** Interface to access to host application data */ DInfoInterface* iface; private: static const QString configGroupName; static const QString configSlideShowStartCurrentEntry; static const QString configSlideShowDelayEntry; static const QString configSlideShowLoopEntry; static const QString configSlideShowPrintApertureFocalEntry; static const QString configSlideShowPrintCommentEntry; static const QString configSlideShowPrintTitleEntry; static const QString configSlideShowPrintCapIfNoTitleEntry; static const QString configSlideShowPrintDateEntry; static const QString configSlideShowPrintExpoSensitivityEntry; static const QString configSlideShowPrintMakeModelEntry; static const QString configSlideShowPrintNameEntry; static const QString configSlideShowPrintTagsEntry; static const QString configSlideShowPrintLabelsEntry; static const QString configSlideShowPrintRatingEntry; static const QString configSlideShowProgressIndicatorEntry; + static const QString configSlideShowCaptionFontEntry; static const QString configSlideScreenEntry; }; } // namespace Digikam #endif // DIGIKAM_SLIDESHOW_SETTINGS_H