OSDN Git Service

Update license.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qt4projectmanager / qt-s60 / s60publisherovi.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
8 **
9 **
10 ** GNU Lesser General Public License Usage
11 **
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 **
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 **
23 ** Other Usage
24 **
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **************************************************************************/
32 #ifndef S60PUBLISHEROVI_H
33 #define S60PUBLISHEROVI_H
34
35 #include <QtCore/QObject>
36 #include <QtGui/QColor>
37
38 QT_BEGIN_NAMESPACE
39 class QProcess;
40 QT_END_NAMESPACE
41
42 namespace ProjectExplorer {
43 class Project;
44 }
45
46 namespace Qt4ProjectManager {
47 class Qt4BuildConfiguration;
48 class Qt4Project;
49 namespace Internal {
50 class Qt4SymbianTarget;
51 class ProFileReader;
52
53 namespace Constants {
54 const char * const REJECTED_VENDOR_NAMES_VENDOR = "Vendor";
55 const char * const REJECTED_VENDOR_NAMES_VENDOR_EN = "Vendor-EN";
56 const char * const REJECTED_VENDOR_NAMES_NOKIA = "Nokia";
57 const char * const REJECTED_VENDOR_NAMES_EMPTY = "";
58
59 const char * const CERTIFIED_SIGNED_CAPABILITY_NETWORK_CONTROL = "NetworkControl";
60 const char * const CERTIFIED_SIGNED_CAPABILITY_MULTIMEDIA_DD = "MultimediaDD";
61 const char * const CERTIFIED_SIGNED_CAPABILITY_COMM_DD = "CommDD";
62 const char * const CERTIFIED_SIGNED_CAPABILITY_DISK_ADMIN = "DiskAdmin";
63 const char * const MANUFACTURER_APPROVED_CAPABILITY_ALL_FILES = "AllFiles";
64 const char * const MANUFACTURER_APPROVED_CAPABILITY_DRM = "DRM";
65 const char * const MANUFACTURER_APPROVED_CAPABILITY_TCB = "TCB";
66 }
67
68 class S60PublisherOvi : public QObject
69 {
70     Q_OBJECT
71
72 public:
73     enum UID3Ranges {
74         //    Protected UID range:   0x00000000 - 0x7FFFFFFF
75         //    Unprotected UID range: 0x80000000 - 0xFFFFFFFF
76         //
77         //    Specifically, there are two important unprotected UID ranges:
78         //    UIDs from Symbian Signed:         0xA0000000 - 0xAFFFFFFF
79         //    UIDs for test/development use:    0xE0000000 - 0xEFFFFFFF
80         //
81         //    And one important protected range:
82         //    UIDs from Ovi Sign: 0x20000000 to 0x2FFFFFFF
83         //    Warning: Some of these UIDs are assigned by Symbiansigned.
84         //    Apps with such UIDs cannot be signed by Ovi.
85         //    It is currently impossible to say which UIDs have been assigned by whome.
86
87         AssignedRestrictedStart = 0x20000000,
88         AssignedRestrictedEnd = 0x2FFFFFFF,
89         SymbianSignedUnprotectedStart = 0xA0000000,
90         SymbianSignedUnprotectedEnd = 0xAFFFFFFF,
91         TestStart = 0xE0000000,
92         TestEnd = 0xEFFFFFFF
93     };
94
95     enum CapabilityLevel {
96         CertifiedSigned,
97         ManufacturerApproved
98     };
99
100 public:
101     explicit S60PublisherOvi(QObject *parent = 0);
102     ~S60PublisherOvi();
103
104     void setBuildConfiguration(Qt4BuildConfiguration *qt4bc);
105     void cleanUp();
106     void completeCreation();
107
108     QString globalVendorName() const;
109     QString localisedVendorNames() const;
110     bool isVendorNameValid(const QString &vendorName) const;
111
112     QString qtVersion() const;
113
114     QString uid3() const;
115     bool isUID3Valid(const QString &uid3) const;
116     bool isTestUID3(const QString &uid3) const;
117     bool isKnownSymbianSignedUID3(const QString &uid3) const;
118
119     QString capabilities() const;
120     bool isCapabilityOneOf(const QString &capability, CapabilityLevel level) const;
121
122     void updateProFile();
123     void updateProFile(const QString &var, const QString &values);
124     void buildSis();
125
126     QString createdSisFileContainingFolder();
127     QString createdSisFilePath();
128
129     bool hasSucceeded();
130
131     void setVendorName(const QString &vendorName);
132     void setLocalVendorNames(const QString &localVendorNames);
133     void setAppUid(const QString &appuid);
134
135 signals:
136     void progressReport(const QString& status, QColor c);
137     void succeeded();
138
139 public slots:
140     void runQMake();
141     void runBuild(int result);
142     void runCreateSis(int result);
143     void endBuild(int result);
144
145 private:
146     void runStep(int result, const QString& buildStep, const QString& command, QProcess* currProc, QProcess* prevProc);
147
148     QColor m_errorColor;
149     QColor m_commandColor;
150     QColor m_okColor;
151     QColor m_normalColor;
152
153     QProcess* m_qmakeProc;
154     QProcess* m_buildProc;
155     QProcess* m_createSisProc;
156
157     Qt4BuildConfiguration * m_qt4bc;
158     const Qt4SymbianTarget * m_activeTargetOfProject;
159     Qt4Project * m_qt4project;
160     ProFileReader *m_reader;
161     QStringList m_rejectedVendorNames;
162     QStringList m_capabilitiesForCertifiedSigned;
163     QStringList m_capabilitesForManufacturerApproved;
164     QString m_vendorName;
165     QString m_localVendorNames;
166     QString m_appUid;
167
168     bool m_finishedAndSuccessful;
169 };
170
171 } // namespace Internal
172 } // namespace Qt4ProjectManager
173
174 #endif // S60PUBLISHEROVI_H