Warning, file /office/calligra/libs/main/KoTemplateGroup.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 This file is part of the KDE project 0003 Copyright (C) 2000 Werner Trobin <trobin@kde.org> 0004 0005 This library is free software; you can redistribute it and/or 0006 modify it under the terms of the GNU Library General Public 0007 License as published by the Free Software Foundation; either 0008 version 2 of the License, or (at your option) any later version. 0009 0010 This library is distributed in the hope that it will be useful, 0011 but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0013 Library General Public License for more details. 0014 0015 You should have received a copy of the GNU Library General Public License 0016 along with this library; see the file COPYING.LIB. If not, write to 0017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0018 * Boston, MA 02110-1301, USA. 0019 */ 0020 0021 #ifndef koTemplateGroup_h 0022 #define koTemplateGroup_h 0023 0024 #include <QList> 0025 #include <QStringList> 0026 #include "komain_export.h" 0027 0028 class KoTemplate; 0029 0030 class KOMAIN_EXPORT KoTemplateGroup 0031 { 0032 0033 public: 0034 explicit KoTemplateGroup(const QString &name, 0035 const QString &dir = QString(), 0036 int _sortingWeight = 0, 0037 bool touched = false); 0038 ~KoTemplateGroup(); 0039 0040 QString name() const { 0041 return m_name; 0042 } 0043 QStringList dirs() const { 0044 return m_dirs; 0045 } 0046 void addDir(const QString &dir) { 0047 m_dirs.append(dir); m_touched = true; 0048 } 0049 int sortingWeight() const { 0050 return m_sortingWeight; 0051 } 0052 void setSortingWeight(int weight) { 0053 m_sortingWeight = weight; 0054 } 0055 /// If all children are hidden, we are hidden too 0056 bool isHidden() const; 0057 /// if we should hide, we hide all the children 0058 void setHidden(bool hidden = true) const; 0059 0060 QList<KoTemplate*> templates() const { return m_templates; } 0061 0062 bool add(KoTemplate *t, bool force = false, bool touch = true); 0063 KoTemplate *find(const QString &name) const; 0064 0065 bool touched() const { 0066 return m_touched; 0067 } 0068 0069 private: 0070 QString m_name; 0071 QStringList m_dirs; 0072 QList<KoTemplate*> m_templates; 0073 mutable bool m_touched; 0074 int m_sortingWeight; 0075 }; 0076 0077 #endif