File indexing completed on 2024-05-12 04:39:40

0001 /*
0002     SPDX-FileCopyrightText: 2010 Andreas Pakulat <apaku@gmx.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-or-later
0005 */
0006 
0007 #ifndef KDEVELOP_PROJECTMANAGERS_CUSTOM_BUILDSYSTEM_INCLUDESWIDGET_H
0008 #define KDEVELOP_PROJECTMANAGERS_CUSTOM_BUILDSYSTEM_INCLUDESWIDGET_H
0009 
0010 #include <QWidget>
0011 
0012 namespace Ui
0013 {
0014 class IncludesWidget;
0015 }
0016 
0017 namespace KDevelop
0018 {
0019     class IProject;
0020 }
0021 class QUrl;
0022 class ProjectPathsModel;
0023 class IncludesModel;
0024 
0025 class IncludesWidget : public QWidget
0026 {
0027 Q_OBJECT
0028 public:
0029     explicit IncludesWidget( QWidget* parent = nullptr );
0030     void setProject(KDevelop::IProject* w_project);
0031     void setIncludes( const QStringList& );
0032     void clear();
0033 Q_SIGNALS:
0034     void includesChanged( const QStringList& );
0035 private Q_SLOTS:
0036     // Handling of include-path url-requester, add and remove buttons
0037     void includePathSelected( const QModelIndex& selected );
0038     void includePathEdited();
0039     void includePathUrlSelected(const QUrl&);
0040     void addIncludePath();
0041     // Handles action and also Del-key in list
0042     void deleteIncludePath();
0043     void checkIfIncludePathExist();
0044 
0045     // Forward includes model changes
0046     void includesChanged();
0047 private:
0048     Ui::IncludesWidget* ui;
0049     IncludesModel* includesModel;
0050     QString makeIncludeDirAbsolute( const QUrl &url ) const;
0051     // Enables/Disables widgets based on UI state/selection
0052     void updateEnablements();
0053     void updatePathsModel( const QVariant& newData, int role );
0054 };
0055 
0056 #endif