File indexing completed on 2025-01-05 03:57:18
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2009-06-20 0007 * Description : template list view. 0008 * 0009 * SPDX-FileCopyrightText: 2009-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_TEMPLATE_LIST_H 0016 #define DIGIKAM_TEMPLATE_LIST_H 0017 0018 // Qt includes 0019 0020 #include <QTreeWidget> 0021 0022 // Local includes 0023 0024 #include "template.h" 0025 0026 namespace Digikam 0027 { 0028 0029 class TemplateListItem : public QTreeWidgetItem 0030 { 0031 0032 public: 0033 0034 explicit TemplateListItem(QTreeWidget* const parent, const Template& t); 0035 ~TemplateListItem() override; 0036 0037 void setTemplate(const Template& t); 0038 Template getTemplate() const; 0039 0040 private: 0041 0042 Template m_template; 0043 0044 private: 0045 0046 Q_DISABLE_COPY(TemplateListItem) 0047 }; 0048 0049 // ------------------------------------------------------------------- 0050 0051 class TemplateList : public QTreeWidget 0052 { 0053 Q_OBJECT 0054 0055 public: 0056 0057 explicit TemplateList(QWidget* const parent = nullptr); 0058 ~TemplateList() override; 0059 0060 TemplateListItem* find(const QString& title); 0061 0062 void readSettings(); 0063 void applySettings(); 0064 }; 0065 0066 } // namespace Digikam 0067 0068 #endif // DIGIKAM_TEMPLATE_LIST_H