author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:55:16 +0300 | |
branch | RCL_3 |
changeset 118 | 8baec10861af |
parent 114 | a5a39a295112 |
child 130 | 67f2ed48ad91 |
permissions | -rw-r--r-- |
114 | 1 |
/* |
2 |
* Copyright (c) 2005-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: Micro Cellular Network (MCN) publisher. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#include <aicontentobserver.h> |
|
19 |
#include "aimcnpublisher.h" |
|
20 |
#include "ainetworkinfolistener.h" |
|
21 |
||
22 |
||
23 |
// ======== MEMBER FUNCTIONS ======== |
|
24 |
||
25 |
CAiMCNPublisher::CAiMCNPublisher() |
|
26 |
{ |
|
27 |
} |
|
28 |
||
29 |
||
30 |
void CAiMCNPublisher::ConstructL() |
|
31 |
{ |
|
32 |
iListener = CAiNetworkInfoListener::InstanceL(); |
|
33 |
} |
|
34 |
||
35 |
||
36 |
CAiMCNPublisher* CAiMCNPublisher::NewL() |
|
37 |
{ |
|
38 |
CAiMCNPublisher* self = new( ELeave ) CAiMCNPublisher; |
|
39 |
CleanupStack::PushL( self ); |
|
40 |
self->ConstructL(); |
|
41 |
CleanupStack::Pop( self ); |
|
42 |
return self; |
|
43 |
} |
|
44 |
||
45 |
||
46 |
CAiMCNPublisher::~CAiMCNPublisher() |
|
47 |
{ |
|
48 |
if( iListener ) |
|
49 |
{ |
|
50 |
iListener->RemoveObserver( *this ); |
|
51 |
iListener->Release(); |
|
52 |
} |
|
53 |
} |
|
54 |
||
55 |
||
56 |
void CAiMCNPublisher::ResumeL() |
|
57 |
{ |
|
58 |
iListener->AddObserverL( *this ); |
|
59 |
} |
|
60 |
||
61 |
||
62 |
void CAiMCNPublisher::Subscribe( MAiContentObserver& aObserver, |
|
63 |
CHsContentPublisher& aExtension, |
|
64 |
MAiPublishPrioritizer& /*aPrioritizer*/, |
|
65 |
MAiPublisherBroadcaster& /*aBroadcaster*/ ) |
|
66 |
{ |
|
67 |
iContentObserver = &aObserver; |
|
68 |
iExtension = &aExtension; |
|
69 |
} |
|
70 |
||
71 |
||
72 |
void CAiMCNPublisher::RefreshL( TBool /*aClean*/ ) |
|
73 |
{ |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
74 |
iContentObserver->Publish( *iExtension, |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
75 |
EAiDeviceStatusContentMCNIndicator, |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
76 |
iMCNName, |
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
77 |
0 ); |
114 | 78 |
} |
79 |
||
80 |
||
81 |
void CAiMCNPublisher::HandleNetworkInfoChange( |
|
82 |
const MNWMessageObserver::TNWMessages& aMessage, |
|
83 |
const TNWInfo& aInfo, |
|
84 |
const TBool /*aShowOpInd*/ ) |
|
85 |
{ |
|
86 |
//If MSN message was received, publish it. |
|
87 |
if ( aMessage == MNWMessageObserver::ENWMessageCurrentCellInfoMessage ) |
|
88 |
{ |
|
89 |
if ( aInfo.iMCNIndicatorType == ENWMCNIndicatorTypeActive ) |
|
90 |
{ |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
91 |
iMCNName.Copy( aInfo.iMCNName ); |
114 | 92 |
iContentObserver->Publish( *iExtension, |
93 |
EAiDeviceStatusContentMCNIndicator, |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
94 |
iMCNName, |
114 | 95 |
0 ); |
96 |
} |
|
97 |
else if ( aInfo.iMCNIndicatorType == ENWMCNIndicatorTypeNone ) |
|
98 |
{ |
|
118
8baec10861af
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
114
diff
changeset
|
99 |
iMCNName.Copy( KNullDesC ); |
114 | 100 |
iContentObserver->Clean( *iExtension, |
101 |
EAiDeviceStatusContentMCNIndicator, |
|
102 |
0 ); |
|
103 |
} |
|
104 |
} |
|
105 |
} |
|
106 |
||
107 |
||
108 |
TBool CAiMCNPublisher::RefreshL( TInt aContentId, TBool aClean ) |
|
109 |
{ |
|
110 |
if( aContentId == EAiDeviceStatusContentMCNIndicator ) |
|
111 |
{ |
|
112 |
RefreshL( aClean ); |
|
113 |
return ETrue; |
|
114 |
} |
|
115 |
||
116 |
return EFalse; |
|
117 |
} |