19
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: describes system information notifiers.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef __DEVICEINFO_H__
|
|
20 |
#define __DEVICEINFO_H__
|
|
21 |
//INCLUDES
|
|
22 |
#include <sysutil.h>
|
|
23 |
|
|
24 |
// CONSTANT DECLARATIONS
|
|
25 |
const TInt KProductTypeTextLength = 64;
|
|
26 |
|
|
27 |
// FORWARD DECLARATIONS
|
|
28 |
/**
|
|
29 |
* @ref CDeviceInfo class used to read static system properties.
|
|
30 |
*
|
|
31 |
* @lib sysinfoservice.lib
|
|
32 |
* @since S60 3.2
|
|
33 |
*/
|
|
34 |
NONSHARABLE_CLASS(CDeviceInfo):public CBase
|
|
35 |
{
|
|
36 |
public: // Constructors and destructor
|
|
37 |
/**
|
|
38 |
* Two-phased constructor.
|
|
39 |
*
|
|
40 |
* @return A new instance of this class.
|
|
41 |
*/
|
|
42 |
static CDeviceInfo* NewL();
|
|
43 |
|
|
44 |
/**
|
|
45 |
* Destructor.
|
|
46 |
*/
|
|
47 |
~CDeviceInfo();
|
|
48 |
|
|
49 |
private:
|
|
50 |
/**
|
|
51 |
* C++ default constructor.
|
|
52 |
*/
|
|
53 |
CDeviceInfo();
|
|
54 |
|
|
55 |
/**
|
|
56 |
* By default Symbian 2nd phase constructor is private.
|
|
57 |
*/
|
|
58 |
void ConstructL();
|
|
59 |
|
|
60 |
private:
|
|
61 |
/**
|
|
62 |
* This function reads device information initializes member varialbes.
|
|
63 |
*/
|
|
64 |
void GetDeviceInfoL();
|
|
65 |
/**
|
|
66 |
* This function does lexical processing on Firmware version to read
|
|
67 |
* product type.
|
|
68 |
*/
|
|
69 |
void ProcessProductTypeL();
|
|
70 |
|
|
71 |
public:
|
|
72 |
/**
|
|
73 |
* @return Firmware version.
|
|
74 |
*/
|
|
75 |
TPtrC FirmwareVersion() const;
|
|
76 |
/**
|
|
77 |
* @return Manufacturer name.
|
|
78 |
*/
|
|
79 |
TPtrC Manufaturer() const;
|
|
80 |
/**
|
|
81 |
* @return Phone model name.
|
|
82 |
*/
|
|
83 |
TPtrC Model() const;
|
|
84 |
/**
|
|
85 |
* @return Serial number of phone.
|
|
86 |
*/
|
|
87 |
TPtrC IMEI() const;
|
|
88 |
/**
|
|
89 |
* @return product type.
|
|
90 |
*/
|
|
91 |
TPtrC ProductType() const;
|
|
92 |
/**
|
|
93 |
* @return Unique Machine ID.
|
|
94 |
*/
|
|
95 |
TInt MachineId() const;
|
|
96 |
/**
|
|
97 |
* On return @p aMajor contains major platform version number.
|
|
98 |
* @p aMinor contains minor platform version number.
|
|
99 |
*/
|
|
100 |
void GetPlatformVersion(TInt& aMajor,TInt& aMinor);
|
|
101 |
/**
|
|
102 |
* On return @p aMajor contains major Symbian OS version number.
|
|
103 |
* @p aMinor contains minor Symbian OS version number.
|
|
104 |
*/
|
|
105 |
void GetOSVersion(TInt& aMajor,TInt& aMinor);
|
|
106 |
|
|
107 |
private: // DATA
|
|
108 |
|
|
109 |
//Platform version.
|
|
110 |
TInt iPlatformMajorVersion;
|
|
111 |
TInt iPlatformMinorVersion;
|
|
112 |
|
|
113 |
//OS version
|
|
114 |
TInt iOSMajorVersion;
|
|
115 |
TInt iOSMinorVersion;
|
|
116 |
|
|
117 |
//Firmware version.
|
|
118 |
TBuf<KSysUtilVersionTextLength> iFirmwareVersion;
|
|
119 |
|
|
120 |
//Serial number, Model and Manufacturer.
|
|
121 |
RMobilePhone::TMobilePhoneIdentityV1 iPhoneIdentity;
|
|
122 |
|
|
123 |
//Product Type.
|
|
124 |
HBufC* iProductType;
|
|
125 |
//Unique Machine ID.
|
|
126 |
TInt iMachineId;
|
|
127 |
};
|
|
128 |
|
|
129 |
#endif __DEVICE_INFO_H__ |