1 /* |
|
2 * Copyright (c) 2002-2007 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: Handles the icon sub-session IPC. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSATSICONSUBSESSION_H |
|
20 #define CSATSICONSUBSESSION_H |
|
21 |
|
22 #include <etelsat.h> |
|
23 |
|
24 #include "CSatSSubSession.h" |
|
25 #include "MSatIconObserver.h" |
|
26 |
|
27 class MSatSIconAPI; |
|
28 class CSatSSession; |
|
29 class CFbsBitmap; |
|
30 class TSatEventMediator; |
|
31 |
|
32 /** |
|
33 * Handles the icon commands. |
|
34 * |
|
35 * @lib SatEngine.lib |
|
36 * @since 3.0 |
|
37 */ |
|
38 class CSatSIconSubSession : public MSatIconObserver, |
|
39 public CSatSSubSession |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * @param aSession Parent session. |
|
46 * @param aEventMediator Passes SetUpIdleMode response event. |
|
47 */ |
|
48 static CSatSIconSubSession* NewL( |
|
49 CSatSSession& aSession, |
|
50 TSatEventMediator& aEventMediator ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 virtual ~CSatSIconSubSession(); |
|
56 |
|
57 private: // New functions |
|
58 |
|
59 /** |
|
60 * Gets the icon info from SIM. |
|
61 */ |
|
62 void GetIconInfo(); |
|
63 |
|
64 /** |
|
65 * Gets the icon from SIM. |
|
66 */ |
|
67 void GetIconInstanceL(); |
|
68 |
|
69 /** |
|
70 * Writes to client address space. Panics the client |
|
71 * if writing fails. |
|
72 * @param aMessage Message, which to write. |
|
73 * @param aParam Parameter number |
|
74 * @param aDes Descriptor to be written. |
|
75 */ |
|
76 void Write( |
|
77 const RMessage2& aMessage, |
|
78 TInt aParam, |
|
79 const TDesC8& aDes ) const; |
|
80 |
|
81 public: // Functions from base classes |
|
82 |
|
83 /** |
|
84 * From CSatSSubSession |
|
85 * @param aFunction Function. |
|
86 * @param aMessage IPC message. |
|
87 */ |
|
88 void HandleCommandL( const RMessage2& aMessage ); |
|
89 |
|
90 /** |
|
91 * From MSatIconObserver. |
|
92 * Notification of getting icon info from SIM. |
|
93 */ |
|
94 void NotifyGetIconInfo(); |
|
95 |
|
96 /** |
|
97 * From MSatIconObserver. |
|
98 * Notification of getting icon image. |
|
99 */ |
|
100 void NotifyGetIconInstanceL(); |
|
101 |
|
102 /** |
|
103 * From MSatIconObserver. |
|
104 * Notification of getting icon color lookup table. |
|
105 */ |
|
106 void NotifyGetClutL(); |
|
107 |
|
108 /** |
|
109 * From MSatIconObserver. |
|
110 * Notification of operation failure |
|
111 * @param aErrorCode Reason of failure. |
|
112 */ |
|
113 void NotifyFailure( TInt aErrorCode ); |
|
114 |
|
115 /** |
|
116 * From MSatIconObserver. |
|
117 * Error completion for handler |
|
118 * @param aError Received error code |
|
119 * @return Result of completion |
|
120 */ |
|
121 TInt CompleteError( TInt aError ) const; |
|
122 |
|
123 /** |
|
124 * Get icon fetching mode which is in synchronous or asynchronous mode. |
|
125 * @return Icon fetching mode. |
|
126 */ |
|
127 TBool IconFetchingMode(); |
|
128 |
|
129 /** |
|
130 * Notify CSatIconHandler to fetch icons from NAA synchronously or |
|
131 * asynchrounously. |
|
132 * @param aMode Icon fetching is in synchronously or asynchronously |
|
133 * @return None |
|
134 */ |
|
135 void NotifyIconFetchingMode( TBool aMode ); |
|
136 |
|
137 private: |
|
138 |
|
139 /** |
|
140 * ConstrucL |
|
141 */ |
|
142 void ConstructL(); |
|
143 |
|
144 /** |
|
145 * C++ default constructor. |
|
146 * @param aSession Parent session. |
|
147 * @param aEventMediator Passes SetUpIdleMode response event. |
|
148 */ |
|
149 CSatSIconSubSession( |
|
150 CSatSSession& aSession, |
|
151 TSatEventMediator& aEventMediator ); |
|
152 |
|
153 /** |
|
154 * Delivers SetUpIdleModeText response to corresponding command handler. |
|
155 * @param aResponse Idle mode response. |
|
156 */ |
|
157 void SendSetUpIdleModeResponse( TInt aResponse ) const; |
|
158 |
|
159 private: // Data |
|
160 |
|
161 // Interface for accessing icons in SIM. |
|
162 MSatSIconAPI* iIconAPI; |
|
163 |
|
164 // Bitmap instance. |
|
165 CFbsBitmap* iBitmap; |
|
166 |
|
167 // Message just being executed. |
|
168 RMessage2 iMessage; |
|
169 |
|
170 // Icon info got from SIM. |
|
171 RSat::TIcon iIconEf; |
|
172 |
|
173 // Icon info from client. |
|
174 RSat::TInstanceInfoV3 iInfo; |
|
175 |
|
176 // Icon data. |
|
177 HBufC8* iIconData; |
|
178 |
|
179 // Icon color lookup table. |
|
180 HBufC8* iClut; |
|
181 |
|
182 // Event mediator to send SetUpIdleMode response |
|
183 TSatEventMediator& iEventMediator; |
|
184 |
|
185 }; |
|
186 |
|
187 #endif // CSATSICONSUBSESSION_H |
|