epoc32/include/networkemulator/cnetworkemulatorsetupcommdb.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * 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
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 * CSetUpCommDb.h
    16 *
    17 */
    18 
    19 
    20 #ifndef _CSetUpCommDb_H
    21 #define _CSetUpCommDb_H
    22 
    23 /*****************************************************************************
    24  *
    25  * System Includes 
    26  *
    27  ****************************************************************************/
    28 #include <commdb.h> 
    29 
    30 /*****************************************************************************
    31  *
    32  * Local Includes
    33  *
    34  ****************************************************************************/
    35 
    36 /*****************************************************************************
    37  *
    38  *  Types
    39  *
    40  ****************************************************************************/
    41 typedef enum {
    42 	TCommDB_Success,
    43 	TCommDB_ErrorInitCommDb,
    44 	TCommDB_ErrorTableNotFound,
    45 	TCommDB_ErrorUpdatingRecord,
    46 	TCommDB_ErrorReadingRecord,
    47 	TCommDB_ErrorColNotFound,
    48 	TCommDB_ErrorColTypeValueNotSupported,
    49 	TCommDB_ErrorConvertingToUnicode,
    50 	TCommDB_ErrorUnexpectedColType,
    51 	TCommDB_RecNotFound
    52 }TCommDBError;
    53 
    54 typedef enum {
    55 	TCOMMBD_IDLE,
    56 	TCOMMBD_CONNECTED
    57 }TCommDbStatus;
    58 
    59 /*****************************************************************************
    60  *
    61  * Class Definition
    62  *
    63  ****************************************************************************/
    64 class CSetUpCommDb : public CBase
    65 {
    66 
    67 public:
    68 	// Constructor sets all member data to null
    69 	IMPORT_C CSetUpCommDb();
    70 
    71 	// Deletes the pointer, sets it to null.
    72 	IMPORT_C ~CSetUpCommDb();
    73 
    74 	// Method to initialise the database.
    75 	IMPORT_C TCommDBError initialise(void);
    76 	
    77 	IMPORT_C TCommDBError updateEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, char* aFieldValue, int* aErrCode);	
    78 
    79 	IMPORT_C TCommDBError getAsciiEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TDes8& aFieldValue, int* aErrCode);
    80 	IMPORT_C TCommDBError getUnicodeEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TDes16& aFieldValue, int* aErrCode);
    81 	IMPORT_C TCommDBError getIntEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TUint32& aFieldValue, int* aErrCode);
    82 	IMPORT_C TCommDBError getBoolEntry(TPtrC aTable, TUint32 aRecordID, TPtrC aFieldName, TBool& aFieldValue, int* aErrCode);
    83 
    84 private:
    85 	CCommsDbTableView* openTableL( CCommsDatabase *aDbComms, TPtrC aTable );
    86 
    87 	TCommDBError FindAndUpdateRecord( CCommsDbTableView *aTable, TUint32 aRecordID, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
    88 	TCommDBError UpdateField( CCommsDbTableView *aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode );
    89 	int SetUnicodeString(CCommsDbTableView* aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
    90 	int SetUnicodeStringLong(CCommsDbTableView* aTable, TPtrC aFieldName, char* aFieldValue, int* aErrCode);
    91 	HBufC16 *ConvertAsciiToUnicode( char *aAsciiString );
    92 
    93 	TCommDBError FindRecordAndGetType( CCommsDbTableView *aTable, TUint32 aRecordID, TPtrC aFieldName, TDbColType *aColType, int* aErrCode );
    94 
    95 
    96 	CCommsDatabase *iDbComms;
    97 	TCommDbStatus iStatus;
    98 
    99 };
   100 
   101 #endif