|
1 /* |
|
2 * Copyright (c) 2009 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: Pre Install helper class. |
|
15 * |
|
16 */ |
|
17 #ifndef __EMAILSTOREPREINSTALL_H__ |
|
18 #define __EMAILSTOREPREINSTALL_H__ |
|
19 |
|
20 // ======== |
|
21 // INCLUDES |
|
22 // ======== |
|
23 #include <e32base.h> |
|
24 #include <w32std.h> |
|
25 #include <apgtask.h> |
|
26 #include <e32property.h> |
|
27 #include <DebugLogMacros.h> |
|
28 #include "ProcessTimer.h" |
|
29 |
|
30 // ======== |
|
31 // LOCALS |
|
32 // ======== |
|
33 LOCAL_C void DoPreInstallL( ); |
|
34 |
|
35 /** |
|
36 * Pre Install helper class. |
|
37 */ |
|
38 class CEmailStorePreInstall : public CTimer , public MObserverPreInstall |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Factory methods. |
|
43 */ |
|
44 static CEmailStorePreInstall* NewL(); |
|
45 static CEmailStorePreInstall* NewLC(); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CEmailStorePreInstall(); |
|
51 |
|
52 public: |
|
53 // FROM: MObserverPreInstall |
|
54 void Timeout(); |
|
55 |
|
56 protected: |
|
57 //from CTimer |
|
58 void RunL(); |
|
59 void DoCancel(); |
|
60 TInt RunError( TInt aError ); |
|
61 |
|
62 private: |
|
63 /** |
|
64 * Constructor. |
|
65 */ |
|
66 CEmailStorePreInstall( ); |
|
67 |
|
68 /** |
|
69 * Second-phase constructor. |
|
70 */ |
|
71 void ConstructL(); |
|
72 |
|
73 /** |
|
74 * Stop servers. |
|
75 * Iterates through servers and signals them to stop. |
|
76 * If the stop doesn't occur in a certain time, then the server is killed. |
|
77 */ |
|
78 void StopNextServerL(); |
|
79 |
|
80 // Internal state |
|
81 enum TState |
|
82 { |
|
83 EInit, |
|
84 EStopServers, |
|
85 EWaitForProcess, |
|
86 EDone |
|
87 }; |
|
88 |
|
89 private: |
|
90 /** Current index in the server list. */ |
|
91 TInt iServerIndex; |
|
92 /** Internal state. */ |
|
93 TState iState; |
|
94 /** Process finish timeout. */ |
|
95 CProcessTimer* iTimeoutTimer; |
|
96 /** Current server to be stopped handle. */ |
|
97 RProcess iProcess; |
|
98 |
|
99 /** Logging. */ |
|
100 __LOG_DECLARATION |
|
101 }; |
|
102 |
|
103 #endif //__EMAILSTOREPREINSTALL_H__ |