2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-02-18 11:48:13 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-02-18 11:48:13 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-02-18 11:48:13 +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.
|
2011-02-18 11:48:13 +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.
|
2011-02-18 11:48:13 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-02-18 11:48:13 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-01-19 09:33:06 +01:00
|
|
|
|
2018-01-29 13:38:41 +01:00
|
|
|
#include <utils/environment.h>
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QObject>
|
2012-08-31 16:01:19 +02:00
|
|
|
#include <QSet>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QStringList>
|
2010-01-19 09:33:06 +01:00
|
|
|
|
|
|
|
|
namespace QmlProjectManager {
|
|
|
|
|
|
|
|
|
|
class QmlProjectContentItem : public QObject {
|
|
|
|
|
// base class for all elements that should be direct children of Project element
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
QmlProjectContentItem(QObject *parent = 0) : QObject(parent) {}
|
|
|
|
|
};
|
|
|
|
|
|
2011-07-13 18:02:35 +02:00
|
|
|
class QmlProjectItem : public QObject
|
|
|
|
|
{
|
2010-01-19 09:33:06 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2017-02-28 17:15:19 +01:00
|
|
|
QString sourceDirectory() const { return m_sourceDirectory; }
|
2010-01-19 09:33:06 +01:00
|
|
|
void setSourceDirectory(const QString &directoryPath);
|
2017-11-28 15:57:15 +01:00
|
|
|
QString targetDirectory() const { return m_targetDirectory; }
|
|
|
|
|
void setTargetDirectory(const QString &directoryPath);
|
2010-01-19 09:33:06 +01:00
|
|
|
|
2018-02-22 10:42:13 +01:00
|
|
|
QStringList importPaths() const { return m_importPaths; }
|
2010-03-19 15:06:54 +01:00
|
|
|
void setImportPaths(const QStringList &paths);
|
2010-02-03 08:59:38 +01:00
|
|
|
|
2010-01-28 17:12:07 +01:00
|
|
|
QStringList files() const;
|
2010-02-17 11:20:35 +01:00
|
|
|
bool matchesFile(const QString &filePath) const;
|
2010-01-19 09:33:06 +01:00
|
|
|
|
2017-02-28 17:15:19 +01:00
|
|
|
QString mainFile() const { return m_mainFile; }
|
|
|
|
|
void setMainFile(const QString &mainFilePath) { m_mainFile = mainFilePath; }
|
2010-12-03 17:04:29 +01:00
|
|
|
|
2017-02-28 17:15:19 +01:00
|
|
|
void appendContent(QmlProjectContentItem *item) { m_content.append(item); }
|
2010-12-03 17:04:29 +01:00
|
|
|
|
2018-01-29 13:38:41 +01:00
|
|
|
QList<Utils::EnvironmentItem> environment() const;
|
|
|
|
|
void addToEnviroment(const QString &key, const QString &value);
|
|
|
|
|
|
2010-01-19 09:33:06 +01:00
|
|
|
signals:
|
2010-05-18 13:40:35 +02:00
|
|
|
void qmlFilesChanged(const QSet<QString> &, const QSet<QString> &);
|
2010-01-19 09:33:06 +01:00
|
|
|
|
|
|
|
|
protected:
|
2017-02-28 17:15:19 +01:00
|
|
|
QString m_sourceDirectory;
|
2017-11-28 15:57:15 +01:00
|
|
|
QString m_targetDirectory;
|
2017-02-28 17:15:19 +01:00
|
|
|
QStringList m_importPaths;
|
|
|
|
|
QString m_mainFile;
|
2018-01-29 13:38:41 +01:00
|
|
|
QList<Utils::EnvironmentItem> m_environment;
|
2017-02-28 17:15:19 +01:00
|
|
|
QList<QmlProjectContentItem *> m_content; // content property
|
2010-01-19 09:33:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace QmlProjectManager
|