qtkitinformation.h 3.15 KB
Newer Older
Tobias Hunger's avatar
Tobias Hunger committed
1
2
3
4
5
6
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
**
Eike Ziller's avatar
Eike Ziller committed
7
** Contact: http://www.qt-project.org/
Tobias Hunger's avatar
Tobias Hunger committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
**
**
** GNU Lesser General Public License Usage
**
** 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.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**************************************************************************/

Tobias Hunger's avatar
Tobias Hunger committed
31
32
#ifndef QTSUPPORT_QTKITINFORMATION_H
#define QTSUPPORT_QTKITINFORMATION_H
Tobias Hunger's avatar
Tobias Hunger committed
33
34
35

#include "qtsupport_global.h"

Tobias Hunger's avatar
Tobias Hunger committed
36
#include <projectexplorer/kitinformation.h>
Tobias Hunger's avatar
Tobias Hunger committed
37
38
39
40
41

#include "baseqtversion.h"

namespace QtSupport {

Tobias Hunger's avatar
Tobias Hunger committed
42
class QTSUPPORT_EXPORT QtKitInformation : public ProjectExplorer::KitInformation
Tobias Hunger's avatar
Tobias Hunger committed
43
44
45
46
{
    Q_OBJECT

public:
Tobias Hunger's avatar
Tobias Hunger committed
47
    QtKitInformation();
Tobias Hunger's avatar
Tobias Hunger committed
48
49
50
51
52

    Core::Id dataId() const;

    unsigned int priority() const; // the higher the closer to the top.

Tobias Hunger's avatar
Tobias Hunger committed
53
    QVariant defaultValue(ProjectExplorer::Kit *p) const;
Tobias Hunger's avatar
Tobias Hunger committed
54

Tobias Hunger's avatar
Tobias Hunger committed
55
    QList<ProjectExplorer::Task> validate(ProjectExplorer::Kit *p) const;
Tobias Hunger's avatar
Tobias Hunger committed
56

Tobias Hunger's avatar
Tobias Hunger committed
57
    ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *p) const;
Tobias Hunger's avatar
Tobias Hunger committed
58

Tobias Hunger's avatar
Tobias Hunger committed
59
    QString displayNamePostfix(const ProjectExplorer::Kit *p) const;
Tobias Hunger's avatar
Tobias Hunger committed
60

Tobias Hunger's avatar
Tobias Hunger committed
61
    ItemList toUserOutput(ProjectExplorer::Kit *p) const;
Tobias Hunger's avatar
Tobias Hunger committed
62

Tobias Hunger's avatar
Tobias Hunger committed
63
    void addToEnvironment(const ProjectExplorer::Kit *p, Utils::Environment &env) const;
Tobias Hunger's avatar
Tobias Hunger committed
64

Tobias Hunger's avatar
Tobias Hunger committed
65
66
67
68
    static int qtVersionId(const ProjectExplorer::Kit *p);
    static void setQtVersionId(ProjectExplorer::Kit *p, const int id);
    static BaseQtVersion *qtVersion(const ProjectExplorer::Kit *p);
    static void setQtVersion(ProjectExplorer::Kit *p, const BaseQtVersion *v);
Tobias Hunger's avatar
Tobias Hunger committed
69
70
};

Tobias Hunger's avatar
Tobias Hunger committed
71
class QTSUPPORT_EXPORT QtPlatformKitMatcher : public ProjectExplorer::KitMatcher
Tobias Hunger's avatar
Tobias Hunger committed
72
73
{
public:
Tobias Hunger's avatar
Tobias Hunger committed
74
    QtPlatformKitMatcher(const QString &platform);
Tobias Hunger's avatar
Tobias Hunger committed
75

Tobias Hunger's avatar
Tobias Hunger committed
76
    bool matches(const ProjectExplorer::Kit *p) const;
Tobias Hunger's avatar
Tobias Hunger committed
77
78
79
80
81

private:
    QString m_platform;
};

Tobias Hunger's avatar
Tobias Hunger committed
82
class QTSUPPORT_EXPORT QtVersionKitMatcher : public ProjectExplorer::KitMatcher
Tobias Hunger's avatar
Tobias Hunger committed
83
84
{
public:
Tobias Hunger's avatar
Tobias Hunger committed
85
    explicit QtVersionKitMatcher(const Core::FeatureSet &required = Core::FeatureSet(),
Tobias Hunger's avatar
Tobias Hunger committed
86
87
88
89
90
                                     const QtVersionNumber &min = QtVersionNumber(0, 0, 0),
                                     const QtVersionNumber &max = QtVersionNumber(INT_MAX, INT_MAX, INT_MAX)) :
        m_min(min), m_max(max), m_features(required)
    { }

Tobias Hunger's avatar
Tobias Hunger committed
91
    bool matches(const ProjectExplorer::Kit *p) const;
Tobias Hunger's avatar
Tobias Hunger committed
92
93
94
95
96
97
98
99
100

private:
    QtVersionNumber m_min;
    QtVersionNumber m_max;
    Core::FeatureSet m_features;
};

} // namespace QtSupport

Tobias Hunger's avatar
Tobias Hunger committed
101
#endif // QTSUPPORT_QTKITINFORMATION_H