commsfwtools/preparedefaultcommsdatabase/inc/CommsDatUtils.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Utility functions to retrieve comms data for specific use-cases and present it in a particular way.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalAll
       
    21  @released
       
    22 */
       
    23 #ifndef __COMMSDATUTILS_H__
       
    24 #define	__COMMSDATUTILS_H__
       
    25 
       
    26 #include <cdbcols.h>
       
    27 #include  <dial.h>
       
    28 #include <metadatabase.h>
       
    29 
       
    30 class CCommsDatUtilImpl;
       
    31 namespace CommsDatUtils
       
    32 
       
    33 {
       
    34 
       
    35 class CCommsDatUtils : public CBase
       
    36 	{
       
    37 	public :
       
    38 
       
    39 		IMPORT_C static CCommsDatUtils* NewL();
       
    40 
       
    41 		IMPORT_C ~CCommsDatUtils();
       
    42 
       
    43 		//  Set `aDialString` to be the appropriate string based on the directory
       
    44 		//	number, where the dial is being performed and the chargecard to use.
       
    45 		//	`ResolvePhoneNumberL()` opens a comms database to perform the
       
    46 		//	resolution
       
    47 		IMPORT_C static void ResolvePhoneNumberL(TDesC& aNumber, TDes& aDialString, TParseMode aDialParseMode, TUint32 aLocationId, TUint32 aChargecardId);
       
    48 
       
    49 		// Set `aDialString` to be the appropriate string based on the directory
       
    50 		//	number, where the dial is being performed and the chargecard to use.
       
    51 		IMPORT_C static void ResolvePhoneNumberFromDatabaseL(TDesC& aNumber, TDes& aDialString, TParseMode aDialParseMode, TUint32 aLocationId, TUint32 aChargecardId);
       
    52 
       
    53     	// Check access to database fields
       
    54 	    IMPORT_C TInt CheckReadCapability( const TDesC& aField, const RMessagePtr2* aMessage );
       
    55 
       
    56 	    IMPORT_C TInt CheckWriteCapability( const TDesC& aField, const RMessagePtr2* aMessage );
       
    57 
       
    58 	private:
       
    59 		CCommsDatUtils() {};
       
    60 		void ConstructL();
       
    61 
       
    62 	private :
       
    63 
       
    64 		CCommsDatUtilImpl* iUtilsImpl;
       
    65 	};
       
    66 
       
    67 
       
    68 #ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
    69 class NameLookUp
       
    70 	{
       
    71 	public:
       
    72 		/** Looks up the field specified and supplies a descriptor matching the name.
       
    73 		@param aElementId 	The field to look up.
       
    74 		@param aFieldName 	returns a pointer to the HBufC containing the string.
       
    75 		@param aDataType 	returns the data type of the found field.
       
    76 		@return The reversed value. */
       
    77 		IMPORT_C static TInt FieldNameLookup(CommsDat::TMDBElementId aElementId, HBufC*& aFieldName, TInt& aDataType );
       
    78 	private:
       
    79 		NameLookUp() {} // no construction since we are now private.
       
    80 	};
       
    81 #endif // SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
    82 
       
    83 
       
    84 
       
    85 } //end namespace CommsDat::utils
       
    86 
       
    87 
       
    88 #endif //__COMMSDATUTILS_H__