convergedcallengine/spsettings/inc/spsettingsengine.h
branchRCL_3
changeset 19 7d48bed6ce0c
parent 0 ff3b6d0fd310
child 20 987c9837762f
equal deleted inserted replaced
18:594d59766373 19:7d48bed6ce0c
    38  *  @since S60 v3.2
    38  *  @since S60 v3.2
    39  */
    39  */
    40 NONSHARABLE_CLASS( CSPSettingsEngine ): public CBase
    40 NONSHARABLE_CLASS( CSPSettingsEngine ): public CBase
    41     {
    41     {
    42 
    42 
    43 	public: // Constructors and destructor
    43     public: // Constructors and destructor
    44 
    44 
    45 	    /**
    45         /**
    46 	    * Two-phased constructor.
    46         * Two-phased constructor.
    47 	    */
    47         */
    48 	    static CSPSettingsEngine* NewL();
    48         static CSPSettingsEngine* NewL();
    49 
    49 
    50 	    /**
    50         /**
    51 	    * Two-phased constructor.
    51         * Two-phased constructor.
    52 	    */
    52         */
    53 	    static CSPSettingsEngine* NewLC();
    53         static CSPSettingsEngine* NewLC();
    54 
    54 
    55 	    /**
    55         /**
    56 	    * Destructors.
    56         * Destructors.
    57 	    */
    57         */
    58 	    virtual ~CSPSettingsEngine();
    58         virtual ~CSPSettingsEngine();
    59 
    59 
    60 	public: // memeber functions
    60     public: // memeber functions
    61 	    /**
    61         /**
    62 	     * Starts transaction in repository
    62          * Starts transaction in repository
    63 	     *
    63          *
    64 	     * @since S60 v3.2
    64          * @since S60 v3.2
    65 	     */
    65          */
    66 	    TInt BeginTransactionLC();
    66         TInt BeginTransactionLC();
    67 
    67 
    68 	    /**
    68         /**
    69 	     * Commits changes in repository
    69          * Commits changes in repository
    70 	     *
    70          *
    71 	     * @since S60 v3.2
    71          * @since S60 v3.2
    72 	     */
    72          */
    73 	    TInt CommitTransaction();
    73         TInt CommitTransaction();
    74 	    
    74         
    75 	    /**
    75         /**
    76 	     * Rollback changes in repository
    76          * Rollback changes in repository
    77 	     *
    77          *
    78 	     * @since S60 v3.2
    78          * @since S60 v3.2
    79 	     */
    79          */
    80 	    void RollbackTransaction();
    80         void RollbackTransaction();
    81 
    81 
    82 	    /**
    82         /**
    83 	     * Stores new service provider settings entry
    83          * Stores new service provider settings entry
    84 	     *
    84          *
    85 	     * @since S60 v3.2
    85          * @since S60 v3.2
    86 	     * @param aEntry New service provider settings entry, on return service Id is filled in
    86          * @param aEntry New service provider settings entry, on return service Id is filled in
    87 	     */
    87          */
    88 	    void AddEntryL( CSPEntry& aEntry );
    88         void AddEntryL( CSPEntry& aEntry );
    89 
    89 
    90 	    /**
    90         /**
    91 	     * Search service provider settings entry by service ID. 
    91          * Search service provider settings entry by service ID. 
    92 	     *
    92          *
    93 	     * @since S60 v3.2
    93          * @since S60 v3.2
    94 	     * @param aServiceId Id of requested xSP settings entry
    94          * @param aServiceId Id of requested xSP settings entry
    95 	     * @param aEntry on return, SP settings entry corresponding to aServiceId.
    95          * @param aEntry on return, SP settings entry corresponding to aServiceId.
    96 	     * @return error code, KErrNone if succeeded, otherwise system wide error code
    96          * @return error code, KErrNone if succeeded, otherwise system wide error code
    97 	     */
    97          */
    98 	    TInt FindEntryL( TServiceId aServiceId, CSPEntry& aEntry );
    98         TInt FindEntryL( TServiceId aServiceId, CSPEntry& aEntry );
    99 
    99 
   100 	    /**
   100         /**
   101 	     * Updates service provider settings entry to settings storage.
   101          * Updates service provider settings entry to settings storage.
   102 	     *
   102          *
   103 	     * @since S60 v3.2
   103          * @since S60 v3.2
   104 	     * @param aEntry Updated service provider settings entry
   104          * @param aEntry Updated service provider settings entry
   105 	     * @return error code, KErrNone if update succeeded, otherwise system wide error code
   105          * @return error code, KErrNone if update succeeded, otherwise system wide error code
   106 	     */
   106          */
   107 	    TInt UpdateEntryL( const CSPEntry& aEntry );
   107         TInt UpdateEntryL( const CSPEntry& aEntry );
   108 
   108 
   109 	    /**
   109         /**
   110 	     * Deletes service provider settings entry from storage by service ID.
   110          * Deletes service provider settings entry from storage by service ID.
   111 	     *
   111          *
   112 	     * @since S60 v3.2
   112          * @since S60 v3.2
   113 	     * @param aEntryId Id of settings entry which is going to be deleted
   113          * @param aEntryId Id of settings entry which is going to be deleted
   114 	     * @return error code, KErrNone if delete succeeded, otherwise system wide error code
   114          * @return error code, KErrNone if delete succeeded, otherwise system wide error code
   115 	     */
   115          */
   116 	    TInt DeleteEntryL( TServiceId aServiceId );
   116         TInt DeleteEntryL( TServiceId aServiceId );
   117 
   117 
   118 	    /**
   118         /**
   119 	     * Search property of service provider settings entry from storage.
   119          * Search property of service provider settings entry from storage.
   120 	     *
   120          *
   121 	     * @since S60 v3.2
   121          * @since S60 v3.2
   122 	     * @param aServiceId The service ID of requested service entry
   122          * @param aServiceId The service ID of requested service entry
   123 	     * @param aPropertyName property name to be found
   123          * @param aPropertyName property name to be found
   124 	     * @param aProperty on return, requested property
   124          * @param aProperty on return, requested property
   125 	     * @return error code, KErrNone if succeeded, otherwise system wide error code
   125          * @return error code, KErrNone if succeeded, otherwise system wide error code
   126 	     */
   126          */
   127 	    TInt FindPropertyL( TServiceId aServiceId, 
   127         TInt FindPropertyL( TServiceId aServiceId, 
   128 	                        TServicePropertyName aPropertyName,
   128                             TServicePropertyName aPropertyName,
   129 	                        CSPProperty& aProperty );
   129                             CSPProperty& aProperty );
   130 
   130 
   131 	    /**
   131         /**
   132 	     * Add or update properties of service provider settings entry to storage.
   132          * Add or update properties of service provider settings entry to storage.
   133 	     * If property name exists, update property. If property doesn't exist,
   133          * If property name exists, update property. If property doesn't exist,
   134 	     *
   134          *
   135 	     * @since S60 v3.2
   135          * @since S60 v3.2
   136 	     * @param aServiceId The ID of updated service entry
   136          * @param aServiceId The ID of updated service entry
   137 	     * @param aPropertyArray new properties to be added or updated
   137          * @param aPropertyArray new properties to be added or updated
   138 	     * @return error code, KErrNone if update succeeded, otherwise system wide error code
   138          * @return error code, KErrNone if update succeeded, otherwise system wide error code
   139 	     */
   139          */
   140 	    TInt AddOrUpdatePropertiesL( TServiceId aServiceId, const RPropertyArray& aPropertyArray );
   140         TInt AddOrUpdatePropertiesL( TServiceId aServiceId, const RPropertyArray& aPropertyArray );
   141 
   141 
   142 	    /**
   142         /**
   143 	     * Return count of service provider settings entries in storage.
   143          * Return count of service provider settings entries in storage.
   144 	     *
   144          *
   145 	     * @since S60 v3.2
   145          * @since S60 v3.2
   146 	     * @return Count of stored service provider settings.
   146          * @return Count of stored service provider settings.
   147 	     */
   147          */
   148 	    TInt SettingsCountL();
   148         TInt SettingsCountL();
   149 
   149 
   150 	    /**
   150         /**
   151 	     * Search all service provider IDs from storage
   151          * Search all service provider IDs from storage
   152 	     *
   152          *
   153 	     * @since S60 v3.2
   153          * @since S60 v3.2
   154 	     * @param aServiceIds An array containing returned service IDs
   154          * @param aServiceIds An array containing returned service IDs
   155 	     * @return error code
   155          * @return error code
   156 	     */
   156          */
   157 	    TInt FindServiceIdsL( RIdArray& aServiceIds );
   157         TInt FindServiceIdsL( RIdArray& aServiceIds );
   158 
   158 
   159 	    /**
   159         /**
   160 	     * Search all service names from settings storage by given service IDs.
   160          * Search all service names from settings storage by given service IDs.
   161 	     * Removes service ID from given array if corresponding service name
   161          * Removes service ID from given array if corresponding service name
   162 	     * is not found. 
   162          * is not found. 
   163 	     *
   163          *
   164 	     * @since S60 v3.2
   164          * @since S60 v3.2
   165 	     * @param aServiceIds An array of service IDs
   165          * @param aServiceIds An array of service IDs
   166 	     * @param aServiceNames on return, array which saves found service names 
   166          * @param aServiceNames on return, array which saves found service names 
   167 	     */
   167          */
   168 	    void FindServiceNamesL( RIdArray& aServiceIds, CDesCArray& aServiceNames );
   168         void FindServiceNamesL( RIdArray& aServiceIds, CDesCArray& aServiceNames );
   169 
   169 
   170 
   170 
   171 	   /**
   171        /**
   172 	     * Search subservice properties of requested service provider settings entry by ID.
   172          * Search subservice properties of requested service provider settings entry by ID.
   173 	     *
   173          *
   174 	     * @since S60 v3.2
   174          * @since S60 v3.2
   175 	     * @param aServiceId The ID of requested service entry
   175          * @param aServiceId The ID of requested service entry
   176 	     * @param aPropertyType property type of sub service
   176          * @param aPropertyType property type of sub service
   177 	     * @param aPropertyArray on return,  array which saves found subservice properties
   177          * @param aPropertyArray on return,  array which saves found subservice properties
   178 	     * @return error code
   178          * @return error code
   179 	     */
   179          */
   180 	    TInt FindSubServicePropertiesL( TServiceId aServiceId,
   180         TInt FindSubServicePropertiesL( TServiceId aServiceId,
   181 	    								TSPItemType aPropertyType,
   181                                         TSPItemType aPropertyType,
   182 	                                   RPropertyArray& aPropertyArray );
   182                                        RPropertyArray& aPropertyArray );
   183 
   183 
   184 	    /**
   184         /**
   185 	     * Deletes service properties by service ID and property name.
   185          * Deletes service properties by service ID and property name.
   186 	     *
   186          *
   187 	     * @since S60 v3.2
   187          * @since S60 v3.2
   188 	     * @param aServiceId The service ID of requested service entry
   188          * @param aServiceId The service ID of requested service entry
   189 	     * @param aNameArray name of properties to be deleted
   189          * @param aNameArray name of properties to be deleted
   190 	     * @return error code
   190          * @return error code
   191 	     */
   191          */
   192 	    TInt DeleteServicePropertiesL( TServiceId aServiceId,
   192         TInt DeleteServicePropertiesL( TServiceId aServiceId,
   193 	                                   const RPropertyNameArray& aNameArray );
   193                                        const RPropertyNameArray& aNameArray );
   194 	                                   
   194                                        
   195 	    /**
   195         /**
   196 	     * Find service IDs with same properties
   196          * Find service IDs with same properties
   197 	     *
   197          *
   198 	     * @since S60 v3.2
   198          * @since S60 v3.2
   199 	     * @param aPropertyArray property array
   199          * @param aPropertyArray property array
   200 	     * @param on return, service Ids with same properties
   200          * @param on return, service Ids with same properties
   201 	     * @return error code
   201          * @return error code
   202 	     */
   202          */
   203 	    void FindServiceIdsFromPropertiesL( const RPropertyArray& aPropertyArray, RIdArray& aServiceIds );
   203         void FindServiceIdsFromPropertiesL( const RPropertyArray& aPropertyArray, RIdArray& aServiceIds );
   204 	                                   
   204                                        
   205 	    /**
   205         /**
   206 	     * Check feature is supported or not
   206          * Check feature is supported or not
   207 	     *
   207          *
   208 	     * @since S60 v3.2
   208          * @since S60 v3.2
   209 	     * @return SIP VoIP software version
   209          * @return SIP VoIP software version
   210 	     */
   210          */
   211 	    TBool IsFeatureSupportedL( TSPServiceFeature aFeature, 
   211         TBool IsFeatureSupportedL( TSPServiceFeature aFeature, 
   212 	                               TBool aWriteAllowed );
   212                                    TBool aWriteAllowed );
   213 	    
   213         
   214 	    
   214         
   215 	    /**
   215         /**
   216 	     * When service table is changed, update the P&S key
   216          * When service table is changed, update the P&S key
   217 	     *
   217          *
   218 	     * @since S60 v3.2
   218          * @since S60 v3.2
   219 	     */
   219          */
   220 	    void UpdateSupportFeaturePSKeyL();
   220         void UpdateSupportFeaturePSKeyL();
   221 
   221 
   222 	    /**
   222         /**
   223 	     * Check if it is VoIP Service ID
   223          * Check if it is VoIP Service ID
   224 	     *
   224          *
   225 	     * @since S60 v3.2.3
   225          * @since S60 v3.2.3
   226 	     * @return ETrue if yes
   226          * @return ETrue if yes
   227 	     */
   227          */
   228 		TBool IsVoIPServiceL( TServiceId aServiceId );
   228         TBool IsVoIPServiceL( TServiceId aServiceId );
   229 
   229 
   230 	    /**		
   230         /**     
   231 	     * Get Name array from Property array
   231          * Get Name array from Property array
   232 	     *
   232          *
   233 	     * @since S60 v3.2.3
   233          * @since S60 v3.2.3
   234 	     */
   234          */
   235 		void NameArrayFromPropertyArrayL( RPropertyNameArray& aNameArray, const RPropertyArray& aPropertyArray );
   235         void NameArrayFromPropertyArrayL( RPropertyNameArray& aNameArray, const RPropertyArray& aPropertyArray );
   236 
   236 
   237 	    /**
   237         /**
   238 	     * Check if an array has call related property name in it
   238          * Check if an array has call related property name in it
   239 	     *
   239          *
   240 	     * @since S60 v3.2.3
   240          * @since S60 v3.2.3
   241 	     * @return ETrue if yes
   241          * @return ETrue if yes
   242 	     */
   242          */
   243 		TBool HasCallPropertyName( const RPropertyNameArray& aNameArray );
   243         TBool HasCallPropertyName( const RPropertyNameArray& aNameArray );
   244 		
   244         
   245 	    /**
   245         /**
   246 	     * Check if an array has VoIP or Vmbx related property name in it
   246          * Check if an array has VoIP or Vmbx related property name in it
   247 	     *
   247          *
   248 	     * @since S60 v3.2.3
   248          * @since S60 v3.2.3
   249 	     * @return ETrue if yes
   249          * @return ETrue if yes
   250 	     */
   250          */
   251 		TBool HasVoIPAndVmbxPropertyName(  const RPropertyNameArray& aNameArray );
   251         TBool HasVoIPAndVmbxPropertyName(  const RPropertyNameArray& aNameArray );
   252 		
   252         
   253 	private:
   253     private:
   254 
   254 
   255 	    /**
   255         /**
   256 	    * C++ default constructor.
   256         * C++ default constructor.
   257 	    */
   257         */
   258 	    CSPSettingsEngine();
   258         CSPSettingsEngine();
   259 
   259 
   260 	    /**
   260         /**
   261 	    * By default Symbian 2nd phase constructor is private.
   261         * By default Symbian 2nd phase constructor is private.
   262 	    */
   262         */
   263 	    void ConstructL();
   263         void ConstructL();
   264 
   264 
   265 
   265 
   266 	    /**
   266         /**
   267 	     * Walk through all the sevices and check there is any service match 
   267          * Walk through all the sevices and check there is any service match 
   268 	     *
   268          *
   269 	     * @since S60 v3.2
   269          * @since S60 v3.2
   270 	     * @param aMask attribute mask 
   270          * @param aMask attribute mask 
   271 	     * @param aValue value to be checked
   271          * @param aValue value to be checked
   272 	     */
   272          */
   273 	    TBool CheckFeatureL( TInt aMask, TInt aValue );
   273         TBool CheckFeatureL( TInt aMask, TInt aValue );
   274 	    
   274         
   275         
   275         
   276         void ConvertSpEntryToCenRepArrayL( const CSPEntry& aEntry, 
   276         void ConvertSpEntryToCenRepArrayL( const CSPEntry& aEntry, 
   277                                            RIpAppPropArray& aArray );
   277                                            RIpAppPropArray& aArray );
   278         
   278         
   279         void ConvertSpArrayToCenRepArrayL( const RPropertyArray& aSpArray,
   279         void ConvertSpArrayToCenRepArrayL( const RPropertyArray& aSpArray,
   281                                            
   281                                            
   282         void PropertyNameArrayFromItemTypeL( TSPItemType aPropertyType, 
   282         void PropertyNameArrayFromItemTypeL( TSPItemType aPropertyType, 
   283                                              RPropertyNameArray& aNameArray );
   283                                              RPropertyNameArray& aNameArray );
   284                                            
   284                                            
   285         static void CleanupPointerArray( TAny* aPointer );
   285         static void CleanupPointerArray( TAny* aPointer );
   286 	    
   286         
   287 	    
   287         
   288 	private: // data
   288     private: // data
   289 
   289 
   290         CCenRepDatabaseUtil* iCenRepUtils;
   290         CCenRepDatabaseUtil* iCenRepUtils;
   291     };
   291     };
   292 
   292 
   293 #endif // C_SPSETTINGS_H
   293 #endif // C_SPSETTINGS_H