|
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: AutoInstaller installs theme from given location. It is intended |
|
15 * to be used by hspsThemeServer directly. AutoInstaller is initiated |
|
16 * when FileChangeListener finds installable theme source on given |
|
17 * location. Theme source is set during the SISX-package |
|
18 * exctraction. AutoInstaller is deployed by calling its function |
|
19 * InstallThemeL with manifest-file of the installable theme source set. |
|
20 * AutoInstaller deploys hspsInstallationHandler. hspsInstallationHandler |
|
21 * is asynchronous object, there for AutoInstaller is asynchronous object |
|
22 * as well capable to deploy asynchronous installation. |
|
23 * When installation ends, AutoInstaller calls its observer with |
|
24 * ThspsServiceCompletedMessage-type parameter. Observer is given on |
|
25 * initialising of AutoInstaller and it is allways ChspsThemeServer-type. |
|
26 * AutoInstaller have functions to get ODT-header of successfully installed |
|
27 * theme and ChspsResult-typed object expressing errors in unsuccessful cases. |
|
28 * |
|
29 */ |
|
30 |
|
31 |
|
32 #ifndef __hspsAUTOINSTALLER_H__ |
|
33 #define __hspsAUTOINSTALLER_H__ |
|
34 |
|
35 #include <e32base.h> |
|
36 #include "hspsthememanagement.h" |
|
37 |
|
38 #ifdef HSPS_LOG_ACTIVE |
|
39 class ChspsLogBus; |
|
40 #endif |
|
41 class ChspsODT; |
|
42 class ChspsResult; |
|
43 class ChspsThemeServer; |
|
44 class ChspsMaintenanceHandler; |
|
45 class ChspsInstallationHandler; |
|
46 |
|
47 /** |
|
48 * @ingroup group_hspsserver |
|
49 * @lib hspsThemeServer.exe |
|
50 * @since S60 5.0 |
|
51 */ |
|
52 class ChspsAutoInstaller : public CActive |
|
53 { |
|
54 public: // Constructors and destructors |
|
55 /** |
|
56 * NewL. |
|
57 * Two-phased constructor. |
|
58 * Creates a ChspsAutoInstaller object using two phase construction, |
|
59 * and return a pointer to the created object. |
|
60 * @param aObserver The object to be used to handle updates from the server. |
|
61 * @return A pointer to the created instance of ChspsAutoInstaller. |
|
62 */ |
|
63 static ChspsAutoInstaller* NewL( ChspsThemeServer& aThemeServer ); |
|
64 |
|
65 /** |
|
66 * NewLC. |
|
67 * Two-phased constructor. |
|
68 * Creates a ChspsClinet object using two phase construction, |
|
69 * and return a pointer to the created object. |
|
70 * @param aObserver The object to be used to handle updates from the server. |
|
71 * @return a pointer to the created instance of ChspsAutoInstaller. |
|
72 */ |
|
73 static ChspsAutoInstaller* NewLC( ChspsThemeServer& aThemeServer ); |
|
74 |
|
75 /** |
|
76 * ~ChspsAutoInstaller. |
|
77 * Destructor. |
|
78 * Destroys the object and release all memory objects. |
|
79 */ |
|
80 virtual ~ChspsAutoInstaller(); |
|
81 |
|
82 public: // New functions |
|
83 |
|
84 /** |
|
85 * UnInstallThemeL |
|
86 * @since S60 3.2 |
|
87 * @param aPathFile a path_*.dat file which describes the theme to be uninstalled |
|
88 */ |
|
89 void UnInstallThemeL( const TDesC& aPathFile ); |
|
90 |
|
91 /** |
|
92 * InstallTheme |
|
93 * @since S60 3.1 |
|
94 * @param aManifestFileName is a name of the manifest file of theme source to be installed. |
|
95 */ |
|
96 TInt InstallThemeL( const TDesC& aManifestFileName ); |
|
97 |
|
98 /** |
|
99 * GethspsResultL |
|
100 * @since S60 3.1 |
|
101 * @param aResult is a ChspsResult object containing additional information of the result of query. |
|
102 */ |
|
103 ChspsResult& hspsResult(); |
|
104 |
|
105 #ifdef HSPS_LOG_ACTIVE |
|
106 /** |
|
107 * Set log bus. |
|
108 */ |
|
109 void SetLogBus( ChspsLogBus* aLogBus ); |
|
110 #endif |
|
111 |
|
112 protected: // Functions from base classes |
|
113 |
|
114 /** |
|
115 * From CActive, RunL. |
|
116 * Callback function. |
|
117 * Invoked to handle responses from the server. |
|
118 */ |
|
119 void RunL(); |
|
120 |
|
121 /** |
|
122 * From CActive, DoCancel. |
|
123 * Cancels any outstanding operation. |
|
124 */ |
|
125 void DoCancel(); |
|
126 |
|
127 /** |
|
128 * From CActive Called when asynchronous request has failed |
|
129 * @since S60 3.1 |
|
130 */ |
|
131 TInt RunError( TInt aError ); |
|
132 |
|
133 private: // Constructors and destructors |
|
134 |
|
135 /** |
|
136 * ChspsAutoInstaller. |
|
137 * Performs the first phase of two phase construction. |
|
138 * @param aObserver The object to be used to handle updates from the server. |
|
139 */ |
|
140 ChspsAutoInstaller( ChspsThemeServer& aThemeServer ); |
|
141 |
|
142 /** |
|
143 * ConstructL. |
|
144 * Performs the second phase construction of a ChspsAutoInstaller object. |
|
145 */ |
|
146 void ConstructL(); |
|
147 |
|
148 |
|
149 private: // Members |
|
150 |
|
151 |
|
152 private: // Data |
|
153 |
|
154 TBuf8<KMaxHeaderDataLength8> iHeaderData; |
|
155 ChspsThemeServer& iThemeServer; |
|
156 ChspsResult* iResult; |
|
157 ChspsInstallationHandler* iInstallationHandler; |
|
158 ChspsMaintenanceHandler* iMaintenanceHandler; |
|
159 #ifdef HSPS_LOG_ACTIVE |
|
160 /** |
|
161 * Log bus. Not owned. |
|
162 */ |
|
163 ChspsLogBus* iLogBus; |
|
164 #endif |
|
165 |
|
166 }; |
|
167 |
|
168 |
|
169 #endif //__hspsAUTOINSTALLER_H__ |
|
170 |
|
171 // End of File |