19 #define DRMSETTINGSMODEL_H |
19 #define DRMSETTINGSMODEL_H |
20 |
20 |
21 // INCLUDES |
21 // INCLUDES |
22 #include <centralrepository.h> |
22 #include <centralrepository.h> |
23 #include <e32property.h> |
23 #include <e32property.h> |
24 #include "roapstorageclient.h" |
24 #include "RoapStorageClient.h" |
25 |
25 |
26 // FORWARD DECLARATIONS |
26 // FORWARD DECLARATIONS |
27 class CDRMRIContext; |
27 class CDRMRIContext; |
28 |
28 |
29 // CONSTANTS |
29 // CONSTANTS |
30 const TInt KDRMTransactionTrackingDisabled = 0; |
30 const TInt KDRMTransactionTrackingDisabled = 0; |
31 const TInt KDRMTransactionTrackingEnabled = 1; |
31 const TInt KDRMTransactionTrackingEnabled = 1; |
32 |
32 |
33 const TInt KDRMAutomaticActivationNotAllowed = 0; |
33 const TInt KDRMAutomaticActivationNotAllowed = 0; |
34 const TInt KDRMAutomaticActivationAllowed = 1; |
34 const TInt KDRMAutomaticActivationAllowed = 1; |
35 |
35 |
36 |
36 |
37 // CLASS DEFINITIONS |
37 // CLASS DEFINITIONS |
38 |
38 |
39 /** |
39 /** |
40 * CDRMSettingsModel is the model class of DRMSettingsPlugin. |
40 * CDRMSettingsModel is the model class of DRMSettingsPlugin. |
41 * It provides functions to get and set setting values. |
41 * It provides functions to get and set setting values. |
42 */ |
42 */ |
43 class CDRMSettingsModel : public CBase |
43 class CDRMSettingsModel : public CBase |
44 { |
44 { |
45 |
45 |
46 public: // Constructor and destructor |
46 public: // Constructor and destructor |
47 /** |
47 /** |
48 * Two-phased constructor |
48 * Two-phased constructor |
49 */ |
49 */ |
50 static CDRMSettingsModel* NewL(); |
50 static CDRMSettingsModel* NewL(); |
94 * @param aIndex : Index of the RI context |
94 * @param aIndex : Index of the RI context |
95 * |
95 * |
96 * @return RI alias name or RI url if no alias available |
96 * @return RI alias name or RI url if no alias available |
97 */ |
97 */ |
98 HBufC* GetSingleRIAliasL( TInt aIndex ); |
98 HBufC* GetSingleRIAliasL( TInt aIndex ); |
99 |
99 |
100 /** |
100 /** |
101 * Get the first RI alias, where metering is allowed |
101 * Get the first RI alias, where metering is allowed |
102 * @return RI alias name or RI url if no alias available |
102 * @return RI alias name or RI url if no alias available |
103 */ |
103 */ |
104 HBufC* GetFirstAllowedMeteringRIAliasL(); |
104 HBufC* GetFirstAllowedMeteringRIAliasL(); |
105 |
105 |
106 /** |
106 /** |
107 * Get number of RI contexts |
107 * Get number of RI contexts |
108 * @return number of RIContexts |
108 * @return number of RIContexts |
109 */ |
109 */ |
110 TInt GetRiContextCount(); |
110 TInt GetRiContextCount(); |
111 |
111 |
112 /** |
112 /** |
113 * Get metering status of RI Context |
113 * Get metering status of RI Context |
114 * |
114 * |
115 * @param aIndex : Index of the RI context |
115 * @param aIndex : Index of the RI context |
116 * |
116 * |
117 * @return Status of metering |
117 * @return Status of metering |
118 */ |
118 */ |
119 TBool IsMeteringAllowed( TInt aIndex ); |
119 TBool IsMeteringAllowed( TInt aIndex ); |
120 |
120 |
121 /** |
121 /** |
122 * Find out if metering is allowed for all RI Contexts |
122 * Find out if metering is allowed for all RI Contexts |
123 * |
123 * |
124 * @return Status of metering |
124 * @return Status of metering |
125 */ |
125 */ |
126 TBool IsMeteringAllowedForAll(); |
126 TBool IsMeteringAllowedForAll(); |
127 |
127 |
128 /** |
128 /** |
129 * Sets the value for metering to be enabled or disabled |
129 * Sets the value for metering to be enabled or disabled |
130 * |
130 * |
131 * @param aIndex : Index of the RI context |
131 * @param aIndex : Index of the RI context |
132 * @param aIsAllowed : ETrue if set to allowed, EFalse if not allowed |
132 * @param aIsAllowed : ETrue if set to allowed, EFalse if not allowed |
133 */ |
133 */ |
134 void SetMeteringStatus( TInt aIndex, TBool aIsAllowed ); |
134 void SetMeteringStatus( TInt aIndex, TBool aIsAllowed ); |
135 |
135 |
136 /** |
136 /** |
137 * Save the changes done to RI Contexs |
137 * Save the changes done to RI Contexs |
138 */ |
138 */ |
139 void SaveMeteringChanges(); |
139 void SaveMeteringChanges(); |
140 |
140 |
141 private: // Private constructors |
141 private: // Private constructors |
142 |
142 |
143 /** |
143 /** |
144 * Default C++ contructor |
144 * Default C++ contructor |
145 */ |
145 */ |
146 CDRMSettingsModel(); |
146 CDRMSettingsModel(); |
147 |
147 |
148 /** |
148 /** |
149 * Symbian OS default constructor |
149 * Symbian OS default constructor |
150 * @return void |
150 * @return void |
151 */ |
151 */ |
152 void ConstructL(); |
152 void ConstructL(); |
153 |
153 |
154 private: // Data |
154 private: // Data |
155 |
155 |
156 // DRM Settings Central Repository. |
156 // DRM Settings Central Repository. |
157 CRepository* iDRMSettingsRepository; |
157 CRepository* iDRMSettingsRepository; |
158 |
158 |
159 // Roap storage client |
159 // Roap storage client |
160 Roap::RRoapStorageClient* iRoapStorageClient; |
160 Roap::RRoapStorageClient* iRoapStorageClient; |
161 |
161 |
162 // List of service providers with which device has been registered |
162 // List of service providers with which device has been registered |
163 RPointerArray<CDRMRIContext> iRIContextList; |
163 RPointerArray<CDRMRIContext> iRIContextList; |
164 |
164 |
165 }; |
165 }; |
166 |
166 |
167 #endif // DRMSETTINGSMODEL_H |
167 #endif // DRMSETTINGSMODEL_H |
168 |
168 |
169 // End of File |
169 // End of File |