|
1 /* |
|
2 * Copyright (c) 2007-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: Sis package installation event listener |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef HNINSTALLNOTIFIER_H |
|
21 #define HNINSTALLNOTIFIER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <e32property.h> |
|
25 |
|
26 /** |
|
27 * @ingroup group_hnengine |
|
28 * Interface for observing Sis installation events. |
|
29 * |
|
30 * @lib hnengine |
|
31 * @since S60 S60 v3.1 |
|
32 */ |
|
33 class MHnInstallNotifierCallback |
|
34 { |
|
35 |
|
36 public: |
|
37 /** |
|
38 * @ingroup group_hnengine |
|
39 * Enum defining the purpouse of the installation event. |
|
40 */ |
|
41 enum TInstOp |
|
42 { |
|
43 EInstOpNone = 0x00, |
|
44 EInstOpInstall = 0x01, |
|
45 EInstOpUninstall = 0x02, |
|
46 EInstOpRestore = 0x04 |
|
47 }; |
|
48 |
|
49 /** |
|
50 * @ i ngroup group_hnengine |
|
51 * Enum defining the exit status of the installation event. |
|
52 */ |
|
53 /* enum TInstOpStatus |
|
54 { |
|
55 EInstOpStatusNone = 0x0000, |
|
56 EInstOpStatusSuccess = 0x0100, |
|
57 EInstOpStatusAborted = 0x0200 |
|
58 };*/ |
|
59 |
|
60 /** |
|
61 * InstallChangeL is called when the subscribed key has been changed. |
|
62 * |
|
63 * @param aStatus Status of the installation event. |
|
64 */ |
|
65 virtual void InstallChangeL( TInt aStatus ) = 0; |
|
66 |
|
67 }; |
|
68 |
|
69 |
|
70 /** |
|
71 * @ingroup group_hnengine |
|
72 * Central Repository notifier. |
|
73 * |
|
74 * @lib hnengine |
|
75 * @since S60 S60 v3.1 |
|
76 */ |
|
77 NONSHARABLE_CLASS( CHnInstallNotifier ) : public CActive |
|
78 { |
|
79 |
|
80 public: |
|
81 |
|
82 /** |
|
83 * Creates an instance of CHnMulModelInstallNotifier implementation. |
|
84 * |
|
85 * @since S60 v5.0 |
|
86 * |
|
87 * @param aCallback Reference to notifier interface. |
|
88 * @param aCategory Package uid. |
|
89 * @param aKey Key for central repository. |
|
90 * @return Fully constructed object. |
|
91 */ |
|
92 static CHnInstallNotifier* NewL( |
|
93 MHnInstallNotifierCallback* aCallback, |
|
94 TUid aCategory, |
|
95 TUint aKey ); |
|
96 |
|
97 /** |
|
98 * Default destructor. |
|
99 * |
|
100 * @since S60 v5.0 |
|
101 */ |
|
102 virtual ~CHnInstallNotifier(); |
|
103 |
|
104 |
|
105 private: |
|
106 /** |
|
107 * Constructor. |
|
108 * |
|
109 * @since S60 v5.0 |
|
110 * |
|
111 * @param aCallback Reference to notifier interface. |
|
112 * @param aCategory Package uid. |
|
113 * @param aKey Key for central repository. |
|
114 */ |
|
115 CHnInstallNotifier( |
|
116 MHnInstallNotifierCallback* aCallback, |
|
117 TUid aCategory, |
|
118 TUint aKey ); |
|
119 |
|
120 /** |
|
121 * Symbian 2nd phase constructor. |
|
122 * |
|
123 * @since S60 v5.0 |
|
124 */ |
|
125 void ConstructL(); |
|
126 |
|
127 /** |
|
128 * From CActive. Implements cancellation of an outstanding request. |
|
129 * |
|
130 * @since S60 v5.0 |
|
131 */ |
|
132 void DoCancel(); |
|
133 |
|
134 /** |
|
135 * From CActive. Handles an active object's request completion event. |
|
136 * |
|
137 * @since S60 v5.0 |
|
138 */ |
|
139 void RunL(); |
|
140 |
|
141 /** |
|
142 * From CActive. |
|
143 * |
|
144 * @since S60 v5.0 |
|
145 * @param aError The leave code. |
|
146 * @return Status code. |
|
147 */ |
|
148 TInt RunError( TInt aError ); |
|
149 |
|
150 |
|
151 private: |
|
152 /** |
|
153 * User side interface to Publish & Subscribe. |
|
154 */ |
|
155 RProperty iProperty; |
|
156 |
|
157 /** |
|
158 * Interface for notifying changes in SWI. |
|
159 * Not own. |
|
160 */ |
|
161 MHnInstallNotifierCallback* iCallback; |
|
162 |
|
163 /** |
|
164 * Category uid. |
|
165 */ |
|
166 TUid iCategory; |
|
167 |
|
168 /** |
|
169 * Key identifier. |
|
170 */ |
|
171 TUint iKey; |
|
172 |
|
173 }; |
|
174 |
|
175 #endif // HNINSTALLNOTIFIER_H |
|
176 |
|
177 // End of File |