|
1 /* |
|
2 * Copyright (c) 2006-2010 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: Header file for the CAiSatEngine class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAISATENGINE_H |
|
20 #define CAISATENGINE_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 |
|
24 #include <e32property.h> |
|
25 #include <SATInternalPSKeys.h> |
|
26 #include <rsatsession.h> // For idle mode text and icon |
|
27 #include <rsatservice.h> // For idle mode text and icon |
|
28 #include <tsaticoninfo.h> |
|
29 |
|
30 class CAiSatNotifier; |
|
31 class TAIPluginInitData; |
|
32 class MPluginAPI; |
|
33 |
|
34 /** |
|
35 * CAiSatEngine |
|
36 * |
|
37 * @since S60 v3.2 |
|
38 */ |
|
39 class CAiSatEngine : public CBase |
|
40 { |
|
41 |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Part of the two phased constuction |
|
46 * |
|
47 * @param MPluginAPI& aPlugin a ref to a object implementing MPluginAPI |
|
48 * (the object ordering a notification of the content status change) |
|
49 * @return Pointer to the created CAiSatEngine object |
|
50 */ |
|
51 static CAiSatEngine* NewL( MPluginAPI& aPlugin ); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 ~CAiSatEngine(); |
|
57 |
|
58 public: // New functions |
|
59 |
|
60 /** |
|
61 * Offers the Idle Mode text |
|
62 * |
|
63 * @param aString Idle mode text for publishing |
|
64 */ |
|
65 void ContentText( TPtrC& aString ); |
|
66 |
|
67 /** |
|
68 * Offers the Idle Mode icon |
|
69 * |
|
70 * @param aGulIcon icon for publishing |
|
71 * |
|
72 */ |
|
73 void ContentIconL( CGulIcon*& aGulIcon ); |
|
74 |
|
75 /** |
|
76 * Formulates response to SatIcon API. |
|
77 */ |
|
78 void HandleNotifyL(); |
|
79 |
|
80 /** |
|
81 * Get idle text, icon id, icon qulifier and load icon as bitmap. |
|
82 * |
|
83 * @param aDupIcon If the icon is the same as previous one. |
|
84 * @param aDupText If the text is the same as previous one. |
|
85 */ |
|
86 void PrepareIdleModeDataL( TBool& aDupIcon, TBool& aDupText ); |
|
87 |
|
88 private: // private construction method |
|
89 |
|
90 /** |
|
91 * Constructor to use in the object creation. |
|
92 * Initializes the necessary data. |
|
93 * |
|
94 * @param MPluginAPI& aPlugin a ref to a object implementing MPluginAPI |
|
95 * (the object ordering a notification of the content status change) |
|
96 */ |
|
97 CAiSatEngine( MPluginAPI& aPlugin); |
|
98 |
|
99 /** |
|
100 * Part of the two phased construction |
|
101 */ |
|
102 void ConstructL(); |
|
103 |
|
104 private: // New functions |
|
105 |
|
106 /** |
|
107 * Loads the Idle Mode icon from SatIcon. |
|
108 * |
|
109 * @param aIconId The icon record id. |
|
110 * @param aIconQualifier the icon qualifier. |
|
111 * @return The Idle Mode icon id in TInt, the caller need to delete |
|
112 * the pointer. |
|
113 */ |
|
114 CFbsBitmap* LoadIconL( TUint8 aIconId, |
|
115 RSatService::TSatIconQualifier aIconQualifier ); |
|
116 |
|
117 /** |
|
118 * Information of the content availability. |
|
119 * |
|
120 * @return ETrue if there is content to show, EFalse if not. |
|
121 */ |
|
122 TBool HasContent(); |
|
123 |
|
124 /** |
|
125 * Sends idle information to satIconInfo |
|
126 * |
|
127 * @param const RSatService::TSATIdleResult& aResponse |
|
128 */ |
|
129 void SendSatResponseL( |
|
130 const RSatService::TSATIdleResult& aResponse ) const; |
|
131 |
|
132 private: // Data |
|
133 |
|
134 /** |
|
135 * Pointer to the Display Text proactive command handler |
|
136 * Own |
|
137 */ |
|
138 CAiSatNotifier* iNotifier; |
|
139 |
|
140 /** |
|
141 * ref to the class implementing the MPluginAPI interface |
|
142 */ |
|
143 MPluginAPI& iPlugin; |
|
144 |
|
145 /** |
|
146 * SIM icon buffer |
|
147 * Own |
|
148 */ |
|
149 CFbsBitmap* iIcon; |
|
150 |
|
151 /** |
|
152 * Icon id in previous icon loading (to check if icon is changed) |
|
153 */ |
|
154 TUint8 iPreviousIconId; |
|
155 |
|
156 /** |
|
157 * SatClient session. |
|
158 */ |
|
159 RSatSession iSatSession; |
|
160 |
|
161 /** |
|
162 * SatClient service. |
|
163 */ |
|
164 RSatService iSatService; |
|
165 }; |
|
166 |
|
167 #endif // CAISATENGINE_H |