OSDN Git Service

387a398731ba02de5271d1014ee80e078e3087d8
[qt-creator-jp/qt-creator-jp.git] / src / plugins / qt4projectmanager / qt-s60 / s60certificateinfo.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** No Commercial Usage
10 **
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 **
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file.  Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights.  These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
31 **
32 **************************************************************************/
33
34 #ifndef S60CERTIFICATEINFO_H
35 #define S60CERTIFICATEINFO_H
36
37 #include <QtCore/QObject>
38 #include <QtCore/QStringList>
39 #include <QtCore/QtGlobal>
40
41 namespace Qt4ProjectManager {
42 namespace Internal {
43
44 class S60SymbianCertificate;
45
46 class S60CertificateInfo : public QObject
47 {
48     Q_OBJECT
49
50 public:
51     enum CertificateState {
52         CertificateValid,
53         CertificateWarning,
54         CertificateError
55     };
56
57     enum S60Capability {
58         TCB                 = 1 << (31-0),
59         CommDD              = 1 << (31-1),
60         PowerMgmt           = 1 << (31-2),
61         MultimediaDD        = 1 << (31-3),
62         ReadDeviceData      = 1 << (31-4),
63         WriteDeviceData     = 1 << (31-5),
64         DRM                 = 1 << (31-6),
65         TrustedUI           = 1 << (31-7),
66         ProtServ            = 1 << (31-8),
67         DiskAdmin           = 1 << (31-9),
68         NetworkControl      = 1 << (31-10),
69         AllFiles            = 1 << (31-11),
70         SwEvent             = 1 << (31-12),
71         NetworkServices     = 1 << (31-13),
72         LocalServices       = 1 << (31-14),
73         ReadUserData        = 1 << (31-15),
74         WriteUserData       = 1 << (31-16),
75         Location            = 1 << (31-17),
76         SurroundingsDD      = 1 << (31-18),
77         UserEnvironment     = 1 << (31-19),
78
79         NoInformation       = 0
80     };
81
82     enum S60CapabilitySet {
83         UserCapabilities       = LocalServices|Location|NetworkServices|ReadUserData
84                                   |UserEnvironment|WriteUserData,
85         SystemCapabilities     = PowerMgmt|ProtServ|ReadDeviceData|SurroundingsDD
86                                   |SwEvent|TrustedUI|WriteDeviceData,
87         RestrictedCapabilities = CommDD|DiskAdmin|NetworkControl|MultimediaDD,
88         ManufacturerCapabilities = AllFiles|DRM|TCB
89     };
90
91     explicit S60CertificateInfo(const QString &filePath, QObject* parent = 0);
92     ~S60CertificateInfo();
93
94     CertificateState validateCertificate();
95     QStringList devicesSupported() const;
96     quint32 capabilitiesSupported() const;
97     QString toHtml(bool keepShort = true);
98     QString errorString() const;
99     bool isDeveloperCertificate() const;
100
101     bool compareCapabilities(const QStringList &givenCaps, QStringList &unsupportedCaps) const;
102
103 private:
104     S60SymbianCertificate *m_certificate;
105     QString m_filePath;
106     QString m_errorString;
107     QStringList m_imeiList;
108     quint32 m_capabilities;
109 };
110
111 } // namespace Internal
112 } // namespace Qt4ProjectExplorer
113
114 #endif // S60CERTIFICATEINFO_H