|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HSCONTENTCONTROLFACTORY_H |
|
19 #define HSCONTENTCONTROLFACTORY_H |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 #include <hscontentcontrolui.h> |
|
24 |
|
25 // User includes |
|
26 #include "hscontentcontrolecomobserver.h" |
|
27 #include "hscontentcontrolswiobserver.h" |
|
28 |
|
29 // Forward declarations |
|
30 class CHsContentControlEComListener; |
|
31 class CHsContentControlSwiListener; |
|
32 class CXnAppUiAdapter; |
|
33 |
|
34 /** |
|
35 * Content control UI base class |
|
36 * |
|
37 * |
|
38 * @code |
|
39 * |
|
40 * @endcode |
|
41 * |
|
42 * @lib hscontentcontrol.lib |
|
43 * @since S60 v5.0 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CHsContentControlFactory ) : public CBase, |
|
46 public MHsContentControlEComObserver, |
|
47 public MHsContentControlSwiObserver |
|
48 { |
|
49 public: // Constructor and destructor |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 IMPORT_C static CHsContentControlFactory* NewL( CXnAppUiAdapter& aAdapter ); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 IMPORT_C ~CHsContentControlFactory(); |
|
59 |
|
60 private: // from MHsContentControlEComObserver |
|
61 |
|
62 /** |
|
63 * Notification of Ecom registry change. |
|
64 */ |
|
65 void HandleEComChangeEvent(); |
|
66 |
|
67 private: // from MHsContentControlSwiObserver |
|
68 |
|
69 /** |
|
70 * Notification of Install/Uninstall event from SWI. |
|
71 * @param aUidList The package UID list which is being processed. |
|
72 */ |
|
73 void HandleSwiEvent( const RArray<TUid>& aUidList ); |
|
74 |
|
75 private: // Constructors |
|
76 /** |
|
77 * Constructor |
|
78 */ |
|
79 CHsContentControlFactory( CXnAppUiAdapter& aAdapter ); |
|
80 |
|
81 /** Second phase constructor */ |
|
82 void ConstructL(); |
|
83 |
|
84 public: // New functions |
|
85 /** |
|
86 * |
|
87 */ |
|
88 IMPORT_C MHsContentControlUi* GetHsContentController( |
|
89 const TDesC8& aControllerType ); |
|
90 |
|
91 /** |
|
92 * |
|
93 */ |
|
94 IMPORT_C void PrepareToExit(); |
|
95 |
|
96 private: |
|
97 |
|
98 /** |
|
99 * Deregisters/Removes/Deletes plugin's views from AppUi. |
|
100 */ |
|
101 void ReleaseHsCcUi( CHsContentControlUi* aHsContentControlUi ); |
|
102 |
|
103 /** |
|
104 * Finds and returns loaded ContentControlUi object from array. |
|
105 */ |
|
106 MHsContentControlUi* FindHsContentController( |
|
107 const TDesC8& aControllerType ); |
|
108 |
|
109 /** |
|
110 * Checks if a plugin is removed/upgraded/downgraded. |
|
111 */ |
|
112 void CheckPluginChangesL(); |
|
113 |
|
114 /** |
|
115 * Finds plugin implementation info in the ECOM registry. |
|
116 * @param aUid The plugin UID which is to be checked. |
|
117 * @param aPluginArray The array of plugins which have been implemented. |
|
118 * @return ImplementationInfo of plugin. |
|
119 */ |
|
120 CImplementationInformation* FindPluginImplInfo( |
|
121 const TUid& aUid, const RImplInfoPtrArray& aPlugInArray ); |
|
122 |
|
123 /** |
|
124 * Checks if an upgrade or downgrade of the existing plugins happened. |
|
125 * @param aPluginImplInfo ImplInfo of plugin to be checked for upgrade/downgrade. |
|
126 * @return ETrue if upgrade/downgrade, EFalse otherwise. |
|
127 */ |
|
128 TBool PluginUpgradeDowngrade( const CImplementationInformation& aPluginImplInfo ); |
|
129 |
|
130 private: // Data |
|
131 |
|
132 /** |
|
133 * Reference to XnAppUiAdapter. |
|
134 */ |
|
135 CXnAppUiAdapter& iAdapter; |
|
136 |
|
137 /** |
|
138 * An array of type CHsContentControlUi ( Owned ). |
|
139 */ |
|
140 RPointerArray< CHsContentControlUi > iHsContentControlUis; |
|
141 |
|
142 /** |
|
143 * An array of type CImplementationInformation ( Owned ). |
|
144 */ |
|
145 RImplInfoPtrArray iImplArray; |
|
146 |
|
147 /** |
|
148 * An object of type CHsContentControlEComListener ( Owned ). |
|
149 */ |
|
150 CHsContentControlEComListener* iHsContentControlEComListener; |
|
151 |
|
152 /** |
|
153 * An object of type CHsContentControlSwiListener ( Owned ). |
|
154 */ |
|
155 CHsContentControlSwiListener* iHsContentControlSwiListener; |
|
156 }; |
|
157 |
|
158 |
|
159 #endif // HSCONTENTCONTROLFACTORY_H |
|
160 |
|
161 // End of file |