|
1 /* |
|
2 * Copyright (c) 2006 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: Sensor Settings model. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef GSSENSORPLUGINMODEL_H |
|
20 #define GSSENSORPLUGINMODEL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <badesca.h> |
|
25 #include <centralrepository.h> |
|
26 |
|
27 // CONSTANTS |
|
28 // maximum string sizes |
|
29 const TInt KGSBufSize128 = 128; |
|
30 const TUid KGSSensorPluginUid = { 0x10282DED }; |
|
31 |
|
32 |
|
33 // CLASS DEFINITION |
|
34 |
|
35 /** |
|
36 * CGSSensorPluginModel is the model class of GS sensor plugin. |
|
37 * It provides functions to get and set setting values. |
|
38 * |
|
39 * @lib gssensorplugin.lib |
|
40 * @since S60 5.0 |
|
41 */ |
|
42 class CGSSensorPluginModel : public CBase |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Two-phased constructor |
|
48 */ |
|
49 static CGSSensorPluginModel* NewL(); |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 virtual ~CGSSensorPluginModel(); |
|
55 |
|
56 /** |
|
57 * Returns sensor active status. |
|
58 * |
|
59 * @return 1: sensor active status ON |
|
60 * 0: sensor active status OFF |
|
61 */ |
|
62 TInt SensorActiveStatusL(); |
|
63 |
|
64 /** |
|
65 * Sets sensor active status. |
|
66 * |
|
67 * @param aStatus sensor active status. |
|
68 */ |
|
69 void SetSensorActiveStatusL( TInt aStatus ); |
|
70 |
|
71 /** |
|
72 * Gets user selected options for interactions |
|
73 * |
|
74 * @param aInteraction Interaction for which settings to get |
|
75 * @return TUint32 contains a bitmaks of user selections |
|
76 */ |
|
77 TUint32 SelectionListL( TInt aInteraction ); |
|
78 |
|
79 /** |
|
80 * Sets user selected options for interaction |
|
81 * |
|
82 * @param aInteraction Interaction for which settings to set |
|
83 * @param aList updated bitmask of user selected interactions |
|
84 */ |
|
85 void SetSelectionListL( TInt aInteraction, TInt aList ); |
|
86 |
|
87 /** |
|
88 * Indicates is any changes made during this objects lifetime |
|
89 */ |
|
90 TBool ChangesMade(); |
|
91 |
|
92 /** |
|
93 * Indicates are there any settings set on |
|
94 */ |
|
95 TBool SettingsExistsL(); |
|
96 |
|
97 /** |
|
98 * Gets the variation bitmask of a selected interaction |
|
99 */ |
|
100 TUint32 VariationListL( const TInt aInteraction ); |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * Default C++ contructor |
|
106 */ |
|
107 CGSSensorPluginModel(); |
|
108 |
|
109 /** |
|
110 * Symbian OS default constructor |
|
111 */ |
|
112 void ConstructL(); |
|
113 |
|
114 private: // data |
|
115 |
|
116 /** |
|
117 * Sensor settings repository |
|
118 */ |
|
119 CRepository* iSensorRepository; |
|
120 |
|
121 /** |
|
122 * Flag that has user made any changes to settings. This value is |
|
123 * updated whenever settings are stored into Central Repository. |
|
124 */ |
|
125 TBool iChangesMade; |
|
126 }; |
|
127 |
|
128 #endif //GSSENSORPLUGINMODEL_H |