• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevelop/kdevplatform/language/codegen

  • extragear
  • kdevelop
  • kdevelop
  • kdevplatform
  • language
  • codegen
templatesmodel.h
Go to the documentation of this file.
1 /* This file is part of KDevelop
2  Copyright 2007 Alexander Dymo <[email protected]>
3  Copyright 2012 Miha Čančula <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef KDEVPLATFORM_TEMPLATESMODEL_H
22 #define KDEVPLATFORM_TEMPLATESMODEL_H
23 
24 #include <QStandardItemModel>
25 
26 #include <language/languageexport.h>
27 
28 namespace KDevelop {
29 class TemplatesModelPrivate;
30 
47 class KDEVPLATFORMLANGUAGE_EXPORT TemplatesModel
48  : public QStandardItemModel
49 {
50  Q_OBJECT
51 
52 public:
53 
58  enum TemplateRole
59  {
60  DescriptionFileRole = Qt::UserRole + 1,
61  PreviewIconRole = Qt::UserRole + 2,
62  CommentRole = Qt::UserRole + 3,
63  ArchiveFileRole = Qt::UserRole + 4
64  };
65 
72  explicit TemplatesModel(const QString& typePrefix, QObject* parent = nullptr);
73 
78  ~TemplatesModel() override;
79 
83  virtual void refresh();
84 
92  QString loadTemplateFile(const QString& fileName);
93 
103  QModelIndexList templateIndexes(const QString& fileName) const;
104 
108  QString typePrefix() const;
109 
116  void addDataPath(const QString& path);
117 
118 private:
119  const QScopedPointer<class TemplatesModelPrivate> d_ptr;
120  Q_DECLARE_PRIVATE(TemplatesModel)
121 };
122 }
123 
124 #endif // KDEVPLATFORM_TEMPLATESMODEL_H
QStandardItemModel
QObject
QScopedPointer< class TemplatesModelPrivate >
QString
KDevelop::TemplatesModel::TemplateRole
TemplateRole
Extra roles for template-specific properties.
Definition: templatesmodel.h:58
KDevelop::TemplatesModel
A convenience class for loading templates using .kdevtemplate files.
Definition: templatesmodel.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Thu Dec 12 2019 03:33:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevelop/kdevplatform/language/codegen

Skip menu "kdevelop/kdevplatform/language/codegen"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  •   kdevplatform
  •     debugger
  •     documentation
  •     interfaces
  •     language
  •       assistant
  •       backgroundparser
  •       checks
  •       classmodel
  •       codecompletion
  •       codegen
  •       duchain
  •       editor
  •       highlighting
  •       interfaces
  •       util
  •     outputview
  •     project
  •     serialization
  •     shell
  •     sublime
  •     tests
  •     util
  •     vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal