qtkitinformation.h 3.66 KB
Newer Older
hjk's avatar
hjk committed
1
/****************************************************************************
Tobias Hunger's avatar
Tobias Hunger committed
2
**
3
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
hjk's avatar
hjk committed
4
** 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
23
24
25
** 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.
**
** 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 QTSUPPORT_QTKITINFORMATION_H
#define QTSUPPORT_QTKITINFORMATION_H
Tobias Hunger's avatar
Tobias Hunger committed
32
33
34

#include "qtsupport_global.h"

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

#include "baseqtversion.h"

namespace QtSupport {

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

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

    Core::Id dataId() const;

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

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

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

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

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

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

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

65
66
67
68
    static int qtVersionId(const ProjectExplorer::Kit *k);
    static void setQtVersionId(ProjectExplorer::Kit *k, const int id);
    static BaseQtVersion *qtVersion(const ProjectExplorer::Kit *k);
    static void setQtVersion(ProjectExplorer::Kit *k, const BaseQtVersion *v);
69
70
71
72
private slots:
    void qtVersionsChanged(const QList<int> &addedIds,
                           const QList<int> &removedIds,
                           const QList<int> &changedIds);
Tobias Hunger's avatar
Tobias Hunger committed
73
74
};

Tobias Hunger's avatar
Tobias Hunger committed
75
class QTSUPPORT_EXPORT QtPlatformKitMatcher : public ProjectExplorer::KitMatcher
Tobias Hunger's avatar
Tobias Hunger committed
76
77
{
public:
Tobias Hunger's avatar
Tobias Hunger committed
78
    QtPlatformKitMatcher(const QString &platform);
Tobias Hunger's avatar
Tobias Hunger committed
79

80
    bool matches(const ProjectExplorer::Kit *k) const;
Tobias Hunger's avatar
Tobias Hunger committed
81
82
83
84
85

private:
    QString m_platform;
};

Tobias Hunger's avatar
Tobias Hunger committed
86
class QTSUPPORT_EXPORT QtVersionKitMatcher : public ProjectExplorer::KitMatcher
Tobias Hunger's avatar
Tobias Hunger committed
87
88
{
public:
Tobias Hunger's avatar
Tobias Hunger committed
89
    explicit QtVersionKitMatcher(const Core::FeatureSet &required = Core::FeatureSet(),
Tobias Hunger's avatar
Tobias Hunger committed
90
91
92
93
94
                                     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)
    { }

95
    bool matches(const ProjectExplorer::Kit *k) const;
Tobias Hunger's avatar
Tobias Hunger committed
96
97
98
99
100
101
102
103
104

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

} // namespace QtSupport

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