digiKam
templatemanager.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 : 2009-06-20
7  * Description : metadata template manager.
8  *
9  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2009-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
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)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_TEMPLATE_MANAGER_H
26 #define DIGIKAM_TEMPLATE_MANAGER_H
27 
28 // Qt includes
29 
30 #include <QList>
31 #include <QObject>
32 #include <QString>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 
38 namespace Digikam
39 {
40 
41 class Template;
42 
43 class DIGIKAM_GUI_EXPORT TemplateManager : public QObject
44 {
45  Q_OBJECT
46 
47 public:
48 
49  bool load();
50  bool save();
51  void clear();
52 
53  void insert(const Template& t);
54  void remove(const Template& t);
55 
56  Template fromIndex(int index) const;
57  Template findByTitle(const QString& title) const;
58  Template findByContents(const Template& tref) const;
59  QList<Template> templateList() const;
60 
61  static TemplateManager* defaultManager();
62 
63 Q_SIGNALS:
64 
67 
68 private:
69 
70  void insertPrivate(const Template& t);
71  void removePrivate(const Template& t);
72 
73 private:
74 
75  // Disable
77  explicit TemplateManager(QObject*);
78  ~TemplateManager() override;
79 
80 private:
81 
82  friend class TemplateManagerCreator;
83 
84  class Private;
85  Private* const d;
86 };
87 
88 } // namespace Digikam
89 
90 #endif // DIGIKAM_TEMPLATE_MANAGER_H
Definition: templatemanager.h:44
void signalTemplateRemoved(const Template &)
void signalTemplateAdded(const Template &)
Definition: template.h:46
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43