digiKam
templatelist.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 : template list view.
8  *
9  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * 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_TEMPLATE_LIST_H
25 #define DIGIKAM_TEMPLATE_LIST_H
26 
27 // Qt includes
28 
29 #include <QTreeWidget>
30 
31 // Local includes
32 
33 #include "template.h"
34 
35 namespace Digikam
36 {
37 
38 class TemplateListItem : public QTreeWidgetItem
39 {
40 
41 public:
42 
43  explicit TemplateListItem(QTreeWidget* const parent, const Template& t);
44  ~TemplateListItem() override;
45 
46  void setTemplate(const Template& t);
47  Template getTemplate() const;
48 
49 private:
50 
51  Template m_template;
52 
53 private:
54 
55  Q_DISABLE_COPY(TemplateListItem)
56 };
57 
58 // -------------------------------------------------------------------
59 
60 class TemplateList : public QTreeWidget
61 {
62  Q_OBJECT
63 
64 public:
65 
66  explicit TemplateList(QWidget* const parent = nullptr);
67  ~TemplateList() override;
68 
69  TemplateListItem* find(const QString& title);
70 
71  void readSettings();
72  void applySettings();
73 };
74 
75 } // namespace Digikam
76 
77 #endif // DIGIKAM_TEMPLATE_LIST_H
Definition: templatelist.h:39
TemplateListItem(QTreeWidget *const parent, const Template &t)
Definition: templatelist.cpp:44
Template getTemplate() const
Definition: templatelist.cpp:65
void setTemplate(const Template &t)
Definition: templatelist.cpp:54
~TemplateListItem() override
Definition: templatelist.cpp:50
Definition: templatelist.h:61
void readSettings()
Definition: templatelist.cpp:94
TemplateListItem * find(const QString &title)
Definition: templatelist.cpp:140
TemplateList(QWidget *const parent=nullptr)
Definition: templatelist.cpp:72
void applySettings()
Definition: templatelist.cpp:109
~TemplateList() override
Definition: templatelist.cpp:90
Definition: template.h:46
Definition: datefolderview.cpp:43