| 1 |
/* ============================================================ |
| 2 |
* |
| 3 |
* This file is a part of digiKam project |
| 4 |
* https://www.digikam.org |
| 5 |
* |
| 6 |
* Date : 2006-04-04 |
| 7 |
* Description : a tool to generate jAlbum image galleries |
| 8 |
* |
| 9 |
* SPDX-FileCopyrightText: 2013-2019 by Andrew Goodbody <ajg zero two at elfringham dot co dot uk> |
| 10 |
* |
| 11 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 12 |
* |
| 13 |
* ============================================================ */ |
| 14 |
|
| 15 |
#pragma once |
| 16 |
|
| 17 |
// Qt includes |
| 18 |
|
| 19 |
#include <QObject> |
| 20 |
|
| 21 |
// Local includes |
| 22 |
|
| 23 |
#include "dprogresswdg.h" |
| 24 |
#include "dhistoryview.h" |
| 25 |
|
| 26 |
using namespace Digikam; |
| 27 |
|
| 28 |
namespace DigikamGenericJAlbumPlugin |
| 29 |
{ |
| 30 |
|
| 31 |
class JAlbumSettings; |
| 32 |
class JAlbumElementFunctor; |
| 33 |
|
| 34 |
/** |
| 35 |
* This class is responsible for generating the HTML and scaling the images |
| 36 |
* according to the settings specified by the user. |
| 37 |
*/ |
| 38 |
class JAlbumGenerator : public QObject |
| 39 |
{ |
| 40 |
Q_OBJECT |
| 41 |
|
| 42 |
public: |
| 43 |
|
| 44 |
explicit JAlbumGenerator(JAlbumSettings* const); |
| 45 |
~JAlbumGenerator() override; |
| 46 |
|
| 47 |
void setProgressWidgets(DHistoryView* const, DProgressWdg* const); |
| 48 |
|
| 49 |
bool run(); |
| 50 |
bool warnings() const; |
| 51 |
|
| 52 |
/** |
| 53 |
* Produce a web-friendly file name |
| 54 |
*/ |
| 55 |
static QString webifyFileName(const QString&); |
| 56 |
|
| 57 |
Q_SIGNALS: |
| 58 |
|
| 59 |
/** |
| 60 |
* This signal is emitted from JAlbumElementFunctor. It uses a |
| 61 |
* QueuedConnection to switch between the JAlbumElementFunctor thread and |
| 62 |
* the gui thread. |
| 63 |
*/ |
| 64 |
void logWarningRequested(const QString&); |
| 65 |
|
| 66 |
private Q_SLOTS: |
| 67 |
|
| 68 |
void logWarning(const QString&); |
| 69 |
void slotCancel(); |
| 70 |
|
| 71 |
private: |
| 72 |
|
| 73 |
/// @note disabled |
| 74 |
explicit JAlbumGenerator(QObject*) = delete; |
| 75 |
|
| 76 |
private: |
| 77 |
|
| 78 |
class Private; |
| 79 |
Private* const d = nullptr; |
| 80 |
|
| 81 |
friend class Private; |
| 82 |
friend class JAlbumElementFunctor; |
| 83 |
}; |
| 84 |
|
| 85 |
} // namespace DigikamGenericJAlbumPlugin |