1 /* |
|
2 * Copyright (c) 2006-2008 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: Plug-in main class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CAISATPLUGIN_H |
|
20 #define CAISATPLUGIN_H |
|
21 |
|
22 #include <hscontentpublisher.h> |
|
23 #include <aicontentmodel.h> |
|
24 |
|
25 #include "mpluginapi.h" |
|
26 #include "caisatengine.h" |
|
27 |
|
28 class MAiContentObserver; |
|
29 class MAiContentItemIterator; |
|
30 |
|
31 /** |
|
32 * Plug-in main class |
|
33 * |
|
34 * @since S60 v3.2 |
|
35 */ |
|
36 class CAiSatPlugin : public CHsContentPublisher, |
|
37 public MPluginAPI |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Part of the two phased constuction |
|
44 */ |
|
45 static CAiSatPlugin* NewL(); |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 ~CAiSatPlugin(); |
|
51 |
|
52 /** |
|
53 * Publishes SAT Set Up Idle Mode Text |
|
54 */ |
|
55 void PublishSatL(); |
|
56 |
|
57 // from base class CHsContentPublisher |
|
58 |
|
59 /** |
|
60 * @see CHsContentPublisher |
|
61 */ |
|
62 void Start( TStartReason aReason ); |
|
63 |
|
64 /** |
|
65 * @see CHsContentPublisher |
|
66 */ |
|
67 void Stop( TStopReason aReason ); |
|
68 |
|
69 /** |
|
70 * @see CHsContentPublisher |
|
71 */ |
|
72 void Resume( TResumeReason aReason ); |
|
73 |
|
74 /** |
|
75 * @see CHsContentPublisher |
|
76 */ |
|
77 void Suspend( TSuspendReason aReason ); |
|
78 |
|
79 /** |
|
80 * @see CHsContentPublisher |
|
81 */ |
|
82 void SubscribeL( MAiContentObserver& aObserver ); |
|
83 |
|
84 /** |
|
85 * @see CHsContentPublisher |
|
86 */ |
|
87 void ConfigureL( RAiSettingsItemArray& aSettings ); |
|
88 |
|
89 /** |
|
90 * @see CHsContentPublisher |
|
91 */ |
|
92 TAny* GetProperty( TProperty aProperty ); |
|
93 |
|
94 /** |
|
95 * Receives a notification of the content update event |
|
96 */ |
|
97 void NotifyContentUpdate(); |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * Constructor to use in the object creation. |
|
103 * Initializes the necessary data. |
|
104 */ |
|
105 CAiSatPlugin(); |
|
106 |
|
107 /** |
|
108 * Part of the two phased construction |
|
109 */ |
|
110 void ConstructL(); |
|
111 |
|
112 /** |
|
113 * Update idle area when plug in reload. |
|
114 */ |
|
115 void UpdateSatL(); |
|
116 |
|
117 /** |
|
118 * Publish a icon to the idle area. |
|
119 * |
|
120 * @param aObserver The Active Idle content observer. |
|
121 * @param aIcon The icon to be published. |
|
122 * @return The error code. |
|
123 */ |
|
124 TInt PublishIcon( MAiContentObserver& aObserver, CGulIcon* aIcon ); |
|
125 |
|
126 /** |
|
127 * Clean setup idle mode icon. |
|
128 * |
|
129 * @param aObserver The Active Idle content observer. |
|
130 * @return The error code. |
|
131 */ |
|
132 TInt CleanIcon( MAiContentObserver& aObserver ); |
|
133 |
|
134 /** |
|
135 * Publish a SetUpIdleModeText string. |
|
136 * |
|
137 * @param aObserver The Active Idle content observer. |
|
138 * @param aContent The SetUpIdleModeText string would be published. |
|
139 * @return The error code. |
|
140 */ |
|
141 TInt PublishText( MAiContentObserver& aObserver, |
|
142 const TDesC& aText ); |
|
143 |
|
144 /** |
|
145 * Clean setup idle mode text. |
|
146 * |
|
147 * @param aObserver The Active Idle content observer. |
|
148 * @return The error code. |
|
149 */ |
|
150 TInt CleanText( MAiContentObserver& aObserver ); |
|
151 |
|
152 private: // data |
|
153 |
|
154 /** |
|
155 * Iterator for plugin content |
|
156 * Own |
|
157 */ |
|
158 MAiContentItemIterator* iContent; |
|
159 |
|
160 /** |
|
161 * Iterator for plugin resources |
|
162 * Own |
|
163 */ |
|
164 MAiContentItemIterator* iResources; |
|
165 |
|
166 /** |
|
167 * Iterator for plugin events |
|
168 * Own |
|
169 */ |
|
170 MAiContentItemIterator* iEvents; |
|
171 |
|
172 /** |
|
173 * Plugin engine |
|
174 * Own |
|
175 */ |
|
176 CAiSatEngine* iEngine; |
|
177 |
|
178 /** |
|
179 * Array of content observers |
|
180 */ |
|
181 RPointerArray<MAiContentObserver> iObservers; |
|
182 |
|
183 /** |
|
184 * Whether the icon is the same with previous one. |
|
185 */ |
|
186 TBool iDupIcon; |
|
187 |
|
188 /** |
|
189 * Whether the text is the same with previous one. |
|
190 */ |
|
191 TBool iDupText; |
|
192 |
|
193 /** |
|
194 * ETrue, if data should be published in Resume() |
|
195 */ |
|
196 TBool iPublishRequired; |
|
197 }; |
|
198 |
|
199 #endif // CAISATPLUGIN_H |
|
200 |
|
201 |
|