cmmanager/cmmgr/cmmserver/inc/cmmcache.h
changeset 40 c5b848e6c7d1
parent 30 8dde790cab74
child 44 a0c4ceac30d0
equal deleted inserted replaced
34:3b0cec605979 40:c5b848e6c7d1
   119     void ConstructL();
   119     void ConstructL();
   120 
   120 
   121 public:
   121 public:
   122     void OpenDestinationL(
   122     void OpenDestinationL(
   123             CCmmDestinationInstance& aDestinationInstance,
   123             CCmmDestinationInstance& aDestinationInstance,
   124             const TUint32& aId );
   124             const TUint32 aId );
   125 
   125 
   126     /**
   126     /**
   127      * Refresh the data contained in aDestinationInstance. This means reloading
   127      * Refresh the data contained in aDestinationInstance. This means reloading
   128      * the data from database if necessary. After this call the contents of
   128      * the data from database if necessary. After this call the contents of
   129      * aDestinationInstance will reflect the current state in the database. 
   129      * aDestinationInstance will reflect the current state in the database. 
   132             CCmmDestinationInstance& aDestinationInstance );
   132             CCmmDestinationInstance& aDestinationInstance );
   133 
   133 
   134     void CreateDestinationL(
   134     void CreateDestinationL(
   135             CCmmDestinationInstance& aDestinationInstance,
   135             CCmmDestinationInstance& aDestinationInstance,
   136             const TDesC& aName,
   136             const TDesC& aName,
   137             const TUint32& aId );
   137             const TUint32 aId );
   138 
   138 
   139     void OpenConnMethodL(
   139     void OpenConnMethodL(
   140             CCmmConnMethodInstance& aConnMethodInstance,
   140             CCmmConnMethodInstance& aConnMethodInstance,
   141             CCmmDestinationInstance* aDestinationInstance,
   141             CCmmDestinationInstance* aDestinationInstance,
   142             const TUint32& aId );
   142             const TUint32 aId );
   143 
   143 
   144     /**
   144     /**
   145      * Refresh the data contained in aConnMethodInstance. This means reloading
   145      * Refresh the data contained in aConnMethodInstance. This means reloading
   146      * the data from database if necessary. After this call the contents of
   146      * the data from database if necessary. After this call the contents of
   147      * aConnMethodInstance will reflect the current state in the database. 
   147      * aConnMethodInstance will reflect the current state in the database. 
   150             CCmmConnMethodInstance& aConnMethodInstance );
   150             CCmmConnMethodInstance& aConnMethodInstance );
   151 
   151 
   152     void CreateConnMethodL(
   152     void CreateConnMethodL(
   153             CCmmConnMethodInstance& aConnMethodInstance,
   153             CCmmConnMethodInstance& aConnMethodInstance,
   154             CCmmDestinationInstance* aDestinationInstance,
   154             CCmmDestinationInstance* aDestinationInstance,
   155             const TUint32& aBearerType,
   155             const TUint32 aBearerType,
   156             const TUint32& aConnMethodId );
   156             const TUint32 aConnMethodId );
   157 
   157 
   158     /**
   158     /**
   159      * Creates a copy of the given client instance (copy of the connection
   159      * Creates a copy of the given client instance (copy of the connection
   160      * method to the cache). The copy is created from the commsdat data
   160      * method to the cache). The copy is created from the commsdat data
   161      * (changes not updated will not be shown in the copy).
   161      * (changes not updated will not be shown in the copy).
   205     /**
   205     /**
   206      * Deletes a connection method as part of destination update operation. It
   206      * Deletes a connection method as part of destination update operation. It
   207      * is already checked that the connection method given as parameter can be
   207      * is already checked that the connection method given as parameter can be
   208      * deleted and a transaction is already open.
   208      * deleted and a transaction is already open.
   209      */
   209      */
   210     void DeleteConnMethodAsPartOfDestinationUpdateL( const TUint32& aConnMethodId );
   210     void DeleteConnMethodAsPartOfDestinationUpdateL( const TUint32 aConnMethodId );
   211 
   211 
   212     /**
   212     /**
   213      * Deletes a connection method as part of destination delete operation. It
   213      * Deletes a connection method as part of destination delete operation. It
   214      * is already checked that the connection method given as parameter can be
   214      * is already checked that the connection method given as parameter can be
   215      * deleted and a transaction is already open.
   215      * deleted and a transaction is already open.
   216      */
   216      */
   217     void DeleteConnMethodAsPartOfDestinationDeleteL( const TUint32& aConnMethodId );
   217     void DeleteConnMethodAsPartOfDestinationDeleteL( const TUint32 aConnMethodId );
   218 
   218 
   219     /**
   219     /**
   220      * Basic connection method delete. Removes a connection method from any
   220      * Basic connection method delete. Removes a connection method from any
   221      * destination it might belong to, and then deletes it.
   221      * destination it might belong to, and then deletes it.
   222      */
   222      */
   223     void DeleteConnMethodL( CCmmConnMethodInstance& aConnMethodInstance );
   223     void DeleteConnMethodL( CCmmConnMethodInstance& aConnMethodInstance );
   224 
   224 
   225     TBool DestinationExistsWithId( const TUint32& aId );
   225     TBool DestinationExistsWithId( const TUint32 aId );
   226     TBool DestinationExistsWithNameL( const TDesC& aName, const TUint32& aDestinationId );
   226     TBool DestinationExistsWithNameL( const TDesC& aName, const TUint32 aDestinationId );
   227     TBool DestinationOpenWithId( const TUint32& aId );
   227     TBool DestinationOpenWithId( const TUint32 aId );
   228     TBool NotSavedDestinationOpenWithNameL( const TDesC& aName, const TUint32& aDestinationId );
   228     TBool NotSavedDestinationOpenWithNameL( const TDesC& aName, const TUint32 aDestinationId );
   229 
   229 
   230     TBool ConnMethodExistsWithId( const TUint32& aConnMethodId );
   230     TBool ConnMethodExistsWithId( const TUint32 aConnMethodId );
   231     TBool ConnMethodOpenWithId( const TUint32& aConnMethodId );
   231     TBool ConnMethodOpenWithId( const TUint32 aConnMethodId );
   232 
   232 
   233     TBool DestinationExistsWithMetadataLocalizedL(
   233     TBool DestinationExistsWithMetadataLocalizedL(
   234             CCmmDestinationInstance& aDestinationInstance,
   234             CCmmDestinationInstance& aDestinationInstance,
   235             const TUint32& aValue );
   235             const TUint32 aValue );
   236     TBool DestinationExistsWithMetadataPurposeL(
   236     TBool DestinationExistsWithMetadataPurposeL(
   237             CCmmDestinationInstance& aDestinationInstance,
   237             CCmmDestinationInstance& aDestinationInstance,
   238             const TUint32& aValue );
   238             const TUint32 aValue );
   239 
   239 
   240     void DbChangeDetected( const TUint32& aTableId );
   240     void DbChangeDetected( const TUint32 aTableId );
   241     void DbChangeError( const TUint32& aTableId );
   241     void DbChangeError( const TUint32 aTableId );
   242 
   242 
   243     void CloseDestination( CCmmDestinationInstance& aDestinationInstance );
   243     void CloseDestination( CCmmDestinationInstance& aDestinationInstance );
   244     void CloseConnMethod( CCmmConnMethodInstance& aConnMethodInstance );
   244     void CloseConnMethod( CCmmConnMethodInstance& aConnMethodInstance );
   245 
   245 
   246     /**
   246     /**
   277      * beeing initialized.
   277      * beeing initialized.
   278      * @param aConnMethodId ID of the connection method beeing opened.
   278      * @param aConnMethodId ID of the connection method beeing opened.
   279      */
   279      */
   280     void OpenConnectionMethodInstanceL(
   280     void OpenConnectionMethodInstanceL(
   281             CCmmConnMethodInstance& aConnMethodInstance,
   281             CCmmConnMethodInstance& aConnMethodInstance,
   282             const TUint32& aConnMethodId );
   282             const TUint32 aConnMethodId );
   283 
   283 
   284     /**
   284     /**
   285      * Returns Connection Method specific integer value. CM is loaded(if not loaded already)
   285      * Returns Connection Method specific integer value. CM is loaded(if not loaded already)
   286      * to get the value.
   286      * to get the value.
   287      * @param aCmId Identifier of the Connection Method.
   287      * @param aCmId Identifier of the Connection Method.
   288      * @param aAttribute The identifier of the requested value.
   288      * @param aAttribute The identifier of the requested value.
   289      * @return Returns the requested integer value if found. Otherwise leaves with error code
   289      * @return Returns the requested integer value if found. Otherwise leaves with error code
   290      * KErrNotFound.
   290      * KErrNotFound.
   291      */
   291      */
   292     TUint32 GetConnectionMethodInfoIntL(
   292     TUint32 GetConnectionMethodInfoIntL(
   293             const TUint32& aCmId,
   293             const TUint32 aCmId,
   294             const TUint32& aAttribute );
   294             const TUint32 aAttribute );
   295 
   295 
   296     /**
   296     /**
   297      * Returns Connection Method specific boolean value. CM is loaded(if not loaded already)
   297      * Returns Connection Method specific boolean value. CM is loaded(if not loaded already)
   298      * to get the value.
   298      * to get the value.
   299      * @param aCmId Identifier of the Connection Method.
   299      * @param aCmId Identifier of the Connection Method.
   300      * @param aAttribute The identifier of the requested value.
   300      * @param aAttribute The identifier of the requested value.
   301      * @return Returns the requested boolean value if found. Otherwise leaves with error code
   301      * @return Returns the requested boolean value if found. Otherwise leaves with error code
   302      * KErrNotFound.
   302      * KErrNotFound.
   303      */
   303      */
   304     TBool GetConnectionMethodInfoBoolL(
   304     TBool GetConnectionMethodInfoBoolL(
   305             const TUint32& aCmId,
   305             const TUint32 aCmId,
   306             const TUint32& aAttribute );
   306             const TUint32 aAttribute );
   307 
   307 
   308     /**
   308     /**
   309      * Returns Connection Method specific 16 bit string value.
   309      * Returns Connection Method specific 16 bit string value.
   310      * CM is loaded(if not loaded already) to get the value.
   310      * CM is loaded(if not loaded already) to get the value.
   311      * @param aCmId Identifier of the Connection Method.
   311      * @param aCmId Identifier of the Connection Method.
   312      * @param aAttribute The identifier of the requested value.
   312      * @param aAttribute The identifier of the requested value.
   313      * @return Returns the requested string value if found. Otherwise leaves with error code
   313      * @return Returns the requested string value if found. Otherwise leaves with error code
   314      * KErrNotFound.
   314      * KErrNotFound.
   315      */
   315      */
   316     HBufC* GetConnectionMethodInfoStringL(
   316     HBufC* GetConnectionMethodInfoStringL(
   317             const TUint32& aCmId,
   317             const TUint32 aCmId,
   318             const TUint32& aAttribute );
   318             const TUint32 aAttribute );
   319 
   319 
   320     /**
   320     /**
   321      * Returns Connection Method specific 8 bit string value.
   321      * Returns Connection Method specific 8 bit string value.
   322      * CM is loaded(if not loaded already) to get the value.
   322      * CM is loaded(if not loaded already) to get the value.
   323      * @param aCmId Identifier of the Connection Method.
   323      * @param aCmId Identifier of the Connection Method.
   324      * @param aAttribute The identifier of the requested value.
   324      * @param aAttribute The identifier of the requested value.
   325      * @return Returns the requested string value if found. Otherwise leaves with error code
   325      * @return Returns the requested string value if found. Otherwise leaves with error code
   326      * KErrNotFound.
   326      * KErrNotFound.
   327      */
   327      */
   328     HBufC8* GetConnectionMethodInfoString8L(
   328     HBufC8* GetConnectionMethodInfoString8L(
   329             const TUint32& aCmId,
   329             const TUint32 aCmId,
   330             const TUint32& aAttribute );
   330             const TUint32 aAttribute );
   331 
   331 
   332     /**
   332     /**
   333      * Returns bearer specific integer value. IAP does not need to be loaded for this.
   333      * Returns bearer specific integer value. IAP does not need to be loaded for this.
   334      * @param aBearerType The type of the plugin to be asked.
   334      * @param aBearerType The type of the plugin to be asked.
   335      * @param aAttribute The identifier of the requested value.
   335      * @param aAttribute The identifier of the requested value.
   336      * @return Returns the requested integer value if found. Otherwise leaves with error code
   336      * @return Returns the requested integer value if found. Otherwise leaves with error code
   337      * KErrNotFound.
   337      * KErrNotFound.
   338      */
   338      */
   339     TUint32 GetBearerInfoIntL(
   339     TUint32 GetBearerInfoIntL(
   340             const TUint32& aBearerType,
   340             const TUint32 aBearerType,
   341             const TUint32& aAttribute );
   341             const TUint32 aAttribute );
   342 
   342 
   343     /**
   343     /**
   344      * Returns bearer specific boolean value. IAP does not need to be loaded for this.
   344      * Returns bearer specific boolean value. IAP does not need to be loaded for this.
   345      * @param aBearerType The type of the plugin to be asked.
   345      * @param aBearerType The type of the plugin to be asked.
   346      * @param aAttribute The identifier of the requested value.
   346      * @param aAttribute The identifier of the requested value.
   347      * @return Returns the requested boolean value if found. Otherwise leaves with error code
   347      * @return Returns the requested boolean value if found. Otherwise leaves with error code
   348      * KErrNotFound.
   348      * KErrNotFound.
   349      */
   349      */
   350     TBool GetBearerInfoBoolL(
   350     TBool GetBearerInfoBoolL(
   351             const TUint32& aBearerType,
   351             const TUint32 aBearerType,
   352             const TUint32& aAttribute );
   352             const TUint32 aAttribute );
   353 
   353 
   354     /**
   354     /**
   355      * Returns bearer specific 16 bit string value. IAP does not need to be loaded for this.
   355      * Returns bearer specific 16 bit string value. IAP does not need to be loaded for this.
   356      * @param aBearerType The type of the plugin to be asked.
   356      * @param aBearerType The type of the plugin to be asked.
   357      * @param aAttribute The identifier of the requested value.
   357      * @param aAttribute The identifier of the requested value.
   358      * @return Returns the requested string value if found. Otherwise leaves with error code
   358      * @return Returns the requested string value if found. Otherwise leaves with error code
   359      * KErrNotFound.
   359      * KErrNotFound.
   360      */
   360      */
   361     HBufC* GetBearerInfoStringL(
   361     HBufC* GetBearerInfoStringL(
   362             const TUint32& aBearerType,
   362             const TUint32 aBearerType,
   363             const TUint32& aAttribute );
   363             const TUint32 aAttribute );
   364 
   364 
   365     /**
   365     /**
   366      * Returns bearer specific 8 bit string value. IAP does not need to be loaded for this.
   366      * Returns bearer specific 8 bit string value. IAP does not need to be loaded for this.
   367      * @param aBearerType The type of the plugin to be asked.
   367      * @param aBearerType The type of the plugin to be asked.
   368      * @param aAttribute The identifier of the requested value.
   368      * @param aAttribute The identifier of the requested value.
   369      * @return Returns the requested string value if found. Otherwise leaves with error code
   369      * @return Returns the requested string value if found. Otherwise leaves with error code
   370      * KErrNotFound.
   370      * KErrNotFound.
   371      */
   371      */
   372     HBufC8* GetBearerInfoString8L(
   372     HBufC8* GetBearerInfoString8L(
   373             const TUint32& aBearerType,
   373             const TUint32 aBearerType,
   374             const TUint32& aAttribute );
   374             const TUint32 aAttribute );
       
   375 
       
   376     /**
       
   377      * Find and return a copy of a connection method item matching the given ID.
       
   378      * Returns KErrNotFound, if the connection method is not found.
       
   379      */
       
   380     TInt GetConnMethodItem(
       
   381             const TUint32 aConnMethodId,
       
   382             TCmmConnMethodItem& aConnMethodItem ) const;
   375 
   383 
   376     /**
   384     /**
   377      * Returns all conenction method IDs. Unsupported connection methods are
   385      * Returns all conenction method IDs. Unsupported connection methods are
   378      * included if aCheckBearerType is set to EFalse.
   386      * included if aCheckBearerType is set to EFalse.
   379      */
   387      */
   383 
   391 
   384     /**
   392     /**
   385      * Returns the number of destinations the provided connection method
   393      * Returns the number of destinations the provided connection method
   386      * belongs to.
   394      * belongs to.
   387      */
   395      */
   388     TInt DestinationsContainingConnMethod( const TUint32& aConnMethodId ) const;
   396     TInt DestinationsContainingConnMethod( const TUint32 aConnMethodId ) const;
   389 
   397 
   390     /**
   398     /**
   391      * Return the EasyWLAN IAP ID, zero if not found or WLAN not supported.
   399      * Return the EasyWLAN IAP ID, zero if not found or WLAN not supported.
   392      */
   400      */
   393     TUint32 EasyWlanIdL() const;
   401     TUint32 EasyWlanIdL() const;
   414 
   422 
   415     /**
   423     /**
   416      * Returns all the valid connection methods under given destination.
   424      * Returns all the valid connection methods under given destination.
   417      */
   425      */
   418     void GetConnMethodsFromDestinationL(
   426     void GetConnMethodsFromDestinationL(
   419             const TUint32& aDestinationId,
   427             const TUint32 aDestinationId,
   420             RArray<TCmmConnMethodItem>& aConnMethodArray ) const;
   428             RArray<TCmmConnMethodItem>& aConnMethodArray ) const;
   421 
   429 
   422     /**
   430     /**
   423      * Copies the bearer priority array's contents to aArray.
   431      * Copies the bearer priority array's contents to aArray.
   424      */
   432      */
   428      * Updates the bearer priority array with the contents of aArray.
   436      * Updates the bearer priority array with the contents of aArray.
   429      */
   437      */
   430     void UpdateBearerPriorityArrayL( const RPointerArray<CCmmBearerPriority>& aArray );
   438     void UpdateBearerPriorityArrayL( const RPointerArray<CCmmBearerPriority>& aArray );
   431 
   439 
   432     TBool ConnMethodInOtherDestination(
   440     TBool ConnMethodInOtherDestination(
   433             const TUint32& aConnMethodId,
   441             const TUint32 aConnMethodId,
   434             const TUint32& aDestinationId );
   442             const TUint32 aDestinationId );
   435     TUint32 NextFreeTemporaryId();
   443     TUint32 NextFreeTemporaryId();
   436 
   444 
   437     /**
   445     /**
   438      * Read general connection settings from database.
   446      * Read general connection settings from database.
   439      */
   447      */
   449      * connected.
   457      * connected.
   450      * @param aCmId Id of the connection method to be checked.
   458      * @param aCmId Id of the connection method to be checked.
   451      * @return Returns ETrue if the CM is connected and EFalse if it's not
   459      * @return Returns ETrue if the CM is connected and EFalse if it's not
   452      * connected.
   460      * connected.
   453      */
   461      */
   454     TBool CheckIfCmConnected( const TUint32& aCmId ) const;
   462     TBool CheckIfCmConnected( const TUint32 aCmId ) const;
   455 
   463 
   456     /**
   464     /**
   457      * Enumerates connections and checks if any of the connection methods in
   465      * Enumerates connections and checks if any of the connection methods in
   458      * the given destination is connected.
   466      * the given destination is connected.
   459      * If pointer to destination instance is given, then information about
   467      * If pointer to destination instance is given, then information about
   466 
   474 
   467     /**
   475     /**
   468      * Check from database if the given destination is an embedded destination
   476      * Check from database if the given destination is an embedded destination
   469      * in any other destination.
   477      * in any other destination.
   470      */
   478      */
   471     TBool DestinationIsEmbedded( const TUint32& aDestinationId ) const;
   479     TBool DestinationIsEmbedded( const TUint32 aDestinationId ) const;
   472 
   480 
   473     /**
   481     /**
   474      * Check from database if the given destination has an embedded destination.
   482      * Check from database if the given destination has an embedded destination.
   475      */
   483      */
   476     TBool DestinationHasEmbedded( const TUint32& aDestinationId ) const;
   484     TBool DestinationHasEmbedded( const TUint32 aDestinationId ) const;
   477 
   485 
   478     /**
   486     /**
   479      * Check from database if the given destination is pointed to by any
   487      * Check from database if the given destination is pointed to by any
   480      * virtual IAP.
   488      * virtual IAP.
   481      */
   489      */
   482     TBool DestinationPointedToByVirtualIap( const TUint32& aDestinationId ) const;
   490     TBool DestinationPointedToByVirtualIap( const TUint32 aDestinationId ) const;
   483 
   491 
   484     /**
   492     /**
   485      * Check from database if the given connection method is pointed to by any
   493      * Check from database if the given connection method is pointed to by any
   486      * virtual IAP.
   494      * virtual IAP.
   487      */
   495      */
   488     TBool ConnMethodPointedToByVirtualIap( const TUint32& aConnMethodId ) const;
   496     TBool ConnMethodPointedToByVirtualIap( const TUint32 aConnMethodId ) const;
   489 
   497 
   490     /**
   498     /**
   491      * Check if the given connection method is the only connection method in
   499      * Check if the given connection method is the only connection method in
   492      * the given destination and if a virtual IAP points to that destination.
   500      * the given destination and if a virtual IAP points to that destination.
   493      */
   501      */
   494     TBool ConnMethodInDestinationButLocked(
   502     TBool ConnMethodInDestinationButLocked(
   495             const TUint32& aConnMethodId,
   503             const TUint32 aConnMethodId,
   496             const TUint32& aDestinationId ) const;
   504             const TUint32 aDestinationId ) const;
   497 
   505 
   498     /**
   506     /**
   499      * Remove all references to the given connection method from the
   507      * Remove all references to the given connection method from the
   500      * datamobility selection policy records. Then update instance mapping to
   508      * datamobility selection policy records. Then update instance mapping to
   501      * reflect the current database state, and notify any possible client
   509      * reflect the current database state, and notify any possible client
   522      * connection methods are inside the destination need to be updated with
   530      * connection methods are inside the destination need to be updated with
   523      * real IDs for any newly created connection methods. These real IDs are
   531      * real IDs for any newly created connection methods. These real IDs are
   524      * held in the temporary array iUpdatedConnMethods until successful commit
   532      * held in the temporary array iUpdatedConnMethods until successful commit
   525      * to database. This method is used to find out those real IDs before that.
   533      * to database. This method is used to find out those real IDs before that.
   526      */
   534      */
   527     void TranslateTemporaryId( const TUint32& aTemporaryId, TUint32& aRealId ) const;
   535     void TranslateTemporaryId( const TUint32 aTemporaryId, TUint32& aRealId ) const;
   528 
   536 
   529     /**
   537     /**
   530      * Check if the given connection method can have all references removed and
   538      * Check if the given connection method can have all references removed and
   531      * made into an uncategorized connection method.
   539      * made into an uncategorized connection method.
   532      */
   540      */
   533     void CheckIfConnMethodReferencesCanBeRemovedL( const CCmmConnMethodInstance& aConnMethodInstance );
   541     void CheckIfConnMethodReferencesCanBeRemovedL(
       
   542             const CCmmConnMethodInstance& aConnMethodInstance );
   534 
   543 
   535     /**
   544     /**
   536      * Check if given connection method is referenced from any protected destination.
   545      * Check if given connection method is referenced from any protected destination.
   537      */
   546      */
   538     void CheckIfConnMethodBelongsToProtectedDestinationL(
   547     void CheckIfConnMethodBelongsToProtectedDestinationL(
   553      * Return the requested table ID.
   562      * Return the requested table ID.
   554      */
   563      */
   555     CommsDat::TMDBElementId TableId( TCmmDbRecords aRecord );
   564     CommsDat::TMDBElementId TableId( TCmmDbRecords aRecord );
   556 
   565 
   557 private:
   566 private:
   558     TInt FindDestinationFromCache( const TUint32& aId );
   567     TInt FindDestinationFromCache( const TUint32 aId );
   559     TInt FindNotSavedDestinationFromCacheL( const TDesC& aName, const TUint32& aDestinationId );
   568     TInt FindNotSavedDestinationFromCacheL( const TDesC& aName, const TUint32 aDestinationId );
   560 
   569 
   561     TInt FindConnMethodFromCache( const TUint32& aConnMethodId );
   570     TInt FindConnMethodFromCache( const TUint32 aConnMethodId );
   562 
   571 
   563     void ReplaceGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings );
   572     void ReplaceGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings );
   564 
   573 
   565     /**
   574     /**
   566      * Opens a transaction and deletes the given connection method.
   575      * Opens a transaction and deletes the given connection method.