digiKam
galleryelementfunctor.h
Go to the documentation of this file.
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 HTML image galleries
8  *
9  * Copyright (C) 2006-2010 by Aurelien Gateau <aurelien dot gateau at free dot fr>
10  * Copyright (C) 2012-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_GALLERY_ELEMENT_FUNCTOR_H
25 #define DIGIKAM_GALLERY_ELEMENT_FUNCTOR_H
26 
27 // Local includes
28 
29 #include "gallerynamehelper.h"
30 
32 {
33 
34 class GalleryInfo;
35 class GalleryGenerator;
36 class GalleryElement;
37 
44 {
45 public:
46 
48 
49 public:
50 
51  explicit GalleryElementFunctor(GalleryGenerator* const generator,
52  GalleryInfo* const info,
53  const QString& destDir);
55 
56  void operator()(GalleryElement& element);
57 
58 private:
59 
60  bool writeDataToFile(const QByteArray& data, const QString& destPath);
61  void emitWarning(const QString& msg);
62 
63 private:
64 
65  // NOTE: Do not use a d private internal container here.
66 
67  GalleryGenerator* m_generator;
68  GalleryInfo* m_info;
69  QString m_destDir;
70  GalleryNameHelper m_uniqueNameHelper;
71 };
72 
73 } // namespace DigikamGenericHtmlGalleryPlugin
74 
75 #endif // DIGIKAM_GALLERY_ELEMENT_FUNCTOR_H
Definition: galleryelementfunctor.h:44
void operator()(GalleryElement &element)
Definition: galleryelementfunctor.cpp:99
GalleryElement result_type
Definition: galleryelementfunctor.h:47
GalleryElementFunctor(GalleryGenerator *const generator, GalleryInfo *const info, const QString &destDir)
Definition: galleryelementfunctor.cpp:86
~GalleryElementFunctor()
Definition: galleryelementfunctor.cpp:95
Definition: gallerygenerator.h:49
Definition: gallerynamehelper.h:38
Definition: galleryconfig.cpp:30