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

kdevplatform/project

  • sources
  • kfour-appscomplete
  • kdevelop
  • kdevplatform
  • project
projectbuildsetmodel.h
Go to the documentation of this file.
1 /***************************************************************************
2  * This file is part of KDevelop *
3  * Copyright 2007 Andreas Pakulat <[email protected]> *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU Library General Public License as *
7  * published by the Free Software Foundation; either version 2 of the *
8  * License, or (at your option) any later version. *
9  * *
10  * This program 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 *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU Library General Public *
16  * License along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef KDEVPLATFORM_PROJECTBUILDSETMODEL_H
22 #define KDEVPLATFORM_PROJECTBUILDSETMODEL_H
23 
24 #include "projectexport.h"
25 
26 #include <QAbstractTableModel>
27 #include <QStringList>
28 
29 namespace KDevelop
30 {
31 class ProjectBaseItem;
32 class ICore;
33 class IProject;
34 class ISession;
35 class ProjectBuildSetModelPrivate;
36 
37 class KDEVPLATFORMPROJECT_EXPORT BuildItem
38 {
39 public:
40  BuildItem();
41  explicit BuildItem( const QStringList& itemPath );
42  BuildItem( const BuildItem& rhs );
43  explicit BuildItem( KDevelop::ProjectBaseItem* );
44  ~BuildItem() = default;
45 
46  void initializeFromItem( KDevelop::ProjectBaseItem* item );
47  KDevelop::ProjectBaseItem* findItem() const;
48  BuildItem& operator=( const BuildItem& );
49  QString itemName() const;
50  QStringList itemPath() const { return m_itemPath; }
51  QString itemProject() const;
52 private:
53  QStringList m_itemPath;
54 };
55 
56 bool operator==( const BuildItem& rhs, const BuildItem& lhs );
57 
58 class KDEVPLATFORMPROJECT_EXPORT ProjectBuildSetModel : public QAbstractTableModel
59 {
60  Q_OBJECT
61 public:
62  explicit ProjectBuildSetModel( QObject* parent );
63  ~ProjectBuildSetModel() override;
64  QVariant data( const QModelIndex&, int role = Qt::DisplayRole ) const override;
65  QVariant headerData( int, Qt::Orientation, int role = Qt::DisplayRole ) const override;
66  int rowCount( const QModelIndex& = QModelIndex() ) const override;
67  int columnCount( const QModelIndex& = QModelIndex() ) const override;
68 
69  void loadFromSession( ISession* session );
70  void storeToSession( ISession* session );
71 
72  void addProjectItem( KDevelop::ProjectBaseItem* );
73  bool removeRows( int row, int count, const QModelIndex& parent = QModelIndex() ) override;
74  void moveRowsUp( int row, int count );
75  void moveRowsDown( int row, int count );
76  void moveRowsToTop( int row, int count );
77  void moveRowsToBottom( int row, int count );
78  QList<BuildItem> items() const;
79 public Q_SLOTS:
80  void saveToProject( KDevelop::IProject* ) const;
81  void loadFromProject( KDevelop::IProject* );
82  void projectClosed( KDevelop::IProject* );
83 private:
84  int findInsertionPlace( const QStringList& itemPath );
85  void removeItemsWithCache( const QList<int>& itemIndices );
86  void insertItemWithCache( const KDevelop::BuildItem& item );
87  void insertItemsOverrideCache( int index, const QList<KDevelop::BuildItem>& items );
88 
89 private:
90  const QScopedPointer<class ProjectBuildSetModelPrivate> d_ptr;
91  Q_DECLARE_PRIVATE(ProjectBuildSetModel)
92 };
93 
94 }
95 
96 Q_DECLARE_TYPEINFO(KDevelop::BuildItem, Q_MOVABLE_TYPE);
97 
98 #endif
KDevelop::ProjectBuildSetModel
Definition: projectbuildsetmodel.h:74
KDevelop::ProjectBaseItem
Interface that allows a developer to implement the three basic types of items you would see in a mult...
Definition: projectmodel.h:101
QList
Definition: projectmodel.h:31
KDevelop::BuildItem
Definition: projectbuildsetmodel.h:53
QObject
KDevelop::operator==
bool operator==(const BuildItem &rhs, const BuildItem &lhs)
Definition: projectbuildsetmodel.cpp:103
QString
QAbstractTableModel
QScopedPointer< class ProjectBuildSetModelPrivate >
KDevelop
Definition: abstractfilemanagerplugin.h:33
Q_DECLARE_TYPEINFO
Q_DECLARE_TYPEINFO(KDevelop::BuildItem, Q_MOVABLE_TYPE)
QModelIndex
QVariant
QStringList
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Mar 3 2021 00:37:59 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdevplatform/project

Skip menu "kdevplatform/project"
  • 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