|
1 /* |
|
2 * Copyright (c) 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 "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: SendUi Watcher signals service resolver, if service list |
|
15 * is in need of an update. Update events are implicit update |
|
16 (via Publish and Subcribe interface), |
|
17 and mtm installation/removal. |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 #ifndef C_CSENDUIWATCHER_H |
|
25 #define C_CSENDUIWATCHER_H |
|
26 |
|
27 |
|
28 #include <msvapi.h> |
|
29 #include <msvstd.h> |
|
30 #include <e32base.h> |
|
31 |
|
32 |
|
33 class CSendUiPropertyObserver; |
|
34 class CSendUiEcomObserver; |
|
35 class CSendUiWatcher; |
|
36 |
|
37 const TInt KSendUiServiceListUpdateDelay = 5000000; |
|
38 const TInt KSendUiWatcherUid = 0x102823B6; |
|
39 |
|
40 /** |
|
41 * ?one_line_short_description |
|
42 * |
|
43 * ?more_complete_description |
|
44 * |
|
45 * @lib ?library |
|
46 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
47 */ |
|
48 class CSendUiWatcher : public CBase, |
|
49 public MMsvSessionObserver |
|
50 { |
|
51 |
|
52 public: |
|
53 |
|
54 static CSendUiWatcher* NewL( TAny* aWatcherParams ); |
|
55 |
|
56 virtual ~CSendUiWatcher(); |
|
57 |
|
58 /** |
|
59 * Invokes SendUi Service Resolver |
|
60 * |
|
61 * @since S60 v3.2 |
|
62 */ |
|
63 |
|
64 static TInt DoTaskL( TAny* aTask ); |
|
65 |
|
66 |
|
67 void HandleUpdateServicesL( ); |
|
68 |
|
69 |
|
70 // from base class MMsvSessionObserver |
|
71 |
|
72 /** |
|
73 * From MMsvSessionObserver. |
|
74 * HandleSessionEventL |
|
75 * |
|
76 * @since S60 v.3.2 |
|
77 * @param aEvent Indicates the event type. |
|
78 * @param aArg1 Not used |
|
79 * @param aArg2 Not used |
|
80 * @param aArg3 Not used |
|
81 */ |
|
82 void HandleSessionEventL( |
|
83 TMsvSessionEvent aEvent, |
|
84 TAny* /*aArg1*/, |
|
85 TAny* /*aArg2*/, |
|
86 TAny* /*aArg3*/ ); |
|
87 |
|
88 private: |
|
89 |
|
90 CSendUiWatcher(); |
|
91 |
|
92 void ConstructL(); |
|
93 |
|
94 /** |
|
95 * Requests a timer event after short delay. |
|
96 * |
|
97 * @since S60 v3.2 |
|
98 */ |
|
99 void SetTimerL(); |
|
100 |
|
101 /** |
|
102 * Gets feature status from FeatureManager and updates an internal feature flag. |
|
103 * |
|
104 * This is used for observing feature status changes and keeping sending service list up-to-date. |
|
105 * |
|
106 * @since S60 v5.0 |
|
107 */ |
|
108 void FeatureStatus( TInt aFeature, TInt &aNewFeatures, TInt aFeatureFlag ); |
|
109 |
|
110 /** |
|
111 * Checks if Mtm count or language has changed and immediate update is needed. |
|
112 * |
|
113 * @since S60 v3.2 |
|
114 */ |
|
115 void CheckIfUpdateNeededL(); |
|
116 |
|
117 private: // data |
|
118 |
|
119 /** |
|
120 * A channel of communication between a client thread and the Message |
|
121 * Server thread. |
|
122 * Own. |
|
123 */ |
|
124 CMsvSession* iSession; |
|
125 |
|
126 /** |
|
127 * Publish and Subcribe API observer |
|
128 * Own. |
|
129 */ |
|
130 CSendUiPropertyObserver* iPropertyObserver; |
|
131 |
|
132 /** |
|
133 * Observes Ecom events. Requests update, if SendUI Ecom service amount |
|
134 * changes. |
|
135 * Own. |
|
136 */ |
|
137 CSendUiEcomObserver* iEcomObserver; |
|
138 |
|
139 /** |
|
140 * Own. |
|
141 */ |
|
142 CPeriodic* iTimer; |
|
143 |
|
144 }; |
|
145 |
|
146 |
|
147 #endif // C_CSENDUIWATCHER_H |