phonesrv_plat/service_provider_settings_api/inc/spsettings.h
branchRCL_3
changeset 20 987c9837762f
parent 19 7d48bed6ce0c
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
    48  *  @since S60 v3.2
    48  *  @since S60 v3.2
    49  */
    49  */
    50 NONSHARABLE_CLASS( CSPSettings ): public CBase
    50 NONSHARABLE_CLASS( CSPSettings ): public CBase
    51     {
    51     {
    52 
    52 
    53     public: // Constructors and destructor
    53 	public: // Constructors and destructor
    54 
    54 
    55         /**
    55 	    /**
    56         * Two-phased constructor.
    56 	    * Two-phased constructor.
    57         */
    57 	    */
    58         IMPORT_C static CSPSettings* NewL();
    58 	    IMPORT_C static CSPSettings* NewL();
    59 
    59 
    60         /**
    60 	    /**
    61         * Two-phased constructor.
    61 	    * Two-phased constructor.
    62         */
    62 	    */
    63         IMPORT_C static CSPSettings* NewLC();
    63 	    IMPORT_C static CSPSettings* NewLC();
    64 
    64 
    65         /**
    65 	    /**
    66         * Destructors.
    66 	    * Destructors.
    67         */
    67 	    */
    68         IMPORT_C virtual ~CSPSettings();
    68 	    IMPORT_C virtual ~CSPSettings();
    69 
    69 
    70     public:
    70 	public:
    71 
    71 
    72         /**
    72 	    /**
    73          * Stores new service provider settings entry, 
    73 	     * Stores new service provider settings entry, 
    74          * service Id is returned inside aEntry object
    74 	     * service Id is returned inside aEntry object
    75          *
    75 	     *
    76          * @since S60 v3.2
    76 	     * @since S60 v3.2
    77          * @param aEntry New service provider settings entry, on return service Id is filled in
    77 	     * @param aEntry New service provider settings entry, on return service Id is filled in
    78          * @return error code
    78 	     * @return error code
    79          */
    79 	     */
    80         IMPORT_C TInt AddEntryL( CSPEntry& aEntry );
    80 	    IMPORT_C TInt AddEntryL( CSPEntry& aEntry );
    81 
    81 
    82         /**
    82 	    /**
    83          * Search service provider settings entry by service ID. 
    83 	     * Search service provider settings entry by service ID. 
    84          *
    84 	     *
    85          * @since S60 v3.2
    85 	     * @since S60 v3.2
    86          * @param aServiceId Id of requested xSP settings entry
    86 	     * @param aServiceId Id of requested xSP settings entry
    87          * @param aEntry on return, SP settings entry corresponding to aServiceId.
    87 	     * @param aEntry on return, SP settings entry corresponding to aServiceId.
    88          * @return error code, KErrNone if succeeded, otherwise system wide error code
    88 	     * @return error code, KErrNone if succeeded, otherwise system wide error code
    89          */
    89 	     */
    90         IMPORT_C TInt FindEntryL( TServiceId aServiceId, CSPEntry& aEntry );
    90 	    IMPORT_C TInt FindEntryL( TServiceId aServiceId, CSPEntry& aEntry );
    91 
    91 
    92 
    92 
    93         /**
    93 	    /**
    94          * Updates service provider settings entry to settings storage.
    94 	     * Updates service provider settings entry to settings storage.
    95          * Service ID must be set to entry before update.
    95 	     * Service ID must be set to entry before update.
    96          *
    96 	     *
    97          * @since S60 v3.2
    97 	     * @since S60 v3.2
    98          * @param aEntry Updated service provider settings entry
    98 	     * @param aEntry Updated service provider settings entry
    99          * @return error code, KErrNone if update succeeded, otherwise system wide error code
    99 	     * @return error code, KErrNone if update succeeded, otherwise system wide error code
   100          */
   100 	     */
   101         IMPORT_C TInt UpdateEntryL( const CSPEntry& aEntry );
   101 	    IMPORT_C TInt UpdateEntryL( const CSPEntry& aEntry );
   102 
   102 
   103         /**
   103 	    /**
   104          * Deletes service provider settings entry from storage by service ID.
   104 	     * Deletes service provider settings entry from storage by service ID.
   105          *
   105 	     *
   106          * @since S60 v3.2
   106 	     * @since S60 v3.2
   107          * @param aEntryId Id of settings entry which is going to be deleted
   107 	     * @param aEntryId Id of settings entry which is going to be deleted
   108          * @return error code, KErrNone if delete succeeded, otherwise system wide error code
   108 	     * @return error code, KErrNone if delete succeeded, otherwise system wide error code
   109          */
   109 	     */
   110         IMPORT_C TInt DeleteEntryL( TServiceId aServiceId );
   110 	    IMPORT_C TInt DeleteEntryL( TServiceId aServiceId );
   111 
   111 
   112         /**
   112 	    /**
   113          * Search property of service provider settings entry from storage.
   113 	     * Search property of service provider settings entry from storage.
   114          *
   114 	     *
   115          * @since S60 v3.2
   115 	     * @since S60 v3.2
   116          * @param aServiceId The service ID of requested service entry
   116 	     * @param aServiceId The service ID of requested service entry
   117          * @param aPropertyName property name to be found
   117 	     * @param aPropertyName property name to be found
   118          * @param aProperty on return, requested property
   118 	     * @param aProperty on return, requested property
   119          * @return error code, KErrNone if succeeded, otherwise system wide error code
   119 	     * @return error code, KErrNone if succeeded, otherwise system wide error code
   120          */
   120 	     */
   121         IMPORT_C TInt FindPropertyL( TServiceId aServiceId,
   121 	    IMPORT_C TInt FindPropertyL( TServiceId aServiceId,
   122                                     TServicePropertyName aPropertyName,
   122 	                                TServicePropertyName aPropertyName,
   123                                     CSPProperty& aProperty );
   123 	                                CSPProperty& aProperty );
   124 
   124 
   125         /**
   125 	    /**
   126          * Add or update properties of service provider settings entry to storage.
   126 	     * Add or update properties of service provider settings entry to storage.
   127          * If property name exists, update property. If property doesn't exist,
   127 	     * If property name exists, update property. If property doesn't exist,
   128          * add property
   128 	     * add property
   129          *
   129 	     *
   130          * @since S60 v3.2
   130 	     * @since S60 v3.2
   131          * @param aServiceId The ID of updated service entry
   131 	     * @param aServiceId The ID of updated service entry
   132          * @param aPropertyArray new properties to be added or updated
   132 	     * @param aPropertyArray new properties to be added or updated
   133          * @return error code, KErrNone if update succeeded, otherwise system wide error code
   133 	     * @return error code, KErrNone if update succeeded, otherwise system wide error code
   134          */
   134 	     */
   135         IMPORT_C TInt AddOrUpdatePropertiesL( TServiceId aServiceId, 
   135 	    IMPORT_C TInt AddOrUpdatePropertiesL( TServiceId aServiceId, 
   136                                               const RPropertyArray& aPropertyArray );
   136 	                                  		  const RPropertyArray& aPropertyArray );
   137 
   137 
   138 
   138 
   139         /**
   139 	    /**
   140          * Add or update one property of service provider settings entry to storage.
   140 	     * Add or update one property of service provider settings entry to storage.
   141          * If property name exists, update property. If property doesn't exist,
   141 	     * If property name exists, update property. If property doesn't exist,
   142          * add property
   142 	     * add property
   143          *
   143 	     *
   144          * @since S60 v3.2
   144 	     * @since S60 v3.2
   145          * @param aServiceId The ID of updated service entry
   145 	     * @param aServiceId The ID of updated service entry
   146          * @param aProperty new property to be added or updated
   146 	     * @param aProperty new property to be added or updated
   147          * @return error code, KErrNone if update succeeded, otherwise system wide error code
   147 	     * @return error code, KErrNone if update succeeded, otherwise system wide error code
   148          */
   148 	     */
   149         IMPORT_C TInt AddOrUpdatePropertyL( TServiceId aServiceId, 
   149 	    IMPORT_C TInt AddOrUpdatePropertyL( TServiceId aServiceId, 
   150                                             const CSPProperty& aProperty );
   150 	                                  		const CSPProperty& aProperty );
   151 
   151 
   152         /**
   152 	    /**
   153          * Return count of service provider settings entries in storage.
   153 	     * Return count of service provider settings entries in storage.
   154          *
   154 	     *
   155          * @since S60 v3.2
   155 	     * @since S60 v3.2
   156          * @return Count of stored service provider settings.
   156 	     * @return Count of stored service provider settings.
   157          */
   157 	     */
   158         IMPORT_C TInt SettingsCountL();
   158 	    IMPORT_C TInt SettingsCountL();
   159 
   159 
   160         /**
   160 	    /**
   161          * Search all service provider IDs from storage
   161 	     * Search all service provider IDs from storage
   162          *
   162 	     *
   163          * @since S60 v3.2
   163 	     * @since S60 v3.2
   164          * @param aServiceIds An array containing returned service IDs
   164 	     * @param aServiceIds An array containing returned service IDs
   165          * @return error code
   165 	     * @return error code
   166          */
   166 	     */
   167         IMPORT_C TInt FindServiceIdsL( RIdArray& aServiceIds );
   167 	    IMPORT_C TInt FindServiceIdsL( RIdArray& aServiceIds );
   168 
   168 
   169 
   169 
   170         /**
   170 	    /**
   171          * Search all service names from settings storage by given service IDs.
   171 	     * Search all service names from settings storage by given service IDs.
   172          * Removes ID from array if it is not found from settings storage.
   172 	     * Removes ID from array if it is not found from settings storage.
   173          *
   173 	     *
   174          * @since S60 v3.2
   174 	     * @since S60 v3.2
   175          * @param aServiceIds An array of service IDs
   175 	     * @param aServiceIds An array of service IDs
   176          * @param aServiceNames on return, array which saves found service names 
   176 	     * @param aServiceNames on return, array which saves found service names 
   177          * @return error code
   177 	     * @return error code
   178          */
   178 	     */
   179         IMPORT_C TInt FindServiceNamesL( RIdArray& aServiceIds,
   179 	    IMPORT_C TInt FindServiceNamesL( RIdArray& aServiceIds,
   180                                         CDesCArray& aServiceNames );
   180 	                                    CDesCArray& aServiceNames );
   181 
   181 
   182 
   182 
   183        /**
   183 	   /**
   184          * Search subservice properties of requested service provider settings entry by ID 
   184 	     * Search subservice properties of requested service provider settings entry by ID 
   185          * and subservice type
   185 	     * and subservice type
   186          *
   186 	     *
   187          * @since S60 v3.2
   187 	     * @since S60 v3.2
   188          * @param aServiceId The ID of requested service entry
   188 	     * @param aServiceId The ID of requested service entry
   189          * @param aPropertyType property type of sub service
   189 	     * @param aPropertyType property type of sub service
   190          * @param aPropertyArray on return,  array which saves found subservice properties
   190 	     * @param aPropertyArray on return,  array which saves found subservice properties
   191          * @return error code
   191 	     * @return error code
   192          */
   192 	     */
   193         IMPORT_C TInt FindSubServicePropertiesL( TServiceId aServiceId,
   193 	    IMPORT_C TInt FindSubServicePropertiesL( TServiceId aServiceId,
   194                                                 TSPItemType aPropertyType,
   194 	    										TSPItemType aPropertyType,
   195                                                 RPropertyArray& aPropertyArray );
   195 	                                            RPropertyArray& aPropertyArray );
   196 
   196 
   197         /**
   197 	    /**
   198          * Deletes service properties by service ID and property name.
   198 	     * Deletes service properties by service ID and property name.
   199          *
   199 	     *
   200          * @since S60 v3.2
   200 	     * @since S60 v3.2
   201          * @param aServiceId The service ID of requested service entry
   201 	     * @param aServiceId The service ID of requested service entry
   202          * @param aNameArray name of properties to be deleted
   202 	     * @param aNameArray name of properties to be deleted
   203          * @return error code
   203 	     * @return error code
   204          */
   204 	     */
   205         IMPORT_C TInt DeleteServicePropertiesL( TServiceId aServiceId,
   205 	    IMPORT_C TInt DeleteServicePropertiesL( TServiceId aServiceId,
   206                                                 const RPropertyNameArray& aNameArray );
   206 	                                            const RPropertyNameArray& aNameArray );
   207                                                 
   207 	                                            
   208         /**
   208 	    /**
   209          * Find service IDs with same properties
   209 	     * Find service IDs with same properties
   210          *
   210 	     *
   211          * @since S60 v3.2
   211 	     * @since S60 v3.2
   212          * @param aPropertyArray property array
   212 	     * @param aPropertyArray property array
   213          * @param on return, service Ids with same properties
   213 	     * @param on return, service Ids with same properties
   214          * @return error code
   214 	     * @return error code
   215          */
   215 	     */
   216         IMPORT_C TInt FindServiceIdsFromPropertiesL( const RPropertyArray& aPropertyArray, 
   216 	    IMPORT_C TInt FindServiceIdsFromPropertiesL( const RPropertyArray& aPropertyArray, 
   217                                                      RIdArray& aServiceIds );
   217 	    											 RIdArray& aServiceIds );
   218 
   218 
   219         /**
   219 	    /**
   220          * Get SIP VoIP software version.
   220 	     * Get SIP VoIP software version.
   221          *
   221 	     *
   222          * @since S60 v3.2
   222 	     * @since S60 v3.2
   223          * @return SIP VoIP software version
   223 	     * @return SIP VoIP software version
   224          */
   224 	     */
   225         IMPORT_C static const TDesC& GetSIPVoIPSWVersion();
   225 	    IMPORT_C static const TDesC& GetSIPVoIPSWVersion();
   226         
   226 	    
   227         /**
   227 	    /**
   228          * Check feature is supported or not
   228 	     * Check feature is supported or not
   229          *
   229 	     *
   230          * @since S60 v3.2
   230 	     * @since S60 v3.2
   231          * @return SIP VoIP software version
   231 	     * @return SIP VoIP software version
   232          */
   232 	     */
   233         IMPORT_C TBool IsFeatureSupported( TSPServiceFeature aFeature );
   233 	    IMPORT_C TBool IsFeatureSupported( TSPServiceFeature aFeature );
   234 
   234 
   235     private:
   235 	private:
   236 
   236 
   237         /**
   237 	    /**
   238         * C++ default constructor.
   238 	    * C++ default constructor.
   239         */
   239 	    */
   240         CSPSettings();
   240 	    CSPSettings();
   241 
   241 
   242         /**
   242 	    /**
   243         * By default Symbian 2nd phase constructor is private.
   243 	    * By default Symbian 2nd phase constructor is private.
   244         */
   244 	    */
   245         void ConstructL();
   245 	    void ConstructL();
   246         
   246 	    
   247         /**
   247 	    /**
   248         * Commit or rollback transaction
   248 	    * Commit or rollback transaction
   249         * @since S60 v3.2
   249 	    * @since S60 v3.2
   250         * @param aError error code of CenRep operation
   250 	    * @param aError error code of CenRep operation
   251         * @param aServiceId changed service Id
   251 	    * @param aServiceId changed service Id
   252         * @return error code
   252 	    * @return error code
   253         */
   253 	    */
   254         TInt CommitOrRollbackL( TInt aError, TServiceId aServiceId );
   254 	    TInt CommitOrRollbackL( TInt aError, TServiceId aServiceId );
   255 
   255 
   256         /**
   256 	    /**
   257          * Check is VoIP Service Id and then are Properties VoIP related
   257 	     * Check is VoIP Service Id and then are Properties VoIP related
   258          *
   258 	     *
   259          * @since S60 v3.2.3
   259 	     * @since S60 v3.2.3
   260          * @return KErrNotSupported if VoIP not supported and checking 
   260 	     * @return KErrNotSupported if VoIP not supported and checking 
   261          * of Service Id and Properties gives true
   261 	     * of Service Id and Properties gives true
   262          */
   262 	     */
   263         TInt CheckSupportedL( TServiceId aServiceId, const RPropertyNameArray& aNameArray );
   263 	    TInt CheckSupportedL( TServiceId aServiceId, const RPropertyNameArray& aNameArray );
   264         
   264 	    
   265         /**
   265 	    /**
   266          * Check is VoIP Service Id
   266 	     * Check is VoIP Service Id
   267          *
   267 	     *
   268          * @since S60 v3.2.3
   268 	     * @since S60 v3.2.3
   269          * @return KErrNotSupported if VoIP not supported and checking 
   269 	     * @return KErrNotSupported if VoIP not supported and checking 
   270          * of Service Id gives true
   270 	     * of Service Id gives true
   271          */
   271 	     */
   272         TInt CheckSupportedL( TServiceId aServiceId );
   272 	    TInt CheckSupportedL( TServiceId aServiceId );
   273 
   273 
   274         /**
   274 	    /**
   275          * Check is SP item type VoIP related
   275 	     * Check is SP item type VoIP related
   276          *
   276 	     *
   277          * @since S60 v3.2.3
   277 	     * @since S60 v3.2.3
   278          * @return KErrNotSupported if VoIP not supported and checking 
   278 	     * @return KErrNotSupported if VoIP not supported and checking 
   279          * of SP item type gives true
   279 	     * of SP item type gives true
   280          */
   280 	     */
   281         TInt CheckSupportedL( TSPItemType aPropertyType );
   281 		TInt CheckSupportedL( TSPItemType aPropertyType );
   282         
   282 		
   283         /**
   283 	    /**
   284          * Check does an array have Properties VoIP related
   284 	     * Check does an array have Properties VoIP related
   285          *
   285 	     *
   286          * @since S60 v3.2.3
   286 	     * @since S60 v3.2.3
   287          * @return KErrNotSupported if VoIP not supported and checking 
   287 	     * @return KErrNotSupported if VoIP not supported and checking 
   288          * of the array gives true
   288 	     * of the array gives true
   289          */
   289 	     */
   290         TInt CheckSupportedL( const RPropertyArray& aPropertyArray );
   290 		TInt CheckSupportedL( const RPropertyArray& aPropertyArray );
   291 
   291 
   292     private: // data
   292 	private: // data
   293 
   293 
   294         /**
   294 	    /**
   295          * Settings engine
   295 	     * Settings engine
   296          * Own.
   296 	     * Own.
   297          */
   297 	     */
   298         CSPSettingsEngine* iSettingsEngine;
   298 	    CSPSettingsEngine* iSettingsEngine;
   299 
   299 
   300 
   300 
   301         /**
   301 	    /**
   302          * Feature manager support VoIP
   302 	     * Feature manager support VoIP
   303          * Own.
   303 	     * Own.
   304          */
   304 	     */
   305         TBool iFeatureManagerSupportVoIP;
   305 	    TBool iFeatureManagerSupportVoIP;
   306         /**
   306         /**
   307          * Writing settings allowed
   307          * Writing settings allowed
   308          */
   308          */
   309         TBool iSettingsWriteAllowed;
   309         TBool iSettingsWriteAllowed;
   310 
   310