|
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: |
|
15 * |
|
16 */ |
|
17 #ifndef DEVENCSTARTERMMCOBSERVER_H_ |
|
18 #define DEVENCSTARTERMMCOBSERVER_H_ |
|
19 |
|
20 #include "DevEncMmcObserver.h" |
|
21 #include "DevEncStarterUtils.h" |
|
22 #include "DevEncUiMemInfoObserver.h" |
|
23 #include <f32file.h> |
|
24 |
|
25 // Forward declarations |
|
26 class CDevEncSession; |
|
27 //class CDevEncStarterUtils; |
|
28 class CDevEncStarterMemoryEntity; |
|
29 class CRepository; |
|
30 class TMmcInfo; |
|
31 |
|
32 class CDevEncStarterMmcObserver : public CBase, |
|
33 public MMemoryCardObserver, |
|
34 public MDevEncUiMemInfoObserver, |
|
35 public MUtilsCallback |
|
36 |
|
37 { |
|
38 public: |
|
39 static CDevEncStarterMmcObserver* NewL( |
|
40 CDevEncStarterUtils*& aUtils ); |
|
41 ~CDevEncStarterMmcObserver(); |
|
42 |
|
43 // From MMemoryCardObserver |
|
44 |
|
45 void MMCStatusChangedL(); |
|
46 |
|
47 /** |
|
48 * Called periodically. Not intended for use by other classes. |
|
49 * @param aPtr Pointer to an instance of this class. |
|
50 */ |
|
51 static TInt PollTick( TAny* aPtr ); |
|
52 |
|
53 /** |
|
54 * From MDevEncUiMemInfoObserver. |
|
55 */ |
|
56 void UpdateInfo( TDevEncUiMemoryType aType, |
|
57 TUint aState, |
|
58 TUint aProgress ); |
|
59 |
|
60 /** |
|
61 * From MUtilsCallback. |
|
62 */ |
|
63 void AppStarted( const TUint32& aUid ); |
|
64 |
|
65 private: |
|
66 // Functions |
|
67 CDevEncStarterMmcObserver( CDevEncStarterUtils*& aUtils ); |
|
68 void ConstructL(); |
|
69 TInt GetInfo( TMmcInfo& aInfo ); |
|
70 void LogInfo( const TMmcInfo& aInfo ) const; |
|
71 TInt CheckMMC(); |
|
72 |
|
73 TBool NeedToStartUi( TDevEncUiMemoryType aType, |
|
74 TUint aState ); |
|
75 |
|
76 TBool NeedToBlockPowerKey(); |
|
77 |
|
78 // Data |
|
79 /** Owned */ |
|
80 CMmcObserver* iObserver; |
|
81 |
|
82 /** Owned */ |
|
83 CRepository* iCrSettings; |
|
84 |
|
85 RFs iFs; |
|
86 |
|
87 /** Owned */ |
|
88 RArray<CDevEncStarterMemoryEntity*> iMemEntities; |
|
89 |
|
90 TUint iMmcEncState; |
|
91 TUint iPhoneEncState; |
|
92 TInt iMmcStatus; |
|
93 |
|
94 /** Not owned */ |
|
95 CDevEncStarterUtils*& iUtils; |
|
96 |
|
97 TInt32 iPowerKeyHandle; |
|
98 }; |
|
99 |
|
100 #endif /*DEVENCSTARTERMMCOBSERVER_H_*/ |