2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
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
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 14:09:21 +01:00
|
|
|
|
2014-05-02 17:38:42 +02:00
|
|
|
#ifndef IWIZARDFACTORY_H
|
|
|
|
|
#define IWIZARDFACTORY_H
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
#include <coreplugin/core_global.h>
|
2013-09-20 15:12:44 +02:00
|
|
|
#include <coreplugin/id.h>
|
|
|
|
|
#include <coreplugin/featureprovider.h>
|
2012-01-18 13:50:14 +01:00
|
|
|
|
2013-09-20 15:12:44 +02:00
|
|
|
#include <QIcon>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QObject>
|
2012-04-02 14:55:56 +02:00
|
|
|
#include <QVariantMap>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
|
2014-05-02 17:38:42 +02:00
|
|
|
class CORE_EXPORT IWizardFactory
|
2008-12-02 12:01:29 +01:00
|
|
|
: public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2010-01-14 14:14:39 +01:00
|
|
|
enum WizardKind {
|
|
|
|
|
FileWizard = 0x01,
|
|
|
|
|
ClassWizard = 0x02,
|
|
|
|
|
ProjectWizard = 0x04
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
2010-01-14 14:14:39 +01:00
|
|
|
Q_DECLARE_FLAGS(WizardKinds, WizardKind)
|
2012-02-08 17:25:35 +01:00
|
|
|
enum WizardFlag {
|
2012-03-19 16:12:51 +01:00
|
|
|
PlatformIndependent = 0x01,
|
|
|
|
|
ForceCapitalLetterForFileName = 0x02
|
2012-02-08 17:25:35 +01:00
|
|
|
};
|
|
|
|
|
Q_DECLARE_FLAGS(WizardFlags, WizardFlag)
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-07-02 17:02:28 +02:00
|
|
|
IWizardFactory() : m_kind(FileWizard) { }
|
2013-09-20 15:12:44 +02:00
|
|
|
|
2014-05-30 13:21:48 +02:00
|
|
|
QString id() const { return m_id; }
|
|
|
|
|
WizardKind kind() const { return m_kind; }
|
|
|
|
|
QIcon icon() const { return m_icon; }
|
|
|
|
|
QString description() const { return m_description; }
|
|
|
|
|
QString displayName() const { return m_displayName; }
|
|
|
|
|
QString category() const { return m_category; }
|
|
|
|
|
QString displayCategory() const { return m_displayCategory; }
|
|
|
|
|
QString descriptionImage() const { return m_descriptionImage; }
|
|
|
|
|
FeatureSet requiredFeatures() const { return m_requiredFeatures; }
|
|
|
|
|
WizardFlags flags() const { return m_flags; }
|
|
|
|
|
|
|
|
|
|
void setId(const QString &id) { m_id = id; }
|
|
|
|
|
void setWizardKind(WizardKind kind) { m_kind = kind; }
|
|
|
|
|
void setIcon(const QIcon &icon) { m_icon = icon; }
|
|
|
|
|
void setDescription(const QString &description) { m_description = description; }
|
|
|
|
|
void setDisplayName(const QString &displayName) { m_displayName = displayName; }
|
|
|
|
|
void setCategory(const QString &category) { m_category = category; }
|
|
|
|
|
void setDisplayCategory(const QString &displayCategory) { m_displayCategory = displayCategory; }
|
|
|
|
|
void setDescriptionImage(const QString &descriptionImage) { m_descriptionImage = descriptionImage; }
|
|
|
|
|
void setRequiredFeatures(const FeatureSet &featureSet) { m_requiredFeatures = featureSet; }
|
|
|
|
|
void addRequiredFeature(const Feature &feature) { m_requiredFeatures |= feature; }
|
|
|
|
|
void setFlags(WizardFlags flags) { m_flags = flags; }
|
2012-01-18 13:50:14 +01:00
|
|
|
|
2012-04-02 14:55:56 +02:00
|
|
|
virtual void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &variables) = 0;
|
2009-05-11 13:34:58 +02:00
|
|
|
|
2012-02-08 17:25:35 +01:00
|
|
|
bool isAvailable(const QString &platformName) const;
|
|
|
|
|
QStringList supportedPlatforms() const;
|
2012-01-18 13:50:14 +01:00
|
|
|
|
2009-05-11 13:34:58 +02:00
|
|
|
// Utility to find all registered wizards
|
2014-05-02 17:38:42 +02:00
|
|
|
static QList<IWizardFactory*> allWizardFactories();
|
2009-05-11 13:34:58 +02:00
|
|
|
// Utility to find all registered wizards of a certain kind
|
2014-05-02 17:38:42 +02:00
|
|
|
static QList<IWizardFactory*> wizardFactoriesOfKind(WizardKind kind);
|
2012-02-08 17:25:35 +01:00
|
|
|
static QStringList allAvailablePlatforms();
|
|
|
|
|
static QString displayNameForPlatform(const QString &string);
|
2013-09-20 15:12:44 +02:00
|
|
|
|
|
|
|
|
private:
|
2014-05-30 13:21:48 +02:00
|
|
|
IWizardFactory::WizardKind m_kind;
|
|
|
|
|
QIcon m_icon;
|
|
|
|
|
QString m_description;
|
|
|
|
|
QString m_displayName;
|
|
|
|
|
QString m_id;
|
|
|
|
|
QString m_category;
|
|
|
|
|
QString m_displayCategory;
|
|
|
|
|
FeatureSet m_requiredFeatures;
|
|
|
|
|
WizardFlags m_flags;
|
|
|
|
|
QString m_descriptionImage;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
2008-12-02 14:09:21 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
} // namespace Core
|
|
|
|
|
|
2014-05-02 17:38:42 +02:00
|
|
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Core::IWizardFactory::WizardKinds)
|
|
|
|
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Core::IWizardFactory::WizardFlags)
|
2010-01-14 14:14:39 +01:00
|
|
|
|
2014-05-02 17:38:42 +02:00
|
|
|
#endif // IWIZARDFACTORY_H
|