author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:32:31 +0100 | |
branch | RCL_3 |
changeset 66 | bd7edf625bdd |
parent 65 | 12af337248b1 |
child 74 | 97232defd20e |
permissions | -rw-r--r-- |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Handles loading of Calendar customisation plugins |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
66 | 19 |
#include <eikmenup.h> |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
#include <ecom/ecom.h> |
66 | 21 |
#include <Calendar.rsg> |
22 |
#include <aknsettingitemlist.h> // CAknSettingItem |
|
23 |
#include <calencommandhandler.h> |
|
24 |
#include <calencustomisation.h> |
|
25 |
#include <calenservices.h> |
|
26 |
#include <mcalenpreview.h> |
|
27 |
||
28 |
#include "calensend.h" |
|
29 |
#include "calenviewinfo.h" |
|
30 |
#include "calendarui_debug.h" |
|
31 |
#include "calencustomisationmanager.h" |
|
32 |
#include "calencontroller.h" |
|
33 |
#include "calensetting.h" |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
34 |
#include "CalenUid.h" |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
// CCalenCustomisationManager::NewL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
// Two phased constructor |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
// |
66 | 43 |
EXPORT_C CCalenCustomisationManager* CCalenCustomisationManager::NewL( |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
MCalenServicesFactory& aFactory, |
66 | 45 |
CCalenPluginStatusArray& aPluginSettingsStatus, |
46 |
MCalenServices& aServices, |
|
47 |
RPointerArray<CCalenViewInfo>& aViewArray ) |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
{ |
66 | 49 |
TRACE_ENTRY_POINT; |
50 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
CCalenCustomisationManager* self = new( ELeave ) CCalenCustomisationManager( |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
aFactory, |
66 | 53 |
aServices, |
54 |
aViewArray, |
|
55 |
aPluginSettingsStatus ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
CleanupStack::PushL( self ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
self->ConstructL(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
CleanupStack::Pop( self ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
|
66 | 60 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
return self; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
// CCalenCustomisationManager::CCalenCustomisationManager |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
// C++ constructor |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
CCalenCustomisationManager::CCalenCustomisationManager( MCalenServicesFactory& aFactory, |
66 | 71 |
MCalenServices& aServices, |
72 |
RPointerArray<CCalenViewInfo>& aViewArray, |
|
73 |
CCalenPluginStatusArray& aPluginSettingsStatus ) |
|
74 |
: iServicesFactory( aFactory ), |
|
75 |
iViewInfoArray( aViewArray ), |
|
76 |
iSortOrder( CCalenViewInfo::CyclePositionComparison ), |
|
77 |
iServices( aServices ), |
|
78 |
iPluginSettingsStatus( aPluginSettingsStatus ) |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
{ |
66 | 80 |
TRACE_ENTRY_POINT; |
81 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
// CCalenCustomisationManager::ConstructL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
// Second stage constructor |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
void CCalenCustomisationManager::ConstructL() |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
{ |
66 | 92 |
TRACE_ENTRY_POINT; |
93 |
iInfoBarProviderUid = TUid::Uid(0); |
|
94 |
iPreviewPaneProviderUid = TUid::Uid(0); |
|
95 |
||
96 |
// Get a pointer to the global data and controller |
|
97 |
iGlobalData = CCalenGlobalData::InstanceL(); |
|
98 |
||
99 |
// Get the setting singleton. We update it when settings change. |
|
100 |
iSetting = CCalenSetting::InstanceL(); |
|
101 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
CreateActivePluginListL(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
// Load any enabled plugins |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
DoImmediatePluginLoadingL(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
|
66 | 107 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
108 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
// CCalenCustomisationManager::~CCalenCustomisationManager |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
// Destructor |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
// |
66 | 116 |
EXPORT_C CCalenCustomisationManager::~CCalenCustomisationManager() |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
{ |
66 | 118 |
TRACE_ENTRY_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
// Reset and destroy the contents of the owned arrays, |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
// this will delete the plugins. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
iPlugins.ResetAndDestroy(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
iPluginInfo.ResetAndDestroy(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
iActivePlugins.Reset(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
iRomBasedPlugins.Reset(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
|
66 | 129 |
// reset deferred unload plugins list |
130 |
iDefferedUnloadPluginList.Reset(); |
|
131 |
||
132 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
133 |
// Close the ECOM interface |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
REComSession::FinalClose(); |
66 | 135 |
|
136 |
// Release the global data and controller |
|
137 |
if ( iGlobalData ) |
|
138 |
{ |
|
139 |
iGlobalData->Release(); |
|
140 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
141 |
|
66 | 142 |
if(iSetting) |
143 |
{ |
|
144 |
iSetting->Release(); |
|
145 |
} |
|
146 |
iHiddenViews.Reset(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
147 |
|
66 | 148 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
} |
66 | 150 |
|
151 |
// ---------------------------------------------------------------------------- |
|
152 |
// CCalenCustomisationManager::GetCommandHandlerL |
|
153 |
// Get a command handler for a specific command. Ownership remains with the |
|
154 |
// plugin |
|
155 |
// ---------------------------------------------------------------------------- |
|
156 |
EXPORT_C MCalenCommandHandler* CCalenCustomisationManager::GetCommandHandlerL( TInt aCommand ) |
|
157 |
{ |
|
158 |
TRACE_ENTRY_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
|
66 | 160 |
MCalenCommandHandler* handler( NULL ); |
161 |
||
162 |
// Loop though all the enabled plugins asking for a command handler |
|
163 |
// to handle this command with. Returns NULL if no plugin wants to |
|
164 |
// handle the command. |
|
165 |
||
166 |
TInt count = iPlugins.Count(); |
|
167 |
for ( TInt index = 0; index < count && !handler; ++index ) |
|
168 |
{ |
|
169 |
TRAPD( error, |
|
170 |
// Loop though until a command handler is found |
|
171 |
for (; index < count && !handler; ++index ) |
|
172 |
{ |
|
173 |
if ( !iPlugins[index]->IsDisabled() ) |
|
174 |
{ |
|
175 |
handler = iPlugins[index]->Plugin().CommandHandlerL( aCommand ); |
|
176 |
} |
|
177 |
} |
|
178 |
); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
|
66 | 180 |
if ( error ) |
181 |
{ |
|
182 |
// Report a problem with plugin. |
|
183 |
} |
|
184 |
} |
|
185 |
||
186 |
TRACE_EXIT_POINT; |
|
187 |
return handler; |
|
188 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
189 |
|
66 | 190 |
// ---------------------------------------------------------------------------- |
191 |
// CCalenCustomisationManager::GetPluginSettingsL |
|
192 |
// Gets custom settings from the specified plugin |
|
193 |
// ---------------------------------------------------------------------------- |
|
194 |
// |
|
195 |
EXPORT_C void CCalenCustomisationManager::GetPluginSettingsL( TUid aPluginUid, |
|
196 |
RPointerArray<CAknSettingItem>& aSettingArray ) |
|
197 |
{ |
|
198 |
TRACE_ENTRY_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
|
66 | 200 |
CCalenCustomisation* plugin = FindPluginL( aPluginUid ); |
201 |
User::LeaveIfNull( plugin ); |
|
202 |
||
203 |
TRAPD( error, plugin->GetCustomSettingsL( aSettingArray )); |
|
204 |
if ( error ) |
|
205 |
{ |
|
206 |
// Report a problem with plugin. |
|
207 |
} |
|
208 |
||
209 |
TRACE_EXIT_POINT; |
|
210 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
213 |
// CCalenCustomisationManager::ActivePlugins |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
// Returns a reference to an array of active plugins uids |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
// |
66 | 217 |
EXPORT_C const RArray<TUid>& CCalenCustomisationManager::ActivePlugins() const |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
{ |
66 | 219 |
TRACE_ENTRY_POINT; |
220 |
TRACE_EXIT_POINT; |
|
221 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
return iActivePlugins; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
223 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
226 |
// CCalenCustomisationManager::CreateActivePluginListL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
227 |
// Generates the list of active plugins |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
void CCalenCustomisationManager::CreateActivePluginListL() |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
{ |
66 | 232 |
TRACE_ENTRY_POINT; |
233 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
234 |
iPluginInfo.ResetAndDestroy(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
iActivePlugins.Reset(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
iRomBasedPlugins.Reset(); |
66 | 237 |
|
238 |
//Added resolver for corolla release |
|
239 |
// Set resolver params |
|
240 |
/*TLanguage lang = User::Language(); |
|
241 |
TBuf8<40> langStr; |
|
242 |
langStr.Format( _L8("language(%d)"), lang ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
243 |
|
66 | 244 |
TEComResolverParams resolverParams; |
245 |
resolverParams.SetDataType( langStr ); |
|
246 |
resolverParams.SetGenericMatch( ETrue );*/ |
|
247 |
||
248 |
REComSession::ListImplementationsL( KCalenCustomisationInterfaceUid,/* resolverParams,*/ iPluginInfo ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
249 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
LoadPluginsBasedOnVariantL(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
TInt pluginCount = iPluginInfo.Count(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
253 |
|
66 | 254 |
for ( TInt pluginIndex(0); pluginIndex < pluginCount; ++pluginIndex ) |
255 |
{ |
|
256 |
TUid pluginUid = iPluginInfo[pluginIndex]->ImplementationUid(); |
|
257 |
||
258 |
// Find the plugin in the list of known plugins |
|
259 |
TInt position = iPluginSettingsStatus.Find( pluginUid, PluginAvailabilityFinder ); |
|
260 |
if ( ( position == KErrNotFound ) || ( iPluginSettingsStatus[position].iEnabled ) ) |
|
261 |
{ |
|
262 |
// If the plugin can not be found or if it is enabled |
|
263 |
// add it to the list of active plugins |
|
264 |
iActivePlugins.AppendL( pluginUid ); |
|
265 |
||
266 |
// If the plugin is rom-based, store its uid |
|
267 |
if ( iPluginInfo[pluginIndex]->RomBased() ) |
|
268 |
{ |
|
269 |
iRomBasedPlugins.AppendL( pluginUid ); |
|
270 |
} |
|
271 |
} |
|
272 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
273 |
|
66 | 274 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
// ---------------------------------------------------------------------------- |
66 | 278 |
// CCalenCustomisationManager::GetCustomViewsL |
279 |
// GetCustomViews returns custom views info in an array for a given |
|
280 |
// plugin. |
|
281 |
// NOTE: The contents of the array are owned by the caller - caller |
|
282 |
// must guarantee to call ResetAndDestroy on the array in all cases. |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
283 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
284 |
// |
66 | 285 |
EXPORT_C void CCalenCustomisationManager::GetCustomViewsL( TUid aPluginUid, |
286 |
RPointerArray<CCalenView>& aViews ) |
|
287 |
{ |
|
288 |
TRACE_ENTRY_POINT; |
|
289 |
||
290 |
CCalenCustomisation* plugin = FindPluginL( aPluginUid ); |
|
291 |
User::LeaveIfNull( plugin ); |
|
292 |
||
293 |
TRAPD( error, plugin->GetCustomViewsL( aViews )); |
|
294 |
if ( error ) |
|
295 |
{ |
|
296 |
// Report a problem with plugin. |
|
297 |
} |
|
298 |
||
299 |
TInt numViews = aViews.Count(); |
|
300 |
for ( TInt index( 0 ); index < numViews; ++index ) |
|
301 |
{ |
|
302 |
CCalenView* customView = aViews[index]; |
|
303 |
||
304 |
// Add to view info array |
|
305 |
const TUid viewId = customView->Id(); |
|
306 |
||
307 |
// Check for duplicate view ids. |
|
308 |
TInt position = iViewInfoArray.Find( viewId , |
|
309 |
CCalenViewInfo::ViewInfoIdentifier ); |
|
310 |
||
311 |
if ( position == KErrNotFound ) |
|
312 |
{ |
|
313 |
const TDesC& menuName = customView->LocalisedViewNameL( CCalenView::EMenuName ); |
|
314 |
const TDesC& settingsName = customView->LocalisedViewNameL( CCalenView::ESettingsName ); |
|
315 |
const CCalenView::TCyclePosition cyclePos = customView->CyclePosition(); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
316 |
|
66 | 317 |
CCalenViewInfo* viewInfo = CCalenViewInfo::NewL( viewId, |
318 |
aPluginUid, |
|
319 |
menuName, |
|
320 |
settingsName, |
|
321 |
cyclePos ); |
|
322 |
||
323 |
// Check if the view has already been hidden. |
|
324 |
TBool hidden = ( iHiddenViews.Find( viewId.iUid ) != KErrNotFound ); |
|
325 |
viewInfo->Hide( hidden ); |
|
326 |
||
327 |
ViewInfoArray().InsertInOrderAllowRepeatsL( viewInfo, iSortOrder ); |
|
328 |
} |
|
329 |
else |
|
330 |
{ |
|
331 |
// A plugin with the same id already exists. ( It could be a replacement |
|
332 |
// view provided by a rom plugin, as currently preventing rom plugins from |
|
333 |
// being disabled if required is not implemented, it needs to be handled) |
|
334 |
delete customView; |
|
335 |
aViews.Remove( index ); |
|
336 |
index--; |
|
337 |
numViews--; |
|
338 |
||
339 |
// Report a problem with plugin. |
|
340 |
} |
|
341 |
} |
|
342 |
RArray<TInt> hiddenViews; |
|
343 |
CleanupClosePushL( hiddenViews ); |
|
344 |
plugin->RemoveViewsFromCycle( hiddenViews ); |
|
345 |
TInt hiddenViewCount = hiddenViews.Count(); |
|
346 |
if ( hiddenViewCount ) |
|
347 |
{ |
|
348 |
// Get the default view form the settings to check if it is going to be hidden |
|
349 |
// by the installed plugin |
|
350 |
TUid defaultView = iSetting->DefaultView(); |
|
351 |
for ( TInt index(0); index < hiddenViewCount; ++index ) |
|
352 |
{ |
|
353 |
TInt hiddenViewId = hiddenViews[index]; |
|
354 |
// iHiddenViews.InsertInOrderAllowRepeatsL( hiddenViewId ); |
|
355 |
||
356 |
// If this view is already on the view cycle list it needs |
|
357 |
// to be hidden. |
|
358 |
TUid hiddenViewUid = TUid::Uid( hiddenViewId ); |
|
359 |
||
360 |
// If the current default view is hidden, then set the newly |
|
361 |
// installed plugin view as default view |
|
362 |
if(defaultView == hiddenViewUid) |
|
363 |
{ |
|
364 |
TInt position = iViewInfoArray.Find( aPluginUid, |
|
365 |
CCalenViewInfo::ViewPluginIdentifier ); |
|
366 |
if(position != -1) |
|
367 |
{ |
|
368 |
for(TInt i = position; i < iViewInfoArray.Count(); i++) |
|
369 |
{ |
|
370 |
if((iViewInfoArray[i]->PluginUid() == aPluginUid) && |
|
371 |
(iViewInfoArray[i]->CyclePosition() != CCalenView::ENoCyclePosition)) |
|
372 |
{ |
|
373 |
iSetting->SetDefaultView(iViewInfoArray[i]->ViewUid()); |
|
374 |
break; |
|
375 |
} |
|
376 |
} |
|
377 |
} |
|
378 |
} |
|
379 |
} |
|
380 |
} |
|
381 |
CleanupStack::PopAndDestroy(); // removedViews |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
382 |
|
66 | 383 |
TRACE_EXIT_POINT; |
384 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
385 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
386 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
387 |
// CCalenCustomisationManager::SetPluginAvailabilityL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
388 |
// Enables or disables the given plugin. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
389 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
390 |
// |
66 | 391 |
EXPORT_C void CCalenCustomisationManager::SetPluginAvailabilityL( TUid aPluginUid, |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
392 |
TBool aEnabled ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
393 |
{ |
66 | 394 |
TRACE_ENTRY_POINT; |
395 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
396 |
if ( aEnabled ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
397 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
398 |
EnablePluginL( aPluginUid ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
399 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
400 |
else |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
401 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
402 |
DisablePluginL( aPluginUid ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
403 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
|
66 | 405 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
406 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
407 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
409 |
// CCalenCustomisationManager::DisablePluginL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
410 |
// Disables the given plugin. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
411 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
412 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
413 |
void CCalenCustomisationManager::DisablePluginL( TUid aPluginUid ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
414 |
{ |
66 | 415 |
TRACE_ENTRY_POINT; |
416 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
417 |
// Find the plugins |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
418 |
TInt index = iPlugins.Find( aPluginUid, CPluginInfo::Identifier ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
419 |
if ( index != KErrNotFound ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
420 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
421 |
CPluginInfo* pluginInfo = iPlugins[index]; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
422 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
423 |
// Check if the plugin has not already been disabled |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
424 |
if ( !( pluginInfo->IsDisabled() ) ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
425 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
426 |
// Mark the plugin as being disabled |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
427 |
pluginInfo->Disable( ETrue ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
428 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
429 |
// Remove the plugin from the active plugin list |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
430 |
TInt position = iActivePlugins.Find( aPluginUid ); |
66 | 431 |
if(position == KErrNotFound ) // plugin has already been removed |
432 |
{ |
|
433 |
return ; |
|
434 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
435 |
|
66 | 436 |
iActivePlugins.Remove( position ); |
437 |
||
438 |
// Does this plugin hide any views |
|
439 |
RArray<TInt> removedViews; |
|
440 |
CleanupClosePushL( removedViews ); |
|
441 |
CCalenCustomisation& plugin = pluginInfo->Plugin(); |
|
442 |
plugin.RemoveViewsFromCycle( removedViews ); |
|
443 |
TInt hiddenViewsCount = removedViews.Count(); |
|
444 |
if ( hiddenViewsCount ) |
|
445 |
{ |
|
446 |
// Need to recalculate which views have been hidden, as |
|
447 |
// more than one plugin might have hidden the same view. |
|
448 |
for ( TInt index( 0 ); index < hiddenViewsCount; ++index ) |
|
449 |
{ |
|
450 |
TUid viewUid = TUid::Uid( removedViews[index] ); |
|
451 |
CheckHiddenViewL( viewUid, aPluginUid ); |
|
452 |
} |
|
453 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
454 |
|
66 | 455 |
// If the plugin does not offer any views, or the current |
456 |
// info or preview bar it can be deleted immediately, |
|
457 |
// otherwise the customisation needs to wait until it |
|
458 |
// is told it is safe to do so. |
|
459 |
||
460 |
// Does this plugin does not offer any views and the plugin |
|
461 |
// doesn't offer the current infobar or preview pane |
|
462 |
// bar it can be deleted immediately |
|
463 |
TInt offerViews = iViewInfoArray.Find( aPluginUid, |
|
464 |
CCalenViewInfo::ViewPluginIdentifier ); |
|
465 |
||
466 |
if ( offerViews == KErrNotFound && |
|
467 |
iInfoBarProviderUid != aPluginUid |
|
468 |
&& iPreviewPaneProviderUid != aPluginUid ) |
|
469 |
{ |
|
470 |
RArray<TUid> pluginArray; |
|
471 |
CleanupClosePushL( pluginArray ); |
|
472 |
pluginArray.AppendL( aPluginUid ); |
|
473 |
UnloadPluginsL( pluginArray ); |
|
474 |
CleanupStack::PopAndDestroy(); // pluginArray |
|
475 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
476 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
477 |
// Issue notification of plugin been disabled |
66 | 478 |
iPluginsEnabledDisabled = ETrue; |
479 |
iServices.IssueNotificationL( ECalenNotifyPluginEnabledDisabled ); |
|
480 |
CleanupStack::PopAndDestroy(); // removedViews |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
481 |
} |
66 | 482 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
483 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
484 |
|
66 | 485 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
486 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
487 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
488 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
489 |
// CCalenCustomisationManager::UnloadPluginsL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
490 |
// When a plugin is disabled it can not be unloaded until |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
491 |
// any views etc it has provided have been deleted. This function |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
492 |
// is called when it is safe to unload the plugin. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
493 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
494 |
// |
66 | 495 |
EXPORT_C void CCalenCustomisationManager::UnloadPluginsL( const RArray<TUid>& aPlugins ) |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
496 |
{ |
66 | 497 |
TRACE_ENTRY_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
498 |
// Check plugin isn't already enabled |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
499 |
TInt count = aPlugins.Count(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
500 |
for (TInt index = 0; index < count; ++index ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
501 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
502 |
TInt position = iPlugins.Find( aPlugins[index], CPluginInfo::Identifier ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
503 |
if ( position != KErrNotFound ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
504 |
{ |
66 | 505 |
TUid pluginUid = iPlugins[ position]->Uid(); |
506 |
if(!iPluginInfo[position]->RomBased()) |
|
507 |
{ |
|
508 |
if((iInfoBarProviderUid != iPlugins[position]->Uid()) |
|
509 |
&& (iPreviewPaneProviderUid != iPlugins[ position]->Uid())) |
|
510 |
{ |
|
511 |
CPluginInfo* removedPlugin = iPlugins[ position ]; |
|
512 |
iPlugins.Remove( position ); |
|
513 |
delete removedPlugin; |
|
514 |
} |
|
515 |
else |
|
516 |
{ |
|
517 |
iPlugins[position]->Disable(ETrue); |
|
518 |
iDefferedUnloadPluginList.AppendL(iPlugins[position]->Uid()); |
|
519 |
iInfoBarProviderUid = KNullUid; |
|
520 |
iPreviewPaneProviderUid = KNullUid; |
|
521 |
} |
|
522 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
523 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
524 |
} |
66 | 525 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
526 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
527 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
528 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
529 |
// CCalenCustomisationManager::EnablePluginL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
530 |
// Enables the given plugin. Returns KErrNotFound if |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
531 |
// the plugin can't be found, KErrNone otherwise. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
532 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
533 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
534 |
void CCalenCustomisationManager::EnablePluginL( TUid aPluginUid ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
535 |
{ |
66 | 536 |
TRACE_ENTRY_POINT; |
537 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
538 |
// Check plugin isn't already enabled |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
539 |
TInt index = iPlugins.Find( aPluginUid, CPluginInfo::Identifier); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
540 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
541 |
if ( index == KErrNotFound ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
542 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
543 |
// Load plugin |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
544 |
TRAPD( error, LoadPluginL( aPluginUid ) ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
545 |
if ( error ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
546 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
547 |
// report a problem loading the plugin |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
548 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
549 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
550 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
551 |
iActivePlugins.AppendL( aPluginUid ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
552 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
553 |
// Issue notification of plugin been added |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
554 |
iPluginsEnabledDisabled = ETrue; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
555 |
iServices.IssueNotificationL( ECalenNotifyPluginEnabledDisabled ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
556 |
} |
66 | 557 |
else |
558 |
{ |
|
559 |
// Ensure plugin is enabled |
|
560 |
if(iPlugins[index]->IsDisabled()) |
|
561 |
{ |
|
562 |
iPlugins[index]->Disable( EFalse ); |
|
563 |
iServices.IssueNotificationL( ECalenNotifyPluginEnabledDisabled ); |
|
564 |
} |
|
565 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
566 |
|
66 | 567 |
TRACE_EXIT_POINT; |
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
568 |
} |
66 | 569 |
|
570 |
||
571 |
// ---------------------------------------------------------------------------- |
|
572 |
// CCalenCustomisationManager::LoadPluginsBasedOnVariant |
|
573 |
// From MCalenNotificationHandler. Handles notifications. |
|
574 |
// (other items were commented in a header). |
|
575 |
// ---------------------------------------------------------------------------- |
|
576 |
// |
|
577 |
void CCalenCustomisationManager::LoadPluginsBasedOnVariantL() |
|
578 |
{ |
|
579 |
TRACE_ENTRY_POINT |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
580 |
|
66 | 581 |
TLanguage lang = User::Language(); |
582 |
||
583 |
// Based on the variant the plugins will be loaded |
|
584 |
// Eg. for 01 Euro regional plugins are not needed so all regional plugins will be removed |
|
585 |
// other than non regional plugins. |
|
586 |
// for Chinese variant Thai and vietnamese plugins will be removed |
|
587 |
// leaving chinese plugin and other non regional plugins. |
|
588 |
RArray<TUid> needsToBeRemoved; |
|
589 |
||
590 |
switch(lang) |
|
591 |
{ |
|
592 |
case ELangThai: |
|
593 |
case ELangEnglish_Thailand: |
|
594 |
needsToBeRemoved.Append(KCalenChineseImplUid); |
|
595 |
needsToBeRemoved.Append(KCalenVietnameseImplUid); |
|
596 |
break; |
|
597 |
case ELangTaiwanChinese: |
|
598 |
case ELangHongKongChinese: |
|
599 |
case ELangPrcChinese: |
|
600 |
needsToBeRemoved.Append(KCalenThaiImplUid); |
|
601 |
needsToBeRemoved.Append(KCalenVietnameseImplUid); |
|
602 |
break; |
|
603 |
case ELangVietnamese: |
|
604 |
needsToBeRemoved.Append(KCalenThaiImplUid); |
|
605 |
needsToBeRemoved.Append(KCalenChineseImplUid); |
|
606 |
break; |
|
607 |
default: |
|
608 |
needsToBeRemoved.Append(KCalenThaiImplUid); |
|
609 |
needsToBeRemoved.Append(KCalenChineseImplUid); |
|
610 |
needsToBeRemoved.Append(KCalenVietnameseImplUid); |
|
611 |
break; |
|
612 |
} |
|
613 |
||
614 |
if(needsToBeRemoved.Count()) |
|
615 |
{ |
|
616 |
for(TInt i = 0 ; i < needsToBeRemoved.Count() ; i++) |
|
617 |
{ |
|
618 |
TInt index = iPluginInfo.Find(needsToBeRemoved[i],CCalenCustomisationManager::PluginInfoFinder); |
|
619 |
if( index != KErrNotFound ) |
|
620 |
{ |
|
621 |
CImplementationInformation* impl = iPluginInfo[index]; |
|
622 |
iPluginInfo.Remove(index); |
|
623 |
delete impl; |
|
624 |
} |
|
625 |
} |
|
626 |
} |
|
627 |
||
628 |
needsToBeRemoved.Close(); |
|
629 |
||
630 |
TRACE_EXIT_POINT |
|
631 |
} |
|
632 |
||
633 |
// ---------------------------------------------------------------------------- |
|
634 |
// CCalenCustomisationManager::PluginInfoFinder( |
|
635 |
// Matches an uid in pluginInfo. |
|
636 |
// (other items were commented in a header). |
|
637 |
// ---------------------------------------------------------------------------- |
|
638 |
// |
|
639 |
TBool CCalenCustomisationManager::PluginInfoFinder( const TUid* aUid , const CImplementationInformation& aArrayItem) |
|
640 |
{ |
|
641 |
TRACE_ENTRY_POINT; |
|
642 |
TRACE_EXIT_POINT; |
|
643 |
return (*aUid == aArrayItem.ImplementationUid() ); |
|
644 |
} |
|
645 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
646 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
647 |
// CCalenCustomisationManager::HandleNotificationL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
648 |
// From MCalenNotificationHandler. Handles notifications. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
649 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
650 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
651 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
652 |
void CCalenCustomisationManager::HandleNotification(const TCalenNotification aNotification ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
653 |
{ |
66 | 654 |
TRACE_ENTRY_POINT; |
655 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
656 |
PIM_TRAPD_HANDLE( HandleNotificationL(aNotification) ); |
66 | 657 |
|
658 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
659 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
660 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
661 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
662 |
// CCalenCustomisationManager::HandleNotificationL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
663 |
// Handles notifications that the list of available plugins had been changed, |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
664 |
// either by GS or by the ecom registry. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
665 |
// When plugins are enabled or disabled inside the calendar application, this |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
666 |
// function will be called after the plugin enablement changes have already been |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
667 |
// made. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
668 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
669 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
670 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
671 |
void CCalenCustomisationManager::HandleNotificationL(TCalenNotification aNotification) |
66 | 672 |
{ |
673 |
TRACE_ENTRY_POINT; |
|
674 |
||
675 |
switch( aNotification ) |
|
676 |
{ |
|
677 |
case ECalenNotifyCheckPluginUnloading: |
|
678 |
{ |
|
679 |
if(iDefferedUnloadPluginList.Count() > 0) |
|
680 |
{ |
|
681 |
UnloadPluginsL(iDefferedUnloadPluginList); |
|
682 |
} |
|
683 |
} |
|
684 |
break; |
|
685 |
case ECalenNotifySettingsChanged: |
|
686 |
{ |
|
687 |
// Make sure that any plugins marked as enabled are enabled, and |
|
688 |
// any plugins marked as disabled are disabled. |
|
689 |
iPluginsEnabledDisabled = EFalse; |
|
690 |
TInt pluginCount = iPluginSettingsStatus.Count(); |
|
691 |
for ( TInt pluginIndex(0); pluginIndex < pluginCount; ++pluginIndex ) |
|
692 |
{ |
|
693 |
TUid pluginUid = iPluginSettingsStatus[pluginIndex].iUid; |
|
694 |
TBool enabled = iPluginSettingsStatus[pluginIndex].iEnabled; |
|
695 |
||
696 |
SetPluginAvailabilityL( pluginUid, enabled ); |
|
697 |
} |
|
698 |
||
699 |
if ( iPluginsEnabledDisabled ) |
|
700 |
{ |
|
701 |
iServices.IssueNotificationL( ECalenNotifySettingsChanged ); |
|
702 |
} |
|
703 |
} |
|
704 |
break; |
|
705 |
case ECalenNotifyEComRegistryChanged: |
|
706 |
{ |
|
707 |
CreateActivePluginListL(); |
|
708 |
iSetting->UpdatePluginListL(*this); |
|
709 |
DoImmediatePluginLoadingL(); |
|
710 |
iServices.IssueNotificationL(ECalenNotifyPluginEnabledDisabled); |
|
711 |
iServices.IssueNotificationL(ECalenNotifySettingsChanged ); |
|
712 |
} |
|
713 |
default: |
|
714 |
break; |
|
715 |
} |
|
716 |
||
717 |
TRACE_EXIT_POINT; |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
718 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
719 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
720 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
721 |
// CCalenCustomisationManager::PluginInfoArray |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
722 |
// Returns a const reference to the plugin information array. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
723 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
724 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
725 |
// |
66 | 726 |
EXPORT_C const RImplInfoPtrArray& CCalenCustomisationManager::PluginInfoArray() const |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
727 |
{ |
66 | 728 |
TRACE_ENTRY_POINT; |
729 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
730 |
return iPluginInfo; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
731 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
732 |
|
66 | 733 |
// ---------------------------------------------------------------------------- |
734 |
// CCalenCustomisationManager::Views |
|
735 |
// Returns a const reference to the views array. |
|
736 |
// (other items were commented in a header). |
|
737 |
// ---------------------------------------------------------------------------- |
|
738 |
// |
|
739 |
EXPORT_C const RPointerArray<CCalenViewInfo>& CCalenCustomisationManager::Views() const |
|
740 |
{ |
|
741 |
TRACE_ENTRY_POINT; |
|
742 |
TRACE_EXIT_POINT; |
|
743 |
return iViewInfoArray; |
|
744 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
745 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
746 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
747 |
// CCalenCustomisationManager::DoImmediatePluginLoadingL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
748 |
// Examines the properties of the plugin list and |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
749 |
// loads those that need to loaded on start-up |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
750 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
751 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
752 |
// |
60
96907930389d
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
753 |
void CCalenCustomisationManager::DoImmediatePluginLoadingL() |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
754 |
{ |
66 | 755 |
TRACE_ENTRY_POINT; |
756 |
||
757 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
758 |
for(TInt i = 0 ; i < iPlugins.Count() ; i++) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
759 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
760 |
RArray<TUid> pluginArray; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
761 |
CleanupClosePushL( pluginArray ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
762 |
pluginArray.AppendL( iPlugins[i]->Uid() ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
763 |
UnloadPluginsL( pluginArray ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
764 |
CleanupStack::PopAndDestroy(); // pluginArray |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
765 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
766 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
767 |
// Get the number plugins |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
768 |
TInt pluginCount = iPluginInfo.Count(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
769 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
770 |
for ( TInt index( 0 ); index < pluginCount; ++index ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
771 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
772 |
TUid pluginUid = iPluginInfo[index]->ImplementationUid(); |
66 | 773 |
|
774 |
if ( iActivePlugins.Find( pluginUid ) != KErrNotFound ) |
|
775 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
776 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
777 |
TRAPD( error, LoadPluginL( pluginUid ) ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
778 |
if ( error ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
779 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
780 |
// report a problem loading the plugin |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
781 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
782 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
783 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
784 |
} |
66 | 785 |
|
786 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
787 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
788 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
789 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
790 |
// CCalenCustomisationManager::LoadPluginL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
791 |
// Loads a plugin |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
792 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
793 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
794 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
795 |
void CCalenCustomisationManager::LoadPluginL( TUid aPluginUid ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
796 |
{ |
66 | 797 |
TRACE_ENTRY_POINT; |
798 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
799 |
// Get a new services object from global data |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
800 |
MCalenServices* services = iServicesFactory.NewServicesL(); |
66 | 801 |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
802 |
// Creates the plugin and transfers ownership of the services |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
803 |
// object to the plugin. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
804 |
CCalenCustomisation* plugin = |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
805 |
CCalenCustomisation::CreateImplementationL( aPluginUid, services ); |
66 | 806 |
|
807 |
CleanupStack::PushL( plugin ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
808 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
809 |
// the plugin array takes ownership of the plugin |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
810 |
AddPluginL( plugin, aPluginUid ); |
66 | 811 |
CleanupStack::Pop( plugin ); |
812 |
||
813 |
||
814 |
RArray<TInt> hiddenViews; |
|
815 |
CleanupClosePushL( hiddenViews ); |
|
816 |
plugin->RemoveViewsFromCycle( hiddenViews ); |
|
817 |
TInt hiddenViewCount = hiddenViews.Count(); |
|
818 |
if ( hiddenViewCount ) |
|
819 |
{ |
|
820 |
// Get the default view form the settings to check if it is going to be hidden |
|
821 |
// by the installed plugin |
|
822 |
TUid defaultView = iSetting->DefaultView(); |
|
823 |
for ( TInt index(0); index < hiddenViewCount; ++index ) |
|
824 |
{ |
|
825 |
TInt hiddenViewId = hiddenViews[index]; |
|
826 |
iHiddenViews.InsertInOrderAllowRepeatsL( hiddenViewId ); |
|
827 |
||
828 |
// If this view is already on the view cycle list it needs |
|
829 |
// to be hidden. |
|
830 |
TUid hiddenViewUid = TUid::Uid( hiddenViewId ); |
|
831 |
||
832 |
// If the current default view is hidden, then set the newly |
|
833 |
// installed plugin view as default view |
|
834 |
if(defaultView == hiddenViewUid) |
|
835 |
iSetting->SetDefaultView(aPluginUid); |
|
836 |
||
837 |
TInt position = iViewInfoArray.Find( hiddenViewUid, |
|
838 |
CCalenViewInfo::ViewInfoIdentifier ); |
|
839 |
||
840 |
if ( position != KErrNotFound ) |
|
841 |
{ |
|
842 |
CCalenViewInfo* viewInfo = iViewInfoArray[position]; |
|
843 |
viewInfo->Hide( ETrue ); |
|
844 |
||
845 |
// By hiding the view, the cycleposition order may be changed |
|
846 |
// so the view info array needs to be resorted. |
|
847 |
iViewInfoArray.Sort( iSortOrder ); |
|
848 |
} |
|
849 |
} |
|
850 |
} |
|
851 |
CleanupStack::PopAndDestroy(); // removedViews |
|
852 |
||
853 |
TRACE_EXIT_POINT; |
|
854 |
} |
|
855 |
||
856 |
// ---------------------------------------------------------------------------- |
|
857 |
// CCalenCustomisationManager::OfferMenuPaneL |
|
858 |
// Offers a menupane for customisation by plugins |
|
859 |
// and the controller. |
|
860 |
// (other items were commented in a header). |
|
861 |
// ---------------------------------------------------------------------------- |
|
862 |
// |
|
863 |
EXPORT_C void CCalenCustomisationManager::OfferMenuPaneL( TInt aResourceId, |
|
864 |
CEikMenuPane* aMenuPane ) |
|
865 |
{ |
|
866 |
TRACE_ENTRY_POINT; |
|
867 |
||
868 |
// Offer the menu to registered plugins |
|
869 |
OfferMenuPaneToPluginsL( aResourceId, aMenuPane ); |
|
870 |
||
871 |
// If the menupane is a main menu, a check needs to be made that the |
|
872 |
// exit and switch view commands exist |
|
873 |
||
874 |
// Replace the send menu if it exists |
|
875 |
TInt position( 0 ); |
|
876 |
if ( aMenuPane->MenuItemExists( ECalenSend, position) ) |
|
877 |
{ |
|
878 |
// Delete the existing send menu option |
|
879 |
aMenuPane->DeleteMenuItem(ECalenSend); |
|
880 |
||
881 |
// Insert the calensend menu item |
|
882 |
iGlobalData->CalenSendL().DisplaySendMenuItemL( *aMenuPane, position ); |
|
883 |
} |
|
884 |
||
885 |
// If the menu has a view switch menu item, it is up to the |
|
886 |
// customisation manager to decide if the menu should be |
|
887 |
// cascading or a selection list box. |
|
888 |
if ( aMenuPane->MenuItemExists( ECalenSwitchView, position) ) |
|
889 |
{ |
|
890 |
CEikMenuPaneItem::SData& switchItem = aMenuPane->ItemData( ECalenSwitchView ); |
|
891 |
if ( iActivePlugins.Count() == 0 ) |
|
892 |
{ |
|
893 |
// Create a cascading menu |
|
894 |
switchItem.iCascadeId = R_CALENDAR_CHANGE_VIEW_MENUPANE; |
|
895 |
} |
|
896 |
else |
|
897 |
{ |
|
898 |
switchItem.iCascadeId = 0; |
|
899 |
} |
|
900 |
} |
|
901 |
||
902 |
TRACE_EXIT_POINT; |
|
903 |
} |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
904 |
|
66 | 905 |
// ---------------------------------------------------------------------------- |
906 |
// CCalenCustomisationManager::CheckHiddenViewL( |
|
907 |
// A check needs to be made to see if any other plugins hide the same view. |
|
908 |
// ---------------------------------------------------------------------------- |
|
909 |
// |
|
910 |
void CCalenCustomisationManager::CheckHiddenViewL( TUid aViewUid, TUid aPluginUid ) |
|
911 |
{ |
|
912 |
TRACE_ENTRY_POINT; |
|
913 |
||
914 |
// Find the viewId in the hidden view list, and remove it |
|
915 |
TInt viewId = aViewUid.iUid; |
|
916 |
TInt position = iHiddenViews.Find( viewId ); |
|
917 |
if ( position != KErrNotFound ) |
|
918 |
{ |
|
919 |
iHiddenViews.Remove( position ); |
|
920 |
||
921 |
// Try to find the view again, in case it is hidden by another view |
|
922 |
position = iHiddenViews.Find( viewId ); |
|
923 |
if ( position == KErrNotFound ) |
|
924 |
{ |
|
925 |
// If it can't be found in the hidden view list, |
|
926 |
// it can be unhidden. |
|
927 |
TInt viewInfoPos = iViewInfoArray.Find( aViewUid , |
|
928 |
CCalenViewInfo::ViewInfoIdentifier ); |
|
929 |
||
930 |
if ( viewInfoPos != KErrNotFound ) |
|
931 |
{ |
|
932 |
// Unhide the view |
|
933 |
CCalenViewInfo* viewInfo = iViewInfoArray[viewInfoPos]; |
|
934 |
viewInfo->Hide( EFalse ); |
|
935 |
||
936 |
// Set hidden view as default view if the currently disabled plugin |
|
937 |
// is the default view |
|
938 |
TInt position = iViewInfoArray.Find( aPluginUid, |
|
939 |
CCalenViewInfo::ViewPluginIdentifier ); |
|
940 |
if(position != -1) |
|
941 |
{ |
|
942 |
for(TInt i = position; i < iViewInfoArray.Count(); i++) |
|
943 |
{ |
|
944 |
if((iViewInfoArray[i]->PluginUid() == aPluginUid) && |
|
945 |
iViewInfoArray[i]->ViewUid() == iSetting->DefaultView()) |
|
946 |
{ |
|
947 |
iSetting->SetDefaultView(aViewUid); |
|
948 |
break; |
|
949 |
} |
|
950 |
} |
|
951 |
} |
|
952 |
||
953 |
// By unhiding the view, the cycleposition order may be changed |
|
954 |
// so the view info array needs to be resorted. |
|
955 |
iViewInfoArray.Sort( iSortOrder ); |
|
956 |
} |
|
957 |
} |
|
958 |
} |
|
959 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
960 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
961 |
|
66 | 962 |
// ---------------------------------------------------------------------------- |
963 |
// CCalenCustomisationManager::GetReplacePluginViewIdL |
|
964 |
// Returns the view ID of the plugin that hides a particular view |
|
965 |
// ---------------------------------------------------------------------------- |
|
966 |
// |
|
967 |
EXPORT_C TUid CCalenCustomisationManager::GetReplacePluginViewIdL( TUid aHiddenViewId ) |
|
968 |
{ |
|
969 |
TRACE_ENTRY_POINT; |
|
970 |
||
971 |
RArray<TInt> removedViews; |
|
972 |
CCalenCustomisation* plugin = NULL; |
|
973 |
TInt i = 0; |
|
974 |
for( ;i < iActivePlugins.Count(); i++) |
|
975 |
{ |
|
976 |
plugin = FindPluginL(iActivePlugins[i]); |
|
977 |
plugin->RemoveViewsFromCycle(removedViews); |
|
978 |
if(removedViews.Count()) |
|
979 |
{ |
|
980 |
TInt position = removedViews.Find(aHiddenViewId.iUid); |
|
981 |
if(position != KErrNotFound) |
|
982 |
break; |
|
983 |
else |
|
984 |
continue; |
|
985 |
} |
|
986 |
else |
|
987 |
{ |
|
988 |
continue; |
|
989 |
} |
|
990 |
} |
|
991 |
removedViews.Reset(); |
|
992 |
||
993 |
// Get all the views provided by the plugin |
|
994 |
//plugin->GetCustomViewsL() |
|
995 |
TInt position = iViewInfoArray.Find( iActivePlugins[i], |
|
996 |
CCalenViewInfo::ViewPluginIdentifier ); |
|
997 |
while((position < iViewInfoArray.Count()) && ((iViewInfoArray[position]->CyclePosition() == CCalenView::ENoCyclePosition) || |
|
998 |
(iActivePlugins[i] != (iViewInfoArray[position]->PluginUid())))) |
|
999 |
{ |
|
1000 |
// go to the next view position |
|
1001 |
position++; |
|
1002 |
} |
|
1003 |
TRACE_EXIT_POINT; |
|
1004 |
||
1005 |
return (iViewInfoArray[position]->ViewUid()); |
|
1006 |
} |
|
1007 |
||
1008 |
// ---------------------------------------------------------------------------- |
|
1009 |
// CCalenCustomisationManager::GetReplacePluginViewIdL |
|
1010 |
// Returns the hidden views list |
|
1011 |
// ---------------------------------------------------------------------------- |
|
1012 |
// |
|
1013 |
EXPORT_C void CCalenCustomisationManager::GetHiddenViewIdL( TUid aPluginUid, RArray<TInt>& aHiddenViews ) |
|
1014 |
{ |
|
1015 |
TRACE_ENTRY_POINT; |
|
1016 |
||
1017 |
// Get the plugin instance |
|
1018 |
CCalenCustomisation* plugin = FindPluginL(aPluginUid); |
|
1019 |
||
1020 |
plugin->RemoveViewsFromCycle(aHiddenViews); |
|
1021 |
||
1022 |
TRACE_EXIT_POINT; |
|
1023 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1024 |
|
66 | 1025 |
// ---------------------------------------------------------------------------- |
1026 |
// CCalenCustomisationManager::CustomPreviewPaneL |
|
1027 |
// Returns the preview pane |
|
1028 |
// (other items were commented in a header). |
|
1029 |
// ---------------------------------------------------------------------------- |
|
1030 |
EXPORT_C MCalenPreview* CCalenCustomisationManager::CustomPreviewPaneL( TRect& aRect ) |
|
1031 |
{ |
|
1032 |
MCalenPreview* previewPane = NULL; |
|
1033 |
||
1034 |
||
1035 |
// Loop though all the command handlers, within two interlinked |
|
1036 |
// for loops. If PreviewPaneL leaves for one plugin, a plugin |
|
1037 |
// error message will be displayed and the loop will continue with |
|
1038 |
// the next command handler. If none of the plugins leave, there will |
|
1039 |
// be only one TRAP used. |
|
1040 |
TInt count = iPlugins.Count(); |
|
1041 |
for ( TInt index = 0; index < count && !previewPane; ++index ) |
|
1042 |
{ |
|
1043 |
TRAPD( error, |
|
1044 |
{ |
|
1045 |
// Loop though until an infobar is found |
|
1046 |
for (; index < count && !previewPane; ++index ) |
|
1047 |
{ |
|
1048 |
if ( !iPlugins[index]->IsDisabled() ) |
|
1049 |
{ |
|
1050 |
previewPane = iPlugins[index]->Plugin().CustomPreviewPaneL( aRect ); |
|
1051 |
} |
|
1052 |
} |
|
1053 |
} |
|
1054 |
); |
|
1055 |
if ( error ) |
|
1056 |
{ |
|
1057 |
// Report a problem with plugin. |
|
1058 |
} |
|
1059 |
} |
|
1060 |
||
1061 |
TRACE_EXIT_POINT; |
|
1062 |
return previewPane; |
|
1063 |
} |
|
1064 |
// ---------------------------------------------------------------------------- |
|
1065 |
// CCalenCustomisationManager::PreviewPane |
|
1066 |
// Returns the preview pane |
|
1067 |
// (other items were commented in a header). |
|
1068 |
// ---------------------------------------------------------------------------- |
|
1069 |
EXPORT_C CCoeControl* CCalenCustomisationManager::PreviewPane( TRect& aRect ) |
|
1070 |
{ |
|
1071 |
TRACE_ENTRY_POINT; |
|
1072 |
||
1073 |
iInfoBarProviderUid = TUid::Uid(0);; |
|
1074 |
iPreviewPaneProviderUid = TUid::Uid(0); |
|
1075 |
||
1076 |
CCoeControl* previewPane = NULL; |
|
1077 |
||
1078 |
// Loop though all the command handlers, within two interlinked |
|
1079 |
// for loops. If PreviewPaneL leaves for one plugin, a plugin |
|
1080 |
// error message will be displayed and the loop will continue with |
|
1081 |
// the next command handler. If none of the plugins leave, there will |
|
1082 |
// be only one TRAP used. |
|
1083 |
TInt count = iPlugins.Count(); |
|
1084 |
for ( TInt index = 0; index < count && !previewPane; ++index ) |
|
1085 |
{ |
|
1086 |
TRAPD( error, |
|
1087 |
// Loop though until an infobar is found |
|
1088 |
for (; index < count && !previewPane; ++index ) |
|
1089 |
{ |
|
1090 |
||
1091 |
if ( !iPlugins[index]->IsDisabled() ) |
|
1092 |
{ |
|
1093 |
previewPane = iPlugins[index]->Plugin().PreviewPaneL( aRect ); |
|
1094 |
if(previewPane) |
|
1095 |
{ |
|
1096 |
iPreviewPaneProviderUid = iPlugins[index]->Uid(); |
|
1097 |
} |
|
1098 |
} |
|
1099 |
||
1100 |
} |
|
1101 |
); |
|
1102 |
||
1103 |
if ( error ) |
|
1104 |
{ |
|
1105 |
// Report a problem with plugin. |
|
1106 |
} |
|
1107 |
} |
|
1108 |
||
1109 |
TRACE_EXIT_POINT; |
|
1110 |
return previewPane; |
|
1111 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1112 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1113 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1114 |
// CCalenCustomisationManager::Infobar |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1115 |
// Returns the infobar. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1116 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1117 |
// ---------------------------------------------------------------------------- |
66 | 1118 |
EXPORT_C CCoeControl* CCalenCustomisationManager::Infobar(const TRect& aRect ) |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1119 |
{ |
66 | 1120 |
TRACE_ENTRY_POINT; |
1121 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1122 |
iInfoBarProviderUid = TUid::Uid(0); |
66 | 1123 |
iPreviewPaneProviderUid = TUid::Uid(0); |
1124 |
||
1125 |
CCoeControl* infoBar = NULL; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1126 |
// Loop though all the command handlers, within two interlinked |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1127 |
// for loops. If GetInfoBarL leaves for one plugin, a plugin |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1128 |
// error message will be displayed and the loop will continue with |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1129 |
// the next command handler. If none of the plugins leave, there will |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1130 |
// be only one TRAP used. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1131 |
TInt count = iPlugins.Count(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1132 |
for ( TInt index = 0; index < count && !infoBar; ++index ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1133 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1134 |
TRAPD( error, |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1135 |
// Loop though until an infobar is found |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1136 |
for (; index < count && !infoBar; ++index ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1137 |
{ |
66 | 1138 |
if ( !iPlugins[index]->IsDisabled() ) |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1139 |
{ |
66 | 1140 |
infoBar = iPlugins[index]->Plugin().InfobarL( aRect ); |
1141 |
iInfoBarProviderUid = iPlugins[index]->Uid(); |
|
1142 |
} |
|
1143 |
} |
|
1144 |
); |
|
1145 |
||
1146 |
if ( error ) |
|
1147 |
{ |
|
1148 |
// Report a problem with plugin. |
|
1149 |
} |
|
1150 |
} |
|
1151 |
||
1152 |
TRACE_EXIT_POINT; |
|
1153 |
return infoBar; |
|
1154 |
} |
|
1155 |
||
1156 |
// ---------------------------------------------------------------------------- |
|
1157 |
// CCalenCustomisationManager::Infobar |
|
1158 |
// Returns the infobar. |
|
1159 |
// (other items were commented in a header). |
|
1160 |
// ---------------------------------------------------------------------------- |
|
1161 |
EXPORT_C const TDesC& CCalenCustomisationManager::Infobar() |
|
1162 |
{ |
|
1163 |
TRACE_ENTRY_POINT; |
|
1164 |
||
1165 |
iInfoBarProviderUid = TUid::Uid(0); |
|
1166 |
iPreviewPaneProviderUid = TUid::Uid(0); |
|
1167 |
||
1168 |
iInfoBarStr.Set(KNullDesC); |
|
1169 |
// Loop though all the command handlers, within two interlinked |
|
1170 |
// for loops. If GetInfoBarL leaves for one plugin, a plugin |
|
1171 |
// error message will be displayed and the loop will continue with |
|
1172 |
// the next command handler. If none of the plugins leave, there will |
|
1173 |
// be only one TRAP used. |
|
1174 |
TBool infoBarFound = EFalse; |
|
1175 |
TInt count = iPlugins.Count(); |
|
1176 |
for ( TInt index = 0; index < count && !infoBarFound; ++index ) |
|
1177 |
{ |
|
1178 |
TRAPD( error, |
|
1179 |
// Loop though until an infobar is found |
|
1180 |
for (; index < count && !infoBarFound; ++index ) |
|
1181 |
{ |
|
1182 |
if ( !iPlugins[index]->IsDisabled() ) |
|
1183 |
{ |
|
1184 |
iInfoBarStr.Set( iPlugins[index]->Plugin().InfobarL() ); |
|
1185 |
if(iInfoBarStr.Length()) |
|
1186 |
{ |
|
1187 |
infoBarFound = ETrue; |
|
1188 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1189 |
iInfoBarProviderUid = iPlugins[index]->Uid(); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1190 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1191 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1192 |
); |
66 | 1193 |
|
1194 |
if ( error ) |
|
1195 |
{ |
|
1196 |
// Report a problem with plugin. |
|
1197 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1198 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1199 |
|
66 | 1200 |
TRACE_EXIT_POINT; |
1201 |
return iInfoBarStr; |
|
1202 |
} |
|
1203 |
||
1204 |
// ---------------------------------------------------------------------------- |
|
1205 |
// CCalenCustomisationManager::HiddenView |
|
1206 |
// Return ETrue if a view has been hidden by a plugin |
|
1207 |
// (other items were commented in a header). |
|
1208 |
// ---------------------------------------------------------------------------- |
|
1209 |
// |
|
1210 |
EXPORT_C TBool CCalenCustomisationManager::HiddenView( TUid aHiddenView) const |
|
1211 |
{ |
|
1212 |
TRACE_ENTRY_POINT; |
|
1213 |
TRACE_EXIT_POINT; |
|
1214 |
return ( iHiddenViews.Find( aHiddenView.iUid ) != KErrNotFound ); |
|
1215 |
} |
|
1216 |
||
1217 |
||
1218 |
// ---------------------------------------------------------------------------- |
|
1219 |
// CCalenCustomisationManager::RomBased( |
|
1220 |
// Return ETrue if a view has been provided by a rom-based plugin |
|
1221 |
// (other items were commented in a header). |
|
1222 |
// ---------------------------------------------------------------------------- |
|
1223 |
// |
|
1224 |
EXPORT_C TBool CCalenCustomisationManager::IsViewRomBased( TUid aViewUid ) const |
|
1225 |
{ |
|
1226 |
TRACE_ENTRY_POINT; |
|
1227 |
||
1228 |
TBool isRomBased = EFalse; |
|
1229 |
||
1230 |
TInt viewInfoPos = iViewInfoArray.Find( aViewUid , |
|
1231 |
CCalenViewInfo::ViewInfoIdentifier ); |
|
1232 |
if ( viewInfoPos != KErrNotFound ) |
|
1233 |
{ |
|
1234 |
TUid plugUid = iViewInfoArray[viewInfoPos]->PluginUid(); |
|
1235 |
TInt position = iRomBasedPlugins.Find( plugUid ); |
|
1236 |
if ( position != KErrNotFound ) |
|
1237 |
{ |
|
1238 |
isRomBased = ETrue; |
|
1239 |
} |
|
1240 |
} |
|
1241 |
||
1242 |
TRACE_EXIT_POINT; |
|
1243 |
return isRomBased; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1244 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1245 |
|
66 | 1246 |
// ---------------------------------------------------------------------------- |
1247 |
// CCalenCustomisationManager::CanBeEnabledDisabled( |
|
1248 |
// Return ETrue if plugins can be enabled/disabled from settings |
|
1249 |
// (other items were commented in a header). |
|
1250 |
// ---------------------------------------------------------------------------- |
|
1251 |
// |
|
1252 |
EXPORT_C TBool CCalenCustomisationManager::CanBeEnabledDisabledL(TUid aPluginUid) |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1253 |
{ |
66 | 1254 |
TRACE_ENTRY_POINT; |
1255 |
TBool enabledDisabled = EFalse; |
|
1256 |
||
1257 |
CCalenCustomisation* plugin = FindPluginL(aPluginUid); |
|
1258 |
if(plugin) |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1259 |
{ |
66 | 1260 |
enabledDisabled = plugin->CanBeEnabledDisabled(); |
1261 |
} |
|
1262 |
||
1263 |
TRACE_EXIT_POINT; |
|
1264 |
return enabledDisabled; |
|
1265 |
} |
|
1266 |
||
1267 |
// ---------------------------------------------------------------------------- |
|
1268 |
// CCalenCustomisationManager::OfferMenuPaneL |
|
1269 |
// Offers a menupane to all interested plugins |
|
1270 |
// (other items were commented in a header). |
|
1271 |
// ---------------------------------------------------------------------------- |
|
1272 |
// |
|
1273 |
void CCalenCustomisationManager::OfferMenuPaneToPluginsL( TInt aResourceId, |
|
1274 |
CEikMenuPane* aMenuPane ) |
|
1275 |
{ |
|
1276 |
TRACE_ENTRY_POINT; |
|
1277 |
||
1278 |
// Get the number of command handlers |
|
1279 |
// TInt count = iCommandHandlers.Count(); |
|
1280 |
const TInt count = iPlugins.Count(); |
|
1281 |
||
1282 |
// Loop though all the command handlers, within two interlinked |
|
1283 |
// for loops. If customiseMenuPane leaves for one plugin, a plugin |
|
1284 |
// error message will be displayed and the loop will continue with |
|
1285 |
// the next command handler. If none of the plugins leave, there will |
|
1286 |
// be only one TRAP used. |
|
1287 |
for ( TInt index = 0; index < count; ++index ) |
|
1288 |
{ |
|
1289 |
TRAPD( error, |
|
1290 |
for (; index < count; ++index ) |
|
1291 |
{ |
|
1292 |
if ( !iPlugins[index]->IsDisabled() ) |
|
1293 |
{ |
|
1294 |
iPlugins[index]->Plugin().CustomiseMenuPaneL( aResourceId, |
|
1295 |
aMenuPane ); |
|
1296 |
||
1297 |
// The commands added should be checked to see that |
|
1298 |
// they match the expected command range for the plugin |
|
1299 |
} |
|
1300 |
} |
|
1301 |
); |
|
1302 |
||
1303 |
if ( error ) |
|
1304 |
{ |
|
1305 |
// Report a problem with plugin. |
|
1306 |
} |
|
1307 |
} |
|
1308 |
||
1309 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1310 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1311 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1312 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1313 |
// CCalenCustomisationManager::FindPluginL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1314 |
// Finds a plugin and returns a plugin with a given uid, returns NULL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1315 |
// if the uid can not be found. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1316 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1317 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1318 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1319 |
CCalenCustomisation* CCalenCustomisationManager::FindPluginL( TUid aUid ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1320 |
{ |
66 | 1321 |
TRACE_ENTRY_POINT; |
1322 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1323 |
TInt index = iPlugins.Find( aUid, CPluginInfo::Identifier ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1324 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1325 |
CCalenCustomisation* plugin = NULL; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1326 |
if ( index != KErrNotFound ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1327 |
{ |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1328 |
plugin = &( iPlugins[index]->Plugin() ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1329 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1330 |
|
66 | 1331 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1332 |
return plugin; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1333 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1334 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1335 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1336 |
// CCalenCustomisationManager::CPluginInfo::CPluginInfo( |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1337 |
// C++ constructor |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1338 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1339 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1340 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1341 |
CCalenCustomisationManager::CPluginInfo::CPluginInfo( |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1342 |
CCalenCustomisation* aPlugin, |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1343 |
TUid aUid ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1344 |
: iPlugin( aPlugin ), |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1345 |
iUid( aUid ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1346 |
{ |
66 | 1347 |
TRACE_ENTRY_POINT; |
1348 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1349 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1350 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1351 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1352 |
// CCalenCustomisationManager::CPluginInfo::~CPluginInfo( |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1353 |
// C++ destructor |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1354 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1355 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1356 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1357 |
CCalenCustomisationManager::CPluginInfo::~CPluginInfo() |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1358 |
{ |
66 | 1359 |
TRACE_ENTRY_POINT; |
1360 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1361 |
delete iPlugin; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1362 |
|
66 | 1363 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1364 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1365 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1366 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1367 |
// CCalenCustomisationManager::CPluginInfo::Plugin |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1368 |
// returns a reference to the plugin |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1369 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1370 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1371 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1372 |
CCalenCustomisation& CCalenCustomisationManager::CPluginInfo::Plugin() |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1373 |
{ |
66 | 1374 |
TRACE_ENTRY_POINT; |
1375 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1376 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1377 |
return *iPlugin; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1378 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1379 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1380 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1381 |
// CCalenCustomisationManager::CPluginInfo::Uid |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1382 |
// returns the plugin uid |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1383 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1384 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1385 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1386 |
TUid CCalenCustomisationManager::CPluginInfo::Uid() const |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1387 |
{ |
66 | 1388 |
TRACE_ENTRY_POINT; |
1389 |
TRACE_EXIT_POINT; |
|
1390 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1391 |
return iUid; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1392 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1393 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1394 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1395 |
// CCalenCustomisationManager::CPluginInfo::Disable |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1396 |
// Marks the plugin as being disabled |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1397 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1398 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1399 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1400 |
void CCalenCustomisationManager::CPluginInfo::Disable( TBool aDisable) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1401 |
{ |
66 | 1402 |
TRACE_ENTRY_POINT; |
1403 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1404 |
iDisabled = aDisable; |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1405 |
|
66 | 1406 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1407 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1408 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1409 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1410 |
// CCalenCustomisationManager::CPluginInfo::IsDisabled |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1411 |
// Returns if the plugin has been marked as being disabled |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1412 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1413 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1414 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1415 |
TBool CCalenCustomisationManager::CPluginInfo::IsDisabled() |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1416 |
{ |
66 | 1417 |
TRACE_ENTRY_POINT; |
1418 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1419 |
return iDisabled; |
66 | 1420 |
|
1421 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1422 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1423 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1424 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1425 |
// CCalenCustomisationManager::AddPluginL |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1426 |
// Adds a plugin to the array of plugins |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1427 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1428 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1429 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1430 |
void CCalenCustomisationManager::AddPluginL( CCalenCustomisation* aPlugin, |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1431 |
TUid aUid ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1432 |
{ |
66 | 1433 |
TRACE_ENTRY_POINT; |
1434 |
TInt index = iPlugins.Find( aUid, CPluginInfo::Identifier ); |
|
1435 |
if ( index == KErrNotFound ) |
|
1436 |
{ |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1437 |
CPluginInfo* newPlugin = new ( ELeave ) CPluginInfo( aPlugin, aUid); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1438 |
CleanupStack::PushL( newPlugin ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1439 |
iPlugins.AppendL( newPlugin ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1440 |
CleanupStack::Pop( newPlugin ); |
66 | 1441 |
} |
1442 |
||
1443 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1444 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1445 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1446 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1447 |
// CCalenCustomisationManager::CPluginInfo::Identifier( |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1448 |
// Matches an uid and a plugin uid. Used by FindPluginL to |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1449 |
// find a plugin with a given uid. |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1450 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1451 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1452 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1453 |
TBool CCalenCustomisationManager::CPluginInfo::Identifier( const TUid* aUid, |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1454 |
const CPluginInfo& aArray ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1455 |
{ |
66 | 1456 |
TRACE_ENTRY_POINT; |
1457 |
TRACE_EXIT_POINT; |
|
1458 |
||
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1459 |
return ( *aUid == aArray.Uid() ); |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1460 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1461 |
|
66 | 1462 |
// ---------------------------------------------------------------------------- |
1463 |
// CCalenCustomisationManager::ViewInfoArray |
|
1464 |
// returns a reference to the view info array. |
|
1465 |
// (other items were commented in a header). |
|
1466 |
// ---------------------------------------------------------------------------- |
|
1467 |
// |
|
1468 |
RPointerArray<CCalenViewInfo>& CCalenCustomisationManager::ViewInfoArray() |
|
1469 |
{ |
|
1470 |
TRACE_ENTRY_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1471 |
|
66 | 1472 |
TRACE_EXIT_POINT; |
1473 |
return iViewInfoArray; |
|
1474 |
} |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1475 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1476 |
// ---------------------------------------------------------------------------- |
66 | 1477 |
// CCalenCustomisationManager::PluginAvailabilityFinder |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1478 |
// Matches an uid and a plugin uid. Used by when finding the disabled plugins |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1479 |
// (other items were commented in a header). |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1480 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1481 |
// |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1482 |
TBool CCalenCustomisationManager::PluginAvailabilityFinder( const TUid* aUid, |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1483 |
const TCalenPluginAvailability& aArrayItem ) |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1484 |
{ |
66 | 1485 |
TRACE_ENTRY_POINT; |
1486 |
TRACE_EXIT_POINT; |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1487 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1488 |
return ( *aUid == aArrayItem.iUid); |
66 | 1489 |
} |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1490 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1491 |
// ---------------------------------------------------------------------------- |
66 | 1492 |
// CCalenCustomisationManager::DoPluginLoadingL |
1493 |
// Load all plugins |
|
1494 |
// ---------------------------------------------------------------------------- |
|
1495 |
// |
|
1496 |
EXPORT_C void CCalenCustomisationManager::DoPluginLoadingL() |
|
1497 |
{ |
|
1498 |
TRACE_ENTRY_POINT; |
|
1499 |
// Reset and destroy the contents of the owned arrays |
|
1500 |
//iPlugins.ResetAndDestroy(); |
|
1501 |
iHiddenViews.Reset(); |
|
1502 |
iDefferedUnloadPluginList.Reset(); |
|
1503 |
// create active plugin list |
|
1504 |
CreateActivePluginListL(); |
|
1505 |
||
1506 |
DoImmediatePluginLoadingL(); |
|
1507 |
iSetting->LoadL(); |
|
1508 |
iSetting->UpdatePluginListL(*this); |
|
1509 |
||
1510 |
TRACE_EXIT_POINT; |
|
1511 |
} |
|
1512 |
||
1513 |
// ---------------------------------------------------------------------------- |
|
1514 |
// CCalenCustomisationManager::DisableAllPluginsL |
|
1515 |
// Disable all plugins |
|
1516 |
// ---------------------------------------------------------------------------- |
|
1517 |
// |
|
1518 |
EXPORT_C void CCalenCustomisationManager::DisableAllPluginsL() |
|
1519 |
{ |
|
1520 |
TRACE_ENTRY_POINT; |
|
1521 |
||
1522 |
TInt pluginCount = iPluginInfo.Count(); |
|
1523 |
for(TInt index = 0;index<pluginCount;index++) |
|
1524 |
{ |
|
1525 |
TUid pluginUid = iPluginInfo[index]->ImplementationUid(); |
|
1526 |
if ((iActivePlugins.Find(pluginUid) != KErrNotFound) |
|
1527 |
&& !(iRomBasedPlugins.Find(pluginUid) != KErrNotFound)) |
|
1528 |
{ |
|
1529 |
DisablePluginOnFakeExitL(pluginUid); |
|
1530 |
} |
|
1531 |
} |
|
1532 |
||
1533 |
TRACE_EXIT_POINT; |
|
1534 |
} |
|
1535 |
||
1536 |
// ---------------------------------------------------------------------------- |
|
1537 |
// CCalenCustomisationManager::DisablePluginOnFakeExitL |
|
1538 |
// Disable plugin on fake exit |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1539 |
// ---------------------------------------------------------------------------- |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1540 |
// |
66 | 1541 |
void CCalenCustomisationManager::DisablePluginOnFakeExitL(TUid aPluginUid) |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1542 |
{ |
66 | 1543 |
TRACE_ENTRY_POINT; |
1544 |
||
1545 |
TInt index = iPlugins.Find( aPluginUid, CPluginInfo::Identifier ); |
|
1546 |
if ( index != KErrNotFound ) |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1547 |
{ |
66 | 1548 |
CPluginInfo* pluginInfo = iPlugins[index]; |
1549 |
||
1550 |
// Remove the plugin from the active plugin list |
|
1551 |
TInt position = iActivePlugins.Find( aPluginUid ); |
|
1552 |
ASSERT( position != KErrNotFound ); |
|
1553 |
||
1554 |
if(iActivePlugins.Count()) |
|
1555 |
{ |
|
1556 |
iActivePlugins.Remove( position ); |
|
1557 |
} |
|
1558 |
||
1559 |
// Does this plugin hide any views |
|
1560 |
RArray<TInt> removedViews; |
|
1561 |
CleanupClosePushL( removedViews ); |
|
1562 |
CCalenCustomisation& plugin = pluginInfo->Plugin(); |
|
1563 |
plugin.RemoveViewsFromCycle( removedViews ); |
|
1564 |
TInt hiddenViewsCount = removedViews.Count(); |
|
1565 |
if ( hiddenViewsCount ) |
|
1566 |
{ |
|
1567 |
// Need to recalculate which views have been hidden, as |
|
1568 |
// more than one plugin might have hidden the same view. |
|
1569 |
for ( TInt index( 0 ); index < hiddenViewsCount; ++index ) |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1570 |
{ |
66 | 1571 |
TUid viewUid = TUid::Uid( removedViews[index] ); |
1572 |
CheckHiddenViewL( viewUid, aPluginUid ); |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1573 |
} |
66 | 1574 |
} |
1575 |
||
1576 |
// If the plugin does not offer any views, or the current |
|
1577 |
// info or preview bar it can be deleted immediately, |
|
1578 |
// otherwise the customisation needs to wait until it |
|
1579 |
// is told it is safe to do so. |
|
1580 |
||
1581 |
// Does this plugin does not offer any views and the plugin |
|
1582 |
// doesn't offer the current infobar or preview pane |
|
1583 |
// bar it can be deleted immediately |
|
1584 |
TInt offerViews = iViewInfoArray.Find( aPluginUid, |
|
1585 |
CCalenViewInfo::ViewPluginIdentifier ); |
|
1586 |
||
1587 |
if ( offerViews == KErrNotFound && |
|
1588 |
iInfoBarProviderUid != aPluginUid |
|
1589 |
&& iPreviewPaneProviderUid != aPluginUid ) |
|
65
12af337248b1
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
1590 |
{ |
66 | 1591 |
RArray<TUid> pluginArray; |
1592 |
CleanupClosePushL( pluginArray ); |
|
1593 |
pluginArray.AppendL( aPluginUid ); |
|
1594 |
UnloadPluginsL( pluginArray ); |
|
1595 |
CleanupStack::PopAndDestroy(); // pluginArray |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1596 |
} |
66 | 1597 |
|
1598 |
// Issue notification of plugin been disabled |
|
1599 |
iPluginsEnabledDisabled = ETrue; |
|
1600 |
iServices.IssueNotificationL( ECalenNotifyPluginEnabledDisabled ); |
|
1601 |
CleanupStack::PopAndDestroy(); // removedViews |
|
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1602 |
} |
66 | 1603 |
TRACE_EXIT_POINT; |
0
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1604 |
} |
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1605 |
|
f979ecb2b13e
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1606 |
// End of File |
66 | 1607 |