13 * |
13 * |
14 * Description: Dialog renderer. |
14 * Description: Dialog renderer. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 // System includes |
|
19 #include <e32property.h> |
18 |
20 |
19 #include <e32property.h> |
21 // User includes |
|
22 #include <hscontentpublisher.h> |
|
23 #include <hspublisherinfo.h> |
20 #include <activeidle2domainpskeys.h> |
24 #include <activeidle2domainpskeys.h> |
21 #include <aipropertyextension.h> |
|
22 |
|
23 #include <AiNativeUi.rsg> |
25 #include <AiNativeUi.rsg> |
24 |
|
25 #include "ainotifierrenderer.h" |
26 #include "ainotifierrenderer.h" |
26 #include "ainativeuiplugins.h" |
27 #include "ainativeuiplugins.h" |
27 |
28 |
28 using namespace AiNativeUiController; |
29 using namespace AiNativeUiController; |
|
30 |
|
31 // Constants |
29 |
32 |
30 // 1-minute timeout before showing soft notification |
33 // 1-minute timeout before showing soft notification |
31 const TInt KNetworkLostTimeout = 60*1000000; |
34 const TInt KNetworkLostTimeout = 60*1000000; |
32 |
35 |
33 // ======== MEMBER FUNCTIONS ======== |
36 // ======== MEMBER FUNCTIONS ======== |
34 |
37 |
|
38 // ---------------------------------------------------------------------------- |
|
39 // CAiNotifierRenderer::NewLC() |
|
40 // |
|
41 // ---------------------------------------------------------------------------- |
|
42 // |
35 CAiNotifierRenderer* CAiNotifierRenderer::NewLC() |
43 CAiNotifierRenderer* CAiNotifierRenderer::NewLC() |
36 { |
44 { |
37 CAiNotifierRenderer* self = new( ELeave ) CAiNotifierRenderer; |
45 CAiNotifierRenderer* self = new( ELeave ) CAiNotifierRenderer; |
38 CleanupStack::PushL( self ); |
46 CleanupStack::PushL( self ); |
39 self->ConstructL(); |
47 self->ConstructL(); |
40 return self; |
48 return self; |
41 } |
49 } |
42 |
50 |
43 |
51 // ---------------------------------------------------------------------------- |
|
52 // CAiNotifierRenderer::~CAiNotifierRenderer() |
|
53 // |
|
54 // ---------------------------------------------------------------------------- |
|
55 // |
44 CAiNotifierRenderer::~CAiNotifierRenderer() |
56 CAiNotifierRenderer::~CAiNotifierRenderer() |
45 { |
57 { |
46 delete iSoftNotifier; |
58 delete iSoftNotifier; |
47 delete iTimer; |
59 delete iTimer; |
48 } |
60 } |
49 |
61 |
50 |
62 // ---------------------------------------------------------------------------- |
|
63 // CAiNotifierRenderer::CAiNotifierRenderer() |
|
64 // |
|
65 // ---------------------------------------------------------------------------- |
|
66 // |
51 CAiNotifierRenderer::CAiNotifierRenderer() |
67 CAiNotifierRenderer::CAiNotifierRenderer() |
52 { |
68 { |
53 } |
69 } |
54 |
70 |
|
71 // ---------------------------------------------------------------------------- |
|
72 // CAiNotifierRenderer::ConstructL() |
|
73 // |
|
74 // ---------------------------------------------------------------------------- |
|
75 // |
55 void CAiNotifierRenderer::ConstructL() |
76 void CAiNotifierRenderer::ConstructL() |
56 { |
77 { |
57 iSoftNotifier = CAknSoftNotifier::NewL(); |
78 iSoftNotifier = CAknSoftNotifier::NewL(); |
58 iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); |
79 iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); |
59 } |
80 } |
60 |
81 |
61 void CAiNotifierRenderer::DoPublishL( MAiPropertyExtension& aPlugin, |
82 // ---------------------------------------------------------------------------- |
62 TInt aContent, |
83 // CAiNotifierRenderer::DoPublishL() |
63 TInt aResource, |
84 // |
64 TInt /*aIndex*/ ) |
85 // ---------------------------------------------------------------------------- |
|
86 // |
|
87 void CAiNotifierRenderer::DoPublishL( CHsContentPublisher& aPlugin, |
|
88 TInt aContent, TInt aResource, TInt /*aIndex*/ ) |
65 { |
89 { |
66 if( aPlugin.PublisherInfoL()->iUid == KDeviceStatusPluginUid ) |
90 const THsPublisherInfo& info( aPlugin.PublisherInfo() ); |
|
91 |
|
92 if( info.Uid() == KDeviceStatusPluginUid ) |
67 { |
93 { |
68 switch( aContent ) |
94 switch( aContent ) |
69 { |
95 { |
70 case EAiDeviceStatusContentNWStatus: |
96 case EAiDeviceStatusContentNWStatus: |
71 { |
97 { |
112 default: |
143 default: |
113 { |
144 { |
114 User::Leave( KErrNotFound ); |
145 User::Leave( KErrNotFound ); |
115 break; |
146 break; |
116 } |
147 } |
117 }; |
148 } |
118 |
|
119 } |
149 } |
120 |
150 |
121 |
151 // ---------------------------------------------------------------------------- |
|
152 // CAiNotifierRenderer::AddNotification() |
|
153 // |
|
154 // ---------------------------------------------------------------------------- |
|
155 // |
122 void CAiNotifierRenderer::AddNotification( TAknSoftNotificationType aType ) |
156 void CAiNotifierRenderer::AddNotification( TAknSoftNotificationType aType ) |
123 { |
157 { |
124 TRAP_IGNORE( iSoftNotifier->AddNotificationL( aType, 1 ); ); |
158 TRAP_IGNORE( iSoftNotifier->AddNotificationL( aType, 1 ) ); |
125 } |
159 } |
126 |
160 |
127 void CAiNotifierRenderer::RemoveNotification( TAknSoftNotificationType aType) |
161 // ---------------------------------------------------------------------------- |
|
162 // CAiNotifierRenderer::RemoveNotification() |
|
163 // |
|
164 // ---------------------------------------------------------------------------- |
|
165 // |
|
166 void CAiNotifierRenderer::RemoveNotification( TAknSoftNotificationType aType ) |
128 { |
167 { |
129 TRAP_IGNORE( iSoftNotifier->CancelSoftNotificationL( aType ); ); |
168 TRAP_IGNORE( iSoftNotifier->CancelSoftNotificationL( aType ); ); |
130 } |
169 } |
131 |
170 |
132 TInt CAiNotifierRenderer::NWLostDelayCallBack(TAny* aParam) |
171 // ---------------------------------------------------------------------------- |
|
172 // CAiNotifierRenderer::NWLostDelayCallBack() |
|
173 // |
|
174 // ---------------------------------------------------------------------------- |
|
175 // |
|
176 TInt CAiNotifierRenderer::NWLostDelayCallBack( TAny* aParam ) |
133 { |
177 { |
134 CAiNotifierRenderer* self = reinterpret_cast<CAiNotifierRenderer *> (aParam); |
178 CAiNotifierRenderer* self = |
135 if ( self ) |
179 reinterpret_cast< CAiNotifierRenderer* >( aParam ); |
|
180 |
|
181 if ( self ) |
136 { |
182 { |
137 self->iTimer->Cancel(); |
183 self->iTimer->Cancel(); |
138 self->AddNotification( ESelectNetworkNotification ); |
184 self->AddNotification( ESelectNetworkNotification ); |
139 } |
185 } |
|
186 |
140 return KErrNone; |
187 return KErrNone; |
141 } |
188 } |
142 |
189 |
|
190 // End of file |
143 |
191 |