2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-16 12:10:22 +02:00
|
|
|
#include "qmakeprojectmanager_global.h"
|
2017-02-09 13:56:22 +01:00
|
|
|
#include "qmakeparsernodes.h"
|
2011-01-21 15:37:05 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <projectexplorer/projectnodes.h>
|
|
|
|
|
|
2013-03-28 09:01:07 +01:00
|
|
|
namespace Utils { class FileName; }
|
2017-02-02 11:06:50 +01:00
|
|
|
namespace ProjectExplorer { class RunConfiguration; }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-16 11:02:37 +02:00
|
|
|
namespace QmakeProjectManager {
|
2013-10-29 14:22:31 +01:00
|
|
|
class QmakeProFileNode;
|
|
|
|
|
class QmakeProject;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-29 17:37:39 +01:00
|
|
|
// Implements ProjectNode for qmake .pri files
|
2013-10-29 15:58:10 +01:00
|
|
|
class QMAKEPROJECTMANAGER_EXPORT QmakePriFileNode : public ProjectExplorer::ProjectNode
|
2009-03-19 16:33:44 +01:00
|
|
|
{
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmakeProFileNode,
|
|
|
|
|
const Utils::FileName &filePath);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *priFile() const;
|
2010-03-10 16:55:37 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
// ProjectNode interface
|
|
|
|
|
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool showInSimpleTree() const override { return false; }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool canAddSubProject(const QString &proFilePath) const override;
|
2010-08-26 18:33:16 +02:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool addSubProjects(const QStringList &proFilePaths) override;
|
|
|
|
|
bool removeSubProjects(const QStringList &proFilePaths) override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2017-02-10 16:02:40 +01:00
|
|
|
bool addFiles(const QStringList &filePaths, QStringList *notAdded = nullptr) override;
|
|
|
|
|
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = nullptr) override;
|
2015-10-29 16:59:27 +01:00
|
|
|
bool deleteFiles(const QStringList &filePaths) override;
|
|
|
|
|
bool canRenameFile(const QString &filePath, const QString &newFilePath) override;
|
|
|
|
|
bool renameFile(const QString &filePath, const QString &newFilePath) override;
|
|
|
|
|
AddNewInformation addNewInformation(const QStringList &files, Node *context) const override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool deploysFolder(const QString &folder) const override;
|
|
|
|
|
QList<ProjectExplorer::RunConfiguration *> runConfigurations() const override;
|
2010-08-24 17:17:11 +02:00
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakeProFileNode *proFileNode() const;
|
2015-09-14 15:33:50 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
protected:
|
2017-03-15 15:02:08 +01:00
|
|
|
QmakeProject *m_project = nullptr;
|
2008-12-05 14:29:18 +01:00
|
|
|
|
2015-01-09 15:50:06 +01:00
|
|
|
private:
|
2017-03-15 15:02:08 +01:00
|
|
|
QmakeProFileNode *m_qmakeProFileNode = nullptr;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2013-10-29 17:37:39 +01:00
|
|
|
// Implements ProjectNode for qmake .pro files
|
2013-10-29 15:58:10 +01:00
|
|
|
class QMAKEPROJECTMANAGER_EXPORT QmakeProFileNode : public QmakePriFileNode
|
2009-03-19 16:33:44 +01:00
|
|
|
{
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
2015-02-02 00:37:38 +02:00
|
|
|
QmakeProFileNode(QmakeProject *project, const Utils::FileName &filePath);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakeProFile *proFile() const;
|
2010-03-10 16:55:37 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool showInSimpleTree() const override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
AddNewInformation addNewInformation(const QStringList &files, Node *context) const override;
|
2014-02-18 16:31:36 +01:00
|
|
|
|
2017-02-09 13:56:22 +01:00
|
|
|
QmakeProjectManager::ProjectType projectType() const;
|
2017-02-24 18:01:54 +01:00
|
|
|
QString buildDir() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2017-02-09 14:42:04 +01:00
|
|
|
QStringList variableValue(const Variable var) const;
|
|
|
|
|
QString singleVariableValue(const Variable var) const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-02-18 16:01:58 +01:00
|
|
|
QmakeProFileNode *findProFileFor(const Utils::FileName &string) const;
|
2010-10-27 16:27:22 +02:00
|
|
|
|
2017-02-09 13:56:22 +01:00
|
|
|
bool showInSimpleTree(ProjectType projectType) const;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2013-10-16 11:02:37 +02:00
|
|
|
} // namespace QmakeProjectManager
|