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: This class manages the runtime variated features |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32std.h> |
|
20 #include <centralrepository.h> |
|
21 #include <featmgr.h> |
|
22 #include <eikenv.h> |
|
23 #include "CFileManagerFeatureManager.h" |
|
24 #include "FileManagerDebug.h" |
|
25 #include "FileManagerPrivateCRKeys.h" |
|
26 |
|
27 // ======== MEMBER FUNCTIONS ======== |
|
28 |
|
29 // ---------------------------------------------------------------------------- |
|
30 // CFileManagerFeatureManager::CFileManagerFeatureManager |
|
31 // ---------------------------------------------------------------------------- |
|
32 // |
|
33 CFileManagerFeatureManager::CFileManagerFeatureManager() |
|
34 { |
|
35 FUNC_LOG; |
|
36 } |
|
37 |
|
38 // ---------------------------------------------------------------------------- |
|
39 // CFileManagerFeatureManager::ConstructL |
|
40 // ---------------------------------------------------------------------------- |
|
41 // |
|
42 void CFileManagerFeatureManager::ConstructL() |
|
43 { |
|
44 FUNC_LOG; |
|
45 |
|
46 // Get the feature manager variations |
|
47 FeatureManager::InitializeLibL(); |
|
48 iDrmFullSupported = FeatureManager::FeatureSupported( KFeatureIdDrmFull ); |
|
49 iHelpSupported = FeatureManager::FeatureSupported( KFeatureIdHelp ); |
|
50 iIrdaSupported = FeatureManager::FeatureSupported( KFeatureIdIrda ); |
|
51 iRemoteStorageFwSupported = |
|
52 FeatureManager::FeatureSupported( KFeatureIdRemoteStorageFw ); |
|
53 iMmcPassWdSupported = FeatureManager::FeatureSupported( KFeatureIdMmcLock ); |
|
54 iWesternVariant = !( FeatureManager::FeatureSupported( KFeatureIdChinese ) ); |
|
55 iMmcSwEjectSupported = |
|
56 ( FeatureManager::FeatureSupported( KFeatureIdMmcHotswap ) && |
|
57 FeatureManager::FeatureSupported( KFeatureIdMmcEject ) ); |
|
58 FeatureManager::UnInitializeLib(); |
|
59 |
|
60 iEmbedded = CEikonEnv::Static()->StartedAsServerApp(); |
|
61 |
|
62 // Get the local variations |
|
63 CRepository* cenRep = CRepository::NewLC( KCRUidFileManagerSettings ); |
|
64 TInt err( cenRep->Get( KFileManagerFeatures, iFileManagerFeatures ) ); |
|
65 if ( err != KErrNone ) |
|
66 { |
|
67 ERROR_LOG1( |
|
68 "CFileManagerFeatureManager::ConstructL()-LocalVariationError=%d", |
|
69 err ); |
|
70 iFileManagerFeatures = 0; |
|
71 } |
|
72 INFO_LOG1( |
|
73 "CFileManagerFeatureManager::ConstructL()-iFileManagerFeatures=0x%x", |
|
74 iFileManagerFeatures ); |
|
75 CleanupStack::PopAndDestroy( cenRep ); |
|
76 } |
|
77 |
|
78 // ---------------------------------------------------------------------------- |
|
79 // CFileManagerFeatureManager::NewL |
|
80 // ---------------------------------------------------------------------------- |
|
81 // |
|
82 CFileManagerFeatureManager* CFileManagerFeatureManager::NewL() |
|
83 { |
|
84 FUNC_LOG; |
|
85 |
|
86 CFileManagerFeatureManager* self = |
|
87 new ( ELeave ) CFileManagerFeatureManager(); |
|
88 CleanupStack::PushL( self ); |
|
89 self->ConstructL(); |
|
90 CleanupStack::Pop( self ); |
|
91 return self; |
|
92 } |
|
93 |
|
94 // ---------------------------------------------------------------------------- |
|
95 // CFileManagerFeatureManager::~CFileManagerFeatureManager |
|
96 // ---------------------------------------------------------------------------- |
|
97 // |
|
98 CFileManagerFeatureManager::~CFileManagerFeatureManager() |
|
99 { |
|
100 FUNC_LOG; |
|
101 } |
|
102 |
|
103 // ---------------------------------------------------------------------------- |
|
104 // CFileManagerFeatureManager::IsDrmFullSupported |
|
105 // ---------------------------------------------------------------------------- |
|
106 // |
|
107 EXPORT_C TBool CFileManagerFeatureManager::IsDrmFullSupported() const |
|
108 { |
|
109 return iDrmFullSupported; |
|
110 } |
|
111 |
|
112 // ---------------------------------------------------------------------------- |
|
113 // CFileManagerFeatureManager::IsHelpSupported |
|
114 // ---------------------------------------------------------------------------- |
|
115 // |
|
116 EXPORT_C TBool CFileManagerFeatureManager::IsHelpSupported() const |
|
117 { |
|
118 return iHelpSupported; |
|
119 } |
|
120 |
|
121 // ---------------------------------------------------------------------------- |
|
122 // CFileManagerFeatureManager::IsIrdaSupported |
|
123 // ---------------------------------------------------------------------------- |
|
124 // |
|
125 EXPORT_C TBool CFileManagerFeatureManager::IsIrdaSupported() const |
|
126 { |
|
127 return iIrdaSupported; |
|
128 } |
|
129 |
|
130 // ---------------------------------------------------------------------------- |
|
131 // CFileManagerFeatureManager::IsRemoteStorageFwSupported |
|
132 // ---------------------------------------------------------------------------- |
|
133 // |
|
134 EXPORT_C TBool CFileManagerFeatureManager::IsRemoteStorageFwSupported() const |
|
135 { |
|
136 return iRemoteStorageFwSupported; |
|
137 } |
|
138 |
|
139 // ---------------------------------------------------------------------------- |
|
140 // CFileManagerFeatureManager::IsMmcPassWdSupported |
|
141 // ---------------------------------------------------------------------------- |
|
142 // |
|
143 EXPORT_C TBool CFileManagerFeatureManager::IsMmcPassWdSupported() const |
|
144 { |
|
145 return iMmcPassWdSupported; |
|
146 } |
|
147 |
|
148 // ---------------------------------------------------------------------------- |
|
149 // CFileManagerFeatureManager::IsWesternVariant |
|
150 // ---------------------------------------------------------------------------- |
|
151 // |
|
152 EXPORT_C TBool CFileManagerFeatureManager::IsWesternVariant() const |
|
153 { |
|
154 return iWesternVariant; |
|
155 } |
|
156 // ---------------------------------------------------------------------------- |
|
157 // CFileManagerFeatureManager::IsMmcSwEjectSupported |
|
158 // ---------------------------------------------------------------------------- |
|
159 // |
|
160 EXPORT_C TBool CFileManagerFeatureManager::IsMmcSwEjectSupported() const |
|
161 { |
|
162 return iMmcSwEjectSupported; |
|
163 } |
|
164 |
|
165 // ---------------------------------------------------------------------------- |
|
166 // CFileManagerFeatureManager::IsFeatureSupported |
|
167 // ---------------------------------------------------------------------------- |
|
168 // |
|
169 EXPORT_C TBool CFileManagerFeatureManager::IsFeatureSupported( |
|
170 TInt aFileManagerFeature ) const |
|
171 { |
|
172 return ( iFileManagerFeatures & aFileManagerFeature ); |
|
173 } |
|
174 |
|
175 // ---------------------------------------------------------------------------- |
|
176 // CFileManagerFeatureManager::IsEmbedded |
|
177 // ---------------------------------------------------------------------------- |
|
178 // |
|
179 EXPORT_C TBool CFileManagerFeatureManager::IsEmbedded() const |
|
180 { |
|
181 return iEmbedded; |
|
182 } |
|