|
1 /* |
|
2 * Copyright (c) 2007-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: Utility to access MRUI feature settings repository. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CESMRFEATURESETTINGS_H |
|
19 #define CESMRFEATURESETTINGS_H |
|
20 |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 //#include "?include_file" |
|
25 |
|
26 //class ?forward_classname; |
|
27 |
|
28 /** |
|
29 * CESMRFeatureSettings is utility to access MRUI Features repository. |
|
30 * Usage: |
|
31 * |
|
32 * @code |
|
33 * // instantiate settings |
|
34 * CESMRFeatureSettings* setting = CESMRFeatureSettings::NewL() |
|
35 * // query feature |
|
36 * TBool locationFeatures = setting->FeatureSupported( EESMRUILocationFeatures ); |
|
37 * if ( locationFeatures ) |
|
38 * { |
|
39 * // Do something feature specific |
|
40 * } |
|
41 * // free resources |
|
42 * delete settings; |
|
43 * @endcode |
|
44 * |
|
45 * @lib esmrcommon.lib |
|
46 */ |
|
47 NONSHARABLE_CLASS( CESMRFeatureSettings ) : public CBase |
|
48 { |
|
49 |
|
50 public: |
|
51 |
|
52 /** Feature setting flags. */ |
|
53 enum TFeature |
|
54 { |
|
55 /** Map and Navigation Fw support */ |
|
56 EESMRUIMnFwIntegration = 0x1, |
|
57 /** Contacts support */ |
|
58 EESMRUIContactsIntegration = 0x2, |
|
59 /** Landmarks application support */ |
|
60 EESMRUILandmarksIntegration = 0x4, |
|
61 /** Previous locations list */ |
|
62 EESMRUIPreviousLocationsList = 0x8, |
|
63 /** Any of the previous location features */ |
|
64 // Must be last member in enumeration |
|
65 EESMRUILocationFeatures |
|
66 }; |
|
67 |
|
68 IMPORT_C static CESMRFeatureSettings* NewL(); |
|
69 IMPORT_C static CESMRFeatureSettings* NewLC(); |
|
70 |
|
71 /** |
|
72 * Destructor. |
|
73 */ |
|
74 virtual ~CESMRFeatureSettings(); |
|
75 |
|
76 /** |
|
77 * Gets feature setting. The setting must be enumerated in |
|
78 * CESMRFeatureSettings::TFeature enumeration. |
|
79 * Multiple features can be queried at the same time by |
|
80 * bitwise-oring the corresponding feature flags. |
|
81 * |
|
82 * @param aFeatures the features. |
|
83 * @return ETrue if feature is enabled |
|
84 */ |
|
85 IMPORT_C TBool FeatureSupported( TUint aFeatures ) const; |
|
86 |
|
87 private: |
|
88 CESMRFeatureSettings(); |
|
89 |
|
90 void ConstructL(); |
|
91 |
|
92 TInt MapFeature( TUint aFeature ) const; |
|
93 |
|
94 private: // data |
|
95 |
|
96 /** |
|
97 * Feature index array for mapping features |
|
98 */ |
|
99 enum TFeatureIndex |
|
100 { |
|
101 EESMRUIMnFwIntegrationIndex = 0, |
|
102 EESMRUIContactsIntegrationIndex, |
|
103 EESMRUILandmarksIntegrationIndex, |
|
104 EESMRUIPreviousLocationsListIndex, |
|
105 // Last item. Number of features |
|
106 EESMRUINumLocationFeatures |
|
107 }; |
|
108 |
|
109 /** |
|
110 * Feature status array |
|
111 */ |
|
112 TInt iLocationFeatures[ EESMRUINumLocationFeatures ]; |
|
113 |
|
114 }; |
|
115 |
|
116 #endif // CESMRFEATURESETTINGS_H |