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