|
1 /* |
|
2 * Copyright (c) 2006-2009 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 "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: |
|
15 * Name : CSatIconTsy.h |
|
16 * Part of : Common SIM ATK TSY / commonsimatktsy |
|
17 * Interface : - |
|
18 * Icon related functionality of Sat Tsy |
|
19 * Version : 1.0 |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 #ifndef CSATICONTSY_H |
|
27 #define CSATICONTSY_H |
|
28 |
|
29 |
|
30 // INCLUDES |
|
31 #include <e32base.h> |
|
32 #include <etelsat.h> |
|
33 |
|
34 #include "CSatTsy.h" // Sat Tsy class |
|
35 |
|
36 // CONSTANTS |
|
37 const TUint8 KFilePathLength = 8; |
|
38 const TUint8 KClutEntrySize = 3; |
|
39 const TUint8 KMaxRecordDataSize = 255; |
|
40 const TUint8 KIconInfoLength = 6; |
|
41 const TUint8 KGetIconDataPckgLength = 2; |
|
42 |
|
43 // From 3GPP TS 51.011, 10.6.11 EFimg (Image) |
|
44 const TUint8 KImageCodingSchemeByteNr = 3; |
|
45 const TUint8 KImageInstanceIdOffset = 4; |
|
46 const TUint8 KImageInstanceFileLength = 9; |
|
47 |
|
48 // File ID |
|
49 const TUint16 KMasterFile = 0x3F00; |
|
50 const TUint16 KDedicatedFile = 0x7F10; |
|
51 const TUint16 KDedicatedFileGraphics = 0x5F50; |
|
52 const TUint16 KElementaryFileImg = 0x4F20; |
|
53 const TUint16 KIconDataMaxSize = 0x3FE8; |
|
54 |
|
55 // FORWARD DECLARATIONS |
|
56 class CSatDataPackage; |
|
57 |
|
58 |
|
59 // CLASS DECLARATION |
|
60 //none |
|
61 |
|
62 // DESCRIPTION |
|
63 /** |
|
64 * CSatIconTsy contains Icon handling functionality. |
|
65 * |
|
66 * @lib Commonsimatktsy |
|
67 * @since 3.1 |
|
68 */ |
|
69 NONSHARABLE_CLASS ( CSatIconTsy ) : public CBase |
|
70 { |
|
71 public: // Enumerations |
|
72 |
|
73 enum TEtelIconRequestType |
|
74 { |
|
75 ERequestTypeUnknown, |
|
76 EGetIconReq, |
|
77 EGetImageInstanceReq, |
|
78 EGetClutReq |
|
79 }; |
|
80 /* |
|
81 * The data in this structure contains information |
|
82 * needed in Get Icon, Get image instance and get clut. |
|
83 */ |
|
84 struct TIconInfo |
|
85 { |
|
86 TUint16 iOffset; // Offset |
|
87 TUint16 iLength; // Length |
|
88 TBuf8<KFilePathLength> iSimFilePath; // Sim file path |
|
89 }; |
|
90 |
|
91 /** |
|
92 * Two-phased constructor. |
|
93 * @param aSatTsy |
|
94 * return CSatTsy*: created Icon object |
|
95 */ |
|
96 static CSatIconTsy* NewL( CSatTsy* aSatTsy ); |
|
97 |
|
98 /** |
|
99 * C++ Destructor. |
|
100 */ |
|
101 virtual ~CSatIconTsy(); |
|
102 |
|
103 public: // New functions |
|
104 |
|
105 /** |
|
106 * Handles extended client requests. |
|
107 * @param aTsyReqHandle TSY request handle |
|
108 * @param aIpc Request IPC number |
|
109 * @param aPackage Packed request parameters |
|
110 * @return Result of the request |
|
111 */ |
|
112 TInt DoExtFuncL( const TTsyReqHandle aTsyReqHandle, |
|
113 const TInt aIpc, const TDataPackage& aPackage ); |
|
114 |
|
115 /** |
|
116 * Completes GetIcon request. |
|
117 * @param aDataPackage: Icon data |
|
118 * @param aResult: KErrNone or error value |
|
119 */ |
|
120 void CompleteGetIcon( CSatDataPackage* aDataPackage, TInt aResult ); |
|
121 |
|
122 /** |
|
123 * Completes GetImageInstance request. |
|
124 * @param aDataPackage: Image instance data |
|
125 * @param aResult: KErrNone or error value |
|
126 */ |
|
127 void CompleteGetImageInstance( CSatDataPackage* aDataPackage, |
|
128 TInt aResult ); |
|
129 |
|
130 /** |
|
131 * Completes GetClut request. |
|
132 * @param aDataPackage: Clut data |
|
133 * @param aResult: KErrNone or error value |
|
134 */ |
|
135 void CompleteGetClut( CSatDataPackage* aDataPackage, TInt aResult ); |
|
136 |
|
137 private: // Constructors |
|
138 |
|
139 /** |
|
140 * By default C++ constructor is private. |
|
141 */ |
|
142 CSatIconTsy(); |
|
143 |
|
144 /** |
|
145 * Class attributes are created in ConstructL. |
|
146 * @return None |
|
147 */ |
|
148 void ConstructL(); |
|
149 |
|
150 private: // Methods |
|
151 |
|
152 /** |
|
153 * This method allows the client to get the content of |
|
154 * the EF_IMG record specified by aRecordNumber. |
|
155 * |
|
156 * @param aTsyReqHandle Request handle |
|
157 * @param aRecordNumber record number |
|
158 * @param aIconEf Icon elementary file |
|
159 * @return KErrNone |
|
160 */ |
|
161 TInt GetIconL( const TTsyReqHandle aTsyReqHandle, |
|
162 TUint8* aRecordNumber, RSat::TIcon* aIconEf ); |
|
163 |
|
164 /** |
|
165 * This method allows the client to get the image instance |
|
166 * specified by the InstanceNumber, Offset and Length contained |
|
167 * in the given InstanceInfo. |
|
168 * |
|
169 * @param aTsyReqHandle Request handle |
|
170 * @param aInstanceInfo Instance info |
|
171 * @param aInstance instance |
|
172 * @return KErrNone |
|
173 */ |
|
174 TInt GetImageInstanceL( const TTsyReqHandle aTsyReqHandle, |
|
175 TDesC8* aInstanceInfo, TDes8* aInstance ); |
|
176 |
|
177 /** |
|
178 * This method allows the client to get the CLUT specified by |
|
179 * InstanceNumber and Offset. |
|
180 * |
|
181 * @param aTsyReqHandle Request handle |
|
182 * @param aNumberAndOffset Instance number and offset |
|
183 * @param aClut Colour look-up table |
|
184 * @return KErrNone |
|
185 */ |
|
186 TInt GetClutL( const TTsyReqHandle aTsyReqHandle, |
|
187 RSat::TInstanceNumberAndOffset* aNumberAndOffset, |
|
188 TDes8* aClut ); |
|
189 |
|
190 protected: // Data |
|
191 |
|
192 // Pointer to Sat TSY |
|
193 CSatTsy* iSatTsy; |
|
194 |
|
195 private: // Data |
|
196 |
|
197 // Used to track what Etel request is ongoing. |
|
198 TEtelIconRequestType iIconReqTypeOngoing; |
|
199 // Icon data |
|
200 TDes8* iIconData; |
|
201 // Record number from which to read in NAA |
|
202 TUint8 iRecordNumber; |
|
203 // Record data from NAA |
|
204 TBuf8<KMaxRecordDataSize> iRecordData; |
|
205 // Number of instance in record |
|
206 TInt iImageInstanceNoInRecord; |
|
207 }; |
|
208 |
|
209 #endif // CSATICONTSY_H |
|
210 |
|
211 |
|
212 // End of File |