|
1 /* |
|
2 * Copyright (c) 2002-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: Skin change handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "AknsSkinChangeHandler.h" |
|
21 #include <AknsSrvClient.h> |
|
22 #include "AknsSrvClientMemberData.h" |
|
23 |
|
24 // ============================ MEMBER FUNCTIONS =============================== |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // CAknsSkinChangeHandler::CAknsSkinChangeHandler |
|
28 // C++ constructor can NOT contain any code, that might leave. |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 CAknsSkinChangeHandler::CAknsSkinChangeHandler( |
|
32 RAknsSrvSession& aSession, TInt aPriority ) |
|
33 : CActive( aPriority ), iSession( aSession ) |
|
34 { |
|
35 } |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // Destructor. |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 CAknsSkinChangeHandler::~CAknsSkinChangeHandler() |
|
42 { |
|
43 if ( iDestroyedPtr ) |
|
44 { |
|
45 *iDestroyedPtr = ETrue; |
|
46 iDestroyedPtr = NULL; |
|
47 } |
|
48 } |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CAknsSkinChangeHandler::HandleSkinChange |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 void CAknsSkinChangeHandler::HandleSkinChange( |
|
55 const TAknsSkinChangeHandlerNotification aType ) |
|
56 { |
|
57 MAknsSkinChangeObserver* observer = iSession.iMemberData->iObserver; |
|
58 switch( aType ) |
|
59 { |
|
60 case EAknsSCHNContentChanged: |
|
61 observer->SkinContentChanged(); |
|
62 // Mark the notification acknowledged |
|
63 iSession.AcknowledgeSkinChangeNotification(); |
|
64 break; |
|
65 case EAknsSCHNPackageListUpdate: |
|
66 observer->SkinPackageChanged( |
|
67 EAknsSkinStatusPackageListUpdate ); |
|
68 break; |
|
69 case EAknsSCHNConfigurationMerged: |
|
70 observer->SkinConfigurationChanged( |
|
71 EAknsSkinStatusConfigurationMerged ); |
|
72 break; |
|
73 case EAknsSCHNConfigurationDeployed: |
|
74 observer->SkinConfigurationChanged( |
|
75 EAknsSkinStatusConfigurationDeployed ); |
|
76 break; |
|
77 case EAknsSCHNConfigurationOOM: |
|
78 observer->SkinConfigurationChanged( |
|
79 EAknsSkinStatusConfigurationFailedOOM ); |
|
80 break; |
|
81 case EAknsSCHNConfigurationCorrupt: |
|
82 observer->SkinConfigurationChanged( |
|
83 EAknsSkinStatusConfigurationFailedCorrupt ); |
|
84 break; |
|
85 case EAknsSCHNMorphingStateChange: |
|
86 observer->SkinConfigurationChanged( |
|
87 EAknsSkinStatusMorphingStateChange ); |
|
88 break; |
|
89 case EAknsSCHNSSWallpaperChanged: |
|
90 observer->SkinConfigurationChanged( |
|
91 EAknsSkinStatusSlideSetWallpaperChanged ); |
|
92 break; |
|
93 case EAknsSCHNWallpaperChanged: //-fallthrough |
|
94 observer->SkinConfigurationChanged( |
|
95 EAknsSkinStatusWallpaperChanged ); |
|
96 case EAknsSCHNFlushClientSideCaches: |
|
97 observer->FlushLocalCaches(); |
|
98 break; |
|
99 case EAknsSCHNAnimBackgroundChanged: |
|
100 observer->SkinConfigurationChanged( |
|
101 EAknsSkinStatusAnimBackgroundChanged ); |
|
102 break; |
|
103 default: |
|
104 break; |
|
105 } |
|
106 } |
|
107 |
|
108 // ----------------------------------------------------------------------------- |
|
109 // CAknsSkinChangeHandler::SetActive |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 void CAknsSkinChangeHandler::SetActive() |
|
113 { |
|
114 iStatus = KRequestPending; |
|
115 CActive::SetActive(); |
|
116 } |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // CAknsSkinChangeHandler::RunL |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 void CAknsSkinChangeHandler::RunL() |
|
123 { |
|
124 TBool destroyed( EFalse ); |
|
125 iDestroyedPtr = &destroyed; |
|
126 |
|
127 if( iStatus >= 0 ) |
|
128 { |
|
129 HandleSkinChange( |
|
130 static_cast<TAknsSkinChangeHandlerNotification>( |
|
131 iStatus.Int() ) ); |
|
132 } |
|
133 |
|
134 if( !destroyed ) // Destructor sets this to ETrue |
|
135 { |
|
136 // Activate again |
|
137 SetActive(); |
|
138 iSession.EventHandled(); |
|
139 iDestroyedPtr = NULL; |
|
140 } |
|
141 } |
|
142 |
|
143 // ----------------------------------------------------------------------------- |
|
144 // CAknsSkinChangeHandler::DoCancel |
|
145 // ----------------------------------------------------------------------------- |
|
146 // |
|
147 void CAknsSkinChangeHandler::DoCancel() |
|
148 { |
|
149 iSession.SendCancel(); |
|
150 } |
|
151 |
|
152 // End of File |