File indexing completed on 2024-05-12 16:01:54

0001 /*
0002    This file is part of the KDE project
0003    SPDX-FileCopyrightText: 2000 Werner Trobin <trobin@kde.org>
0004 
0005    SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef KIS_TEMPLATE_H
0009 #define KIS_TEMPLATE_H
0010 
0011 #include <QString>
0012 #include <QPixmap>
0013 
0014 /** @internal */
0015 class KisTemplate
0016 {
0017 
0018 public:
0019     explicit KisTemplate(const QString &name,
0020                         const QString &description = QString(),
0021                         const QString &file = QString(),
0022                         const QString &picture = QString(),
0023                         const QString &fileName = QString(),
0024                         const QString &_measureSystem = QString(),
0025                         bool hidden = false, bool touched = false);
0026     ~KisTemplate() {}
0027 
0028     QString name() const {
0029         return m_name;
0030     }
0031     QString description() const {
0032         return m_descr;
0033     }
0034     QString file() const {
0035         return m_file;
0036     }
0037     QString picture() const {
0038         return m_picture;
0039     }
0040     QString fileName() const {
0041         return m_fileName;
0042     }
0043     const QPixmap &loadPicture();
0044 
0045     bool isHidden() const {
0046         return m_hidden;
0047     }
0048     void setHidden(bool hidden = true) {
0049         m_hidden = hidden; m_touched = true;
0050     }
0051 
0052     bool touched() const {
0053         return m_touched;
0054     }
0055 
0056     QString measureSystem() const {
0057         return m_measureSystem;
0058     }
0059     void setMeasureSystem(const QString& system) {
0060         m_measureSystem = system;
0061     }
0062 
0063 private:
0064     QString m_name, m_descr, m_file, m_picture, m_fileName;
0065     bool m_hidden;
0066     mutable bool m_touched;
0067     bool m_cached;
0068     QPixmap m_pixmap;
0069     QString m_measureSystem;
0070 };
0071 
0072 
0073 #endif