kit.h 3.04 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
Tobias Hunger's avatar
Tobias Hunger committed
2
**
hjk's avatar
hjk committed
3 4
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
Tobias Hunger's avatar
Tobias Hunger committed
5
**
hjk's avatar
hjk committed
6
** This file is part of Qt Creator.
Tobias Hunger's avatar
Tobias Hunger committed
7
**
hjk's avatar
hjk committed
8 9 10 11 12 13 14
** 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.
Tobias Hunger's avatar
Tobias Hunger committed
15 16
**
** GNU Lesser General Public License Usage
hjk's avatar
hjk committed
17 18 19 20 21 22
** 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.
Tobias Hunger's avatar
Tobias Hunger committed
23
**
hjk's avatar
hjk committed
24 25
** In addition, as a special exception, Digia gives you certain additional
** rights.  These rights are described in the Digia Qt LGPL Exception
Tobias Hunger's avatar
Tobias Hunger committed
26 27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
hjk's avatar
hjk committed
28
****************************************************************************/
Tobias Hunger's avatar
Tobias Hunger committed
29

Tobias Hunger's avatar
Tobias Hunger committed
30 31
#ifndef KIT_H
#define KIT_H
Tobias Hunger's avatar
Tobias Hunger committed
32 33 34 35 36 37 38 39 40 41 42 43 44

#include "projectexplorer_export.h"
#include "task.h"

#include <coreplugin/id.h>

#include <QVariant>

namespace Utils { class Environment; }

namespace ProjectExplorer {

namespace Internal {
Tobias Hunger's avatar
Tobias Hunger committed
45 46
class KitManagerPrivate;
class KitPrivate;
Tobias Hunger's avatar
Tobias Hunger committed
47 48 49
} // namespace Internal

/**
Tobias Hunger's avatar
Tobias Hunger committed
50
 * @brief The Kit class
Tobias Hunger's avatar
Tobias Hunger committed
51
 *
Tobias Hunger's avatar
Tobias Hunger committed
52
 * The kit holds a set of values defining a system targeted by the software
Tobias Hunger's avatar
Tobias Hunger committed
53 54
 * under development.
 */
Tobias Hunger's avatar
Tobias Hunger committed
55
class PROJECTEXPLORER_EXPORT Kit
Tobias Hunger's avatar
Tobias Hunger committed
56 57
{
public:
Tobias Hunger's avatar
Tobias Hunger committed
58 59
    Kit();
    ~Kit();
Tobias Hunger's avatar
Tobias Hunger committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78

    bool isValid() const;
    QList<Task> validate();

    QString displayName() const;
    void setDisplayName(const QString &name);

    bool isAutoDetected() const;
    Core::Id id() const;

    QIcon icon() const;
    QString iconPath() const;
    void setIconPath(const QString &path);

    QVariant value(const Core::Id &key, const QVariant &unset = QVariant()) const;
    bool hasValue(const Core::Id &key) const;
    void setValue(const Core::Id &key, const QVariant &value);
    void removeKey(const Core::Id &key);

Tobias Hunger's avatar
Tobias Hunger committed
79
    bool operator==(const Kit &other) const;
Tobias Hunger's avatar
Tobias Hunger committed
80 81 82 83

    void addToEnvironment(Utils::Environment &env) const;

    QString toHtml();
Tobias Hunger's avatar
Tobias Hunger committed
84
    Kit *clone(bool keepName = false) const;
Tobias Hunger's avatar
Tobias Hunger committed
85 86

private:
87
    // Unimplemented.
Tobias Hunger's avatar
Tobias Hunger committed
88 89
    Kit(const Kit &other);
    void operator=(const Kit &other);
90

Tobias Hunger's avatar
Tobias Hunger committed
91 92 93
    void setAutoDetected(bool detected);
    void setValid(bool valid);

Tobias Hunger's avatar
Tobias Hunger committed
94
    void kitUpdated();
Tobias Hunger's avatar
Tobias Hunger committed
95 96 97 98

    QVariantMap toMap() const;
    bool fromMap(const QVariantMap &value);

Tobias Hunger's avatar
Tobias Hunger committed
99
    Internal::KitPrivate *d;
Tobias Hunger's avatar
Tobias Hunger committed
100

Tobias Hunger's avatar
Tobias Hunger committed
101 102
    friend class KitManager;
    friend class Internal::KitManagerPrivate;
Tobias Hunger's avatar
Tobias Hunger committed
103 104 105 106
};

} // namespace ProjectExplorer

Tobias Hunger's avatar
Tobias Hunger committed
107
Q_DECLARE_METATYPE(ProjectExplorer::Kit *)
Tobias Hunger's avatar
Tobias Hunger committed
108

Tobias Hunger's avatar
Tobias Hunger committed
109
#endif // KIT_H