commsconfig/commsdatabaseshim/commdbshim/INC/CDBOVER.H
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2006-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @deprecated since v9.1. Functionality is replaced with commsdat.
       
    19 */
       
    20 
       
    21 #ifndef CDBOVER_H
       
    22 #define CDBOVER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <commdb.h>
       
    26 #include <cdbpreftable.h>
       
    27 
       
    28 class CCommDbOverride;
       
    29 class CCommDbLongDesOverride;
       
    30 class TCommDbIapConnectionPrefOverride;
       
    31 
       
    32 class CCommDbOverrideSettings : public CBase
       
    33 /** Repository of override settings for columns in tables.
       
    34 @deprecated
       
    35 	Overrides are deprecated from v9.1
       
    36 
       
    37 	Holds all information about CommDb overrides.
       
    38 	Allows the client to store, retrieve and test the existence of overrides.
       
    39 */
       
    40 	{
       
    41 public:
       
    42 	/** @deprecated v7.0
       
    43 
       
    44 	Override setting flags returned by PartialFull().
       
    45 	The only use of TParamList is during the comparison of two override sets. */
       
    46 	enum TParamList
       
    47 		{
       
    48 		/** The override settings are partial; the CCommDbOverrideSettings object maintains
       
    49 		override values for only some of the columns. */
       
    50 		EParamListPartial,
       
    51 		/** The override settings are full; the CCommDbOverrideSettings object maintains
       
    52 		override values for all columns */
       
    53 		EParamListFull
       
    54 		};
       
    55 
       
    56 	/** The value types that may be stored in as overrides
       
    57 		@deprecated
       
    58 			Overrides are deprecated from v9.1
       
    59 		@internalComponent "Could just use TDbColType" */
       
    60 	enum TValueType
       
    61 		{
       
    62 	/** a TUint32. */
       
    63 		EIntValue,
       
    64 	/** a TBool. */
       
    65 		EBoolValue,
       
    66 	/** a TDes8. */
       
    67 		EDes8Value,
       
    68 	/** a TDes16. */
       
    69 		EDes16Value,
       
    70 	/** a TDes. */
       
    71 		ELongDesValue,
       
    72 	/** Unkown type. */
       
    73 		EUnknownType
       
    74 		};
       
    75 
       
    76 public:
       
    77 	IMPORT_C static CCommDbOverrideSettings* NewL(TParamList aParamList);
       
    78 	IMPORT_C virtual ~CCommDbOverrideSettings();
       
    79 
       
    80 	// Setting override values in the override set
       
    81 	IMPORT_C TInt SetIntOverride(const TDesC& aTableName, const TDesC& aColumnName, TUint32 aValue);
       
    82 	IMPORT_C TInt SetBoolOverride(const TDesC& aTableName, const TDesC& aColumnName, TBool aValue);
       
    83 	IMPORT_C TInt SetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC8& aValue);
       
    84 	IMPORT_C TInt SetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC16& aValue);
       
    85 	IMPORT_C TInt SetLongDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC& aValue);
       
    86 
       
    87 	//  Getting override values from the override set. Returns `KErrNotFound` if the
       
    88 	//	column has not been overriden.
       
    89 	IMPORT_C TInt GetIntOverride(const TDesC& aTableName, const TDesC& aColumnName, TUint32& aValue);
       
    90 	IMPORT_C TInt GetBoolOverride(const TDesC& aTableName, const TDesC& aColumnName, TBool& aValue);
       
    91 	IMPORT_C TInt GetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes8& aValue);
       
    92 	IMPORT_C TInt GetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes16& aValue);
       
    93 	IMPORT_C TInt GetLongDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes& aValue);
       
    94 	IMPORT_C TInt GetLongDesOverrideLength(const TDesC& aTableName, const TDesC& aColumnName, TInt& aLength);
       
    95 
       
    96 	IMPORT_C TInt SetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref& aPref);
       
    97 
       
    98 	IMPORT_C TInt GetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref& aPref);
       
    99 
       
   100 	IMPORT_C TBool Compare(CCommDbOverrideSettings* aOverrides) const;
       
   101 
       
   102 	IMPORT_C TBool IsOverridden(const TDesC& aTableName, const TDesC& aColumnName, TValueType aType);
       
   103 
       
   104 	inline TParamList PartialFull() const;
       
   105 
       
   106 	IMPORT_C static CCommDbOverrideSettings* NewL(TParamList aParamList, TCommDbDatabaseType aDbType);
       
   107 
       
   108 	IMPORT_C TInt GetConnectionPreferenceOverride(CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref& aPref);		// will be deprecated in 7.0
       
   109 
       
   110 	IMPORT_C TInt SetConnectionPreferenceOverride(const CCommsDbConnectionPrefTableView::TCommDbIspConnectionPref& aPref);	// will be deprecated in 7.0
       
   111 
       
   112 protected:
       
   113 	CCommDbOverrideSettings(TParamList aParamList);
       
   114 	virtual void ConstructL();
       
   115 	TInt FindOverride(const TDesC& aTableName, const TDesC& aColumnName, TValueType aType) const;
       
   116 	TBool IllegalOverride(const TDesC& aTableName,  const TDesC& aColumnName) const;
       
   117 	void CheckL(const TDesC& aTableName, const TDesC& aColumnName, TValueType aType) const;
       
   118 	static TBool MatchIapOverride(const TCommDbIapConnectionPrefOverride& aFirst,
       
   119 								  const TCommDbIapConnectionPrefOverride& aSecond);
       
   120 protected:
       
   121 	TParamList iPartialFull;
       
   122 	RPointerArray<CCommDbOverride> iOverrides;
       
   123 	RArray<TCommDbIapConnectionPrefOverride> iIapOverrides;
       
   124 	CCommsDatabase* iDb;
       
   125 
       
   126 	};
       
   127 
       
   128 #include <cdbover.inl>
       
   129 
       
   130 #endif