epoc32/include/networkemulator/cnetworkemulatorsetupcommdb.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
     1.1 --- a/epoc32/include/networkemulator/cnetworkemulatorsetupcommdb.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/networkemulator/cnetworkemulatorsetupcommdb.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,101 +1,101 @@
     1.4 -/*
     1.5 -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 -* All rights reserved.
     1.7 -* This component and the accompanying materials are made available
     1.8 -* 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
     1.9 -* which accompanies this distribution, and is available
    1.10 -* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 -*
    1.12 -* Initial Contributors:
    1.13 -* Nokia Corporation - initial contribution.
    1.14 -*
    1.15 -* Contributors:
    1.16 -*
    1.17 -* Description: 
    1.18 -* CSetUpCommDb.h
    1.19 -*
    1.20 -*/
    1.21 -
    1.22 -
    1.23 -#ifndef _CSetUpCommDb_H
    1.24 -#define _CSetUpCommDb_H
    1.25 -
    1.26 -/*****************************************************************************
    1.27 - *
    1.28 - * System Includes 
    1.29 - *
    1.30 - ****************************************************************************/
    1.31 -#include <commdb.h> 
    1.32 -
    1.33 -/*****************************************************************************
    1.34 - *
    1.35 - * Local Includes
    1.36 - *
    1.37 - ****************************************************************************/
    1.38 -
    1.39 -/*****************************************************************************
    1.40 - *
    1.41 - *  Types
    1.42 - *
    1.43 - ****************************************************************************/
    1.44 -typedef enum {
    1.45 -	TCommDB_Success,
    1.46 -	TCommDB_ErrorInitCommDb,
    1.47 -	TCommDB_ErrorTableNotFound,
    1.48 -	TCommDB_ErrorUpdatingRecord,
    1.49 -	TCommDB_ErrorReadingRecord,
    1.50 -	TCommDB_ErrorColNotFound,
    1.51 -	TCommDB_ErrorColTypeValueNotSupported,
    1.52 -	TCommDB_ErrorConvertingToUnicode,
    1.53 -	TCommDB_ErrorUnexpectedColType,
    1.54 -	TCommDB_RecNotFound
    1.55 -}TCommDBError;
    1.56 -
    1.57 -typedef enum {
    1.58 -	TCOMMBD_IDLE,
    1.59 -	TCOMMBD_CONNECTED
    1.60 -}TCommDbStatus;
    1.61 -
    1.62 -/*****************************************************************************
    1.63 - *
    1.64 - * Class Definition
    1.65 - *
    1.66 - ****************************************************************************/
    1.67 -class CSetUpCommDb : public CBase
    1.68 -{
    1.69 -
    1.70 -public:
    1.71 -	// Constructor sets all member data to null
    1.72 -	IMPORT_C CSetUpCommDb();
    1.73 -
    1.74 -	// Deletes the pointer, sets it to null.
    1.75 -	IMPORT_C ~CSetUpCommDb();
    1.76 -
    1.77 -	// Method to initialise the database.
    1.78 -	IMPORT_C TCommDBError initialise(void);
    1.79 -	
    1.80 -	IMPORT_C TCommDBError updateEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, char* aFieldValue, int* aErrCode);	
    1.81 -
    1.82 -	IMPORT_C TCommDBError getAsciiEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TDes8& aFieldValue, int* aErrCode);
    1.83 -	IMPORT_C TCommDBError getUnicodeEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TDes16& aFieldValue, int* aErrCode);
    1.84 -	IMPORT_C TCommDBError getIntEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TUint32& aFieldValue, int* aErrCode);
    1.85 -	IMPORT_C TCommDBError getBoolEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TBool& aFieldValue, int* aErrCode);
    1.86 -
    1.87 -private:
    1.88 -	CCommsDbTableView* openTableL( CCommsDatabase *aDbComms, TPtrC aTable );
    1.89 -
    1.90 -	TCommDBError FindAndUpdateRecord( CCommsDbTableView *aTable, TUint32 aRecordID, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
    1.91 -	TCommDBError UpdateField( CCommsDbTableView *aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode );
    1.92 -	int SetUnicodeString(CCommsDbTableView* aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
    1.93 -	int SetUnicodeStringLong(CCommsDbTableView* aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
    1.94 -	HBufC16 *ConvertAsciiToUnicode( char *aAsciiString );
    1.95 -
    1.96 -	TCommDBError FindRecordAndGetType( CCommsDbTableView *aTable, TUint32 aRecordID, TPtrC aFieldName, TDbColType *aColType, int* aErrCode );
    1.97 -
    1.98 -
    1.99 -	CCommsDatabase *iDbComms;
   1.100 -	TCommDbStatus iStatus;
   1.101 -
   1.102 -};
   1.103 -
   1.104 -#endif
   1.105 +/*
   1.106 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
   1.107 +* All rights reserved.
   1.108 +* This component and the accompanying materials are made available
   1.109 +* 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
   1.110 +* which accompanies this distribution, and is available
   1.111 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
   1.112 +*
   1.113 +* Initial Contributors:
   1.114 +* Nokia Corporation - initial contribution.
   1.115 +*
   1.116 +* Contributors:
   1.117 +*
   1.118 +* Description: 
   1.119 +* CSetUpCommDb.h
   1.120 +*
   1.121 +*/
   1.122 +
   1.123 +
   1.124 +#ifndef _CSetUpCommDb_H
   1.125 +#define _CSetUpCommDb_H
   1.126 +
   1.127 +/*****************************************************************************
   1.128 + *
   1.129 + * System Includes 
   1.130 + *
   1.131 + ****************************************************************************/
   1.132 +#include <commdb.h> 
   1.133 +
   1.134 +/*****************************************************************************
   1.135 + *
   1.136 + * Local Includes
   1.137 + *
   1.138 + ****************************************************************************/
   1.139 +
   1.140 +/*****************************************************************************
   1.141 + *
   1.142 + *  Types
   1.143 + *
   1.144 + ****************************************************************************/
   1.145 +typedef enum {
   1.146 +	TCommDB_Success,
   1.147 +	TCommDB_ErrorInitCommDb,
   1.148 +	TCommDB_ErrorTableNotFound,
   1.149 +	TCommDB_ErrorUpdatingRecord,
   1.150 +	TCommDB_ErrorReadingRecord,
   1.151 +	TCommDB_ErrorColNotFound,
   1.152 +	TCommDB_ErrorColTypeValueNotSupported,
   1.153 +	TCommDB_ErrorConvertingToUnicode,
   1.154 +	TCommDB_ErrorUnexpectedColType,
   1.155 +	TCommDB_RecNotFound
   1.156 +}TCommDBError;
   1.157 +
   1.158 +typedef enum {
   1.159 +	TCOMMBD_IDLE,
   1.160 +	TCOMMBD_CONNECTED
   1.161 +}TCommDbStatus;
   1.162 +
   1.163 +/*****************************************************************************
   1.164 + *
   1.165 + * Class Definition
   1.166 + *
   1.167 + ****************************************************************************/
   1.168 +class CSetUpCommDb : public CBase
   1.169 +{
   1.170 +
   1.171 +public:
   1.172 +	// Constructor sets all member data to null
   1.173 +	IMPORT_C CSetUpCommDb();
   1.174 +
   1.175 +	// Deletes the pointer, sets it to null.
   1.176 +	IMPORT_C ~CSetUpCommDb();
   1.177 +
   1.178 +	// Method to initialise the database.
   1.179 +	IMPORT_C TCommDBError initialise(void);
   1.180 +	
   1.181 +	IMPORT_C TCommDBError updateEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, char* aFieldValue, int* aErrCode);	
   1.182 +
   1.183 +	IMPORT_C TCommDBError getAsciiEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TDes8& aFieldValue, int* aErrCode);
   1.184 +	IMPORT_C TCommDBError getUnicodeEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TDes16& aFieldValue, int* aErrCode);
   1.185 +	IMPORT_C TCommDBError getIntEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TUint32& aFieldValue, int* aErrCode);
   1.186 +	IMPORT_C TCommDBError getBoolEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TBool& aFieldValue, int* aErrCode);
   1.187 +
   1.188 +private:
   1.189 +	CCommsDbTableView* openTableL( CCommsDatabase *aDbComms, TPtrC aTable );
   1.190 +
   1.191 +	TCommDBError FindAndUpdateRecord( CCommsDbTableView *aTable, TUint32 aRecordID, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
   1.192 +	TCommDBError UpdateField( CCommsDbTableView *aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode );
   1.193 +	int SetUnicodeString(CCommsDbTableView* aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
   1.194 +	int SetUnicodeStringLong(CCommsDbTableView* aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
   1.195 +	HBufC16 *ConvertAsciiToUnicode( char *aAsciiString );
   1.196 +
   1.197 +	TCommDBError FindRecordAndGetType( CCommsDbTableView *aTable, TUint32 aRecordID, TPtrC aFieldName, TDbColType *aColType, int* aErrCode );
   1.198 +
   1.199 +
   1.200 +	CCommsDatabase *iDbComms;
   1.201 +	TCommDbStatus iStatus;
   1.202 +
   1.203 +};
   1.204 +
   1.205 +#endif