CCommsDbTableView Class Reference

class CCommsDbTableView : public CBase

The view on a specific table in the database.

Includes the necessary behaviour for navigating through the records in the view and reading and writing to columns within a record.

Uses a CCommsDatabase and has an RDbView to read from and write to database. Created via CCommsDatabase::OpenTableLC() (which opens a view of all the records in the table) or one of the OpenViewLC...() functions (which open a specific view of the table):

CCommsDatabase::OpenTableLC()

CCommsDatabase::OpenViewMatchingUintLC()

CCommsDatabase::OpenViewMatchingBoolLC()

CCommsDatabase::OpenViewMatchingTextLC()

CCommsDatabase::OpenViewLC()

Note that the above five functions have been withdrawn in CCommsDatabase and are now implemented in CCommsDatabaseBase.

Inherits from

Public Member Functions
CCommsDbTableView(CCommsDatabaseBase &, const TDesC &)
~CCommsDbTableView()
IMPORT_C voidCancelRecordChanges()
CCommsDatabaseBase *Database()
IMPORT_C TIntDeleteRecord()
voidGetTableName(TDes &)
IMPORT_C TIntGotoFirstRecord()
IMPORT_C TIntGotoNextRecord()
IMPORT_C TIntGotoPreviousRecord()
IMPORT_C TIntInsertCopyRecord(TUint32 &)
IMPORT_C TIntInsertRecord(TUint32 &)
CCommsDbTableView *NewL(CCommsDatabaseBase &, const TDesC &, const TDbQuery &, TBool)
CCommsDbTableView *NewL(CCommsDatabaseBase &, const TDesC &, const TDesC &, const TDesC8 &)
CCommsDbTableView *NewL(CCommsDatabaseBase &, const TDesC &, const TDesC &, const TDesC16 &)
CCommsDbTableView *NewL(CCommsDatabaseBase &, const TDesC &, const TDesC &, TUint32)
CCommsDbTableView *NewLC(const TDesC &, CCommsDatabaseBase &)
CCommsDbTableView *NewLC(CCommsDatabaseBase &, const TDesC &, TBool)
CCommsDbTableView *NewLC(CCommsDatabaseBase &, const TDesC &, const TDesC &, TBool)
CCommsDbTableView *NewLC(CCommsDatabaseBase &, TUint32, TCommDbConnectionDirection)
CCommsDbTableView *NewLC(CCommsDatabaseBase &, TUint32)
CCommsDbTableView *NewLC(CCommsDatabaseBase &, TUint32, const TDesC &)
voidOpenL(const TDbQuery &)
IMPORT_C TIntPutRecordChanges(TBool, TBool)
IMPORT_C voidReadBoolL(const TDesC &, TBool &)
IMPORT_C voidReadColumnLengthL(const TDesC &, TInt &)
IMPORT_C voidReadColumnMaxLengthL(const TDesC &, TInt &)
IMPORT_C HBufC *ReadLongTextLC(const TDesC &)
IMPORT_C voidReadTextL(const TDesC &, TDes8 &)
IMPORT_C voidReadTextL(const TDesC &, TDes16 &)
IMPORT_C voidReadTypeAttribL(const TDesC &, TDbColType &, TUint32 &)
IMPORT_C voidReadUintL(const TDesC &, TUint32 &)
IMPORT_C voidSetNullL(const TDesC &)
IMPORT_C TIntUpdateRecord()
IMPORT_C voidWriteBoolL(const TDesC &, const TBool &)
IMPORT_C voidWriteLongTextL(const TDesC &, const TDesC &)
IMPORT_C voidWriteTextL(const TDesC &, const TDesC8 &)
IMPORT_C voidWriteTextL(const TDesC &, const TDesC16 &)
IMPORT_C voidWriteUintL(const TDesC &, const TUint32 &)
Protected Member Functions
voidClose()
TDbColNo ColNumL(const TDesC &)
voidConstructL(const TDesC &, TBool, TBool)
voidConstructL(const TDbQuery &, TBool)
voidConstructL(const TDesC &, const TDesC &, const TDesC8 &)
voidConstructL(const TDesC &, const TDesC &, const TDesC16 &)
voidConstructL(const TDesC &, const TDesC &, TUint32)
voidConstructL(const TDesC &, const TDesC &, TBool)
voidConstructL(TUint32, TCommDbConnectionDirection)
voidConstructL(TUint32)
voidConstructL(TUint32, const TDesC &)
voidConstructL(const TDesC &)
RDbRowSet::TAccess GetL()
Private Member Functions
TInt DoInsertRecord(TBool, TUint32 &, TBool)
TInt DoPutRecordChanges(TBool, TBool, TBool)
TInt InsertTemplateRecord()
TBool TableWithTemplateRecord()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enumTTableState { EClosed, EOpenIdle, EInsert, EUpdate }
Protected Attributes
CCommsDatabaseBase &iDb
CCommDbTableExtension *iTableExt
TBuf< KCommsDbSvrMaxColumnNameLength >iTableName
RDbView iTableView
Private Attributes
TUint32 iCurrentId
TUint32 iInsertedRecordIndex
TTableState iState
CCommsDbTemplateRecord *iTemplate
TBool iTsyNameChanged

Constructor & Destructor Documentation

CCommsDbTableView(CCommsDatabaseBase &, const TDesC &)

CCommsDbTableView(CCommsDatabaseBase &aDb,
const TDesC &aTableName
)

Parameters

CCommsDatabaseBase & aDb
const TDesC & aTableName

~CCommsDbTableView()

IMPORT_C~CCommsDbTableView()[virtual]

Member Functions Documentation

CancelRecordChanges()

IMPORT_C voidCancelRecordChanges()

Close()

voidClose()[protected]

ColNumL(const TDesC &)

TDbColNo ColNumL(const TDesC &aColumn)const [protected]

Parameters

const TDesC & aColumn

ConstructL(const TDesC &, TBool, TBool)

voidConstructL(const TDesC &aTableName,
TBoolaShowHidden,
TBoolaUseTemplate
)[protected]

Parameters

const TDesC & aTableName
TBool aShowHidden
TBool aUseTemplate

ConstructL(const TDbQuery &, TBool)

voidConstructL(const TDbQuery &aQuery,
TBoolaUseTemplate
)[protected]

Parameters

const TDbQuery & aQuery
TBool aUseTemplate

ConstructL(const TDesC &, const TDesC &, const TDesC8 &)

voidConstructL(const TDesC &aTableName,
const TDesC &aColumnToMatch,
const TDesC8 &aValueToMatch
)[protected]

Parameters

const TDesC & aTableName
const TDesC & aColumnToMatch
const TDesC8 & aValueToMatch

ConstructL(const TDesC &, const TDesC &, const TDesC16 &)

voidConstructL(const TDesC &aTableName,
const TDesC &aColumnToMatch,
const TDesC16 &aValueToMatch
)[protected]

Parameters

const TDesC & aTableName
const TDesC & aColumnToMatch
const TDesC16 & aValueToMatch

ConstructL(const TDesC &, const TDesC &, TUint32)

voidConstructL(const TDesC &aTableName,
const TDesC &aColumnToMatch,
TUint32aValueToMatch
)[protected]

Parameters

const TDesC & aTableName
const TDesC & aColumnToMatch
TUint32 aValueToMatch

ConstructL(const TDesC &, const TDesC &, TBool)

voidConstructL(const TDesC &aTableName,
const TDesC &aColumnToMatch,
TBoolaValueToMatch
)[protected]

Parameters

const TDesC & aTableName
const TDesC & aColumnToMatch
TBool aValueToMatch

ConstructL(TUint32, TCommDbConnectionDirection)

voidConstructL(TUint32aBearerSet,
TCommDbConnectionDirectionaDirection
)[protected]

Parameters

TUint32 aBearerSet
TCommDbConnectionDirection aDirection

ConstructL(TUint32)

voidConstructL(TUint32aNetworkId)[protected]

Parameters

TUint32 aNetworkId

ConstructL(TUint32, const TDesC &)

voidConstructL(TUint32aServiceId,
const TDesC &aServiceType
)[protected]

Parameters

TUint32 aServiceId
const TDesC & aServiceType

ConstructL(const TDesC &)

voidConstructL(const TDesC &aTableName)[protected]

Parameters

const TDesC & aTableName

Database()

CCommsDatabaseBase *Database()const [inline]

DeleteRecord()

IMPORT_C TIntDeleteRecord()

DoInsertRecord(TBool, TUint32 &, TBool)

TInt DoInsertRecord(TBoolaType,
TUint32 &aId,
TBoolaIsTemplate
)[private]

Parameters

TBool aType
TUint32 & aId
TBool aIsTemplate

DoPutRecordChanges(TBool, TBool, TBool)

TInt DoPutRecordChanges(TBoolaHidden = EFalse,
TBoolaReadOnly = EFalse,
TBoolaIsTemplateCall = EFalse
)[private]

Parameters

TBool aHidden = EFalse
TBool aReadOnly = EFalse
TBool aIsTemplateCall = EFalse

GetL()

RDbRowSet::TAccess GetL()[protected]

GetTableName(TDes &)

voidGetTableName(TDes &aTableName)const [inline]

Gets the name of the table associated with this view and copies it into the descriptor supplied by the caller.

Parameters

TDes & aTableNameA reference to a descriptor passed by the caller. On return from this function it contains the name of the table.

GotoFirstRecord()

IMPORT_C TIntGotoFirstRecord()

GotoNextRecord()

IMPORT_C TIntGotoNextRecord()

GotoPreviousRecord()

IMPORT_C TIntGotoPreviousRecord()

InsertCopyRecord(TUint32 &)

IMPORT_C TIntInsertCopyRecord(TUint32 &aId)

Add a new record to this table. Filling all empty fields with values copied from record currently pointed at. The record number is returned. `PutRecordChanges()` is called to complete the transaction

Parameters

TUint32 & aId

InsertRecord(TUint32 &)

IMPORT_C TIntInsertRecord(TUint32 &aId)

Parameters

TUint32 & aId

InsertTemplateRecord()

TInt InsertTemplateRecord()[private]

NewL(CCommsDatabaseBase &, const TDesC &, const TDbQuery &, TBool)

CCommsDbTableView *NewL(CCommsDatabaseBase &aDb,
const TDesC &aTableName,
const TDbQuery &aQuery,
TBoolaUseTemplate = ETrue
)[static]

Parameters

CCommsDatabaseBase & aDb
const TDesC & aTableName
const TDbQuery & aQuery
TBool aUseTemplate = ETrue

NewL(CCommsDatabaseBase &, const TDesC &, const TDesC &, const TDesC8 &)

CCommsDbTableView *NewL(CCommsDatabaseBase &aDb,
const TDesC &aTableName,
const TDesC &aColumnToMatch,
const TDesC8 &aValueToMatch
)[static]

Parameters

CCommsDatabaseBase & aDb
const TDesC & aTableName
const TDesC & aColumnToMatch
const TDesC8 & aValueToMatch

NewL(CCommsDatabaseBase &, const TDesC &, const TDesC &, const TDesC16 &)

CCommsDbTableView *NewL(CCommsDatabaseBase &aDb,
const TDesC &aTableName,
const TDesC &aColumnToMatch,
const TDesC16 &aValueToMatch
)[static]

Parameters

CCommsDatabaseBase & aDb
const TDesC & aTableName
const TDesC & aColumnToMatch
const TDesC16 & aValueToMatch

NewL(CCommsDatabaseBase &, const TDesC &, const TDesC &, TUint32)

CCommsDbTableView *NewL(CCommsDatabaseBase &aDb,
const TDesC &aTableName,
const TDesC &aColumnToMatch,
TUint32aValueToMatch
)[static]

Parameters

CCommsDatabaseBase & aDb
const TDesC & aTableName
const TDesC & aColumnToMatch
TUint32 aValueToMatch

NewLC(const TDesC &, CCommsDatabaseBase &)

CCommsDbTableView *NewLC(const TDesC &aTableName,
CCommsDatabaseBase &aDb
)[static]

Parameters

const TDesC & aTableName
CCommsDatabaseBase & aDb

NewLC(CCommsDatabaseBase &, const TDesC &, TBool)

CCommsDbTableView *NewLC(CCommsDatabaseBase &aDb,
const TDesC &aTableName,
TBoolaUseTamplate = ETrue
)[static]

Parameters

CCommsDatabaseBase & aDb
const TDesC & aTableName
TBool aUseTamplate = ETrue

NewLC(CCommsDatabaseBase &, const TDesC &, const TDesC &, TBool)

CCommsDbTableView *NewLC(CCommsDatabaseBase &aDb,
const TDesC &aTableName,
const TDesC &aColumnToMatch,
TBoolaValueToMatch
)[static]

Parameters

CCommsDatabaseBase & aDb
const TDesC & aTableName
const TDesC & aColumnToMatch
TBool aValueToMatch

NewLC(CCommsDatabaseBase &, TUint32, TCommDbConnectionDirection)

CCommsDbTableView *NewLC(CCommsDatabaseBase &aDb,
TUint32aBearerSet,
TCommDbConnectionDirectionaDirection
)[static]

Parameters

CCommsDatabaseBase & aDb
TUint32 aBearerSet
TCommDbConnectionDirection aDirection

NewLC(CCommsDatabaseBase &, TUint32)

CCommsDbTableView *NewLC(CCommsDatabaseBase &aDb,
TUint32aNetworkId
)[static]

Parameters

CCommsDatabaseBase & aDb
TUint32 aNetworkId

NewLC(CCommsDatabaseBase &, TUint32, const TDesC &)

CCommsDbTableView *NewLC(CCommsDatabaseBase &aDb,
TUint32aServiceId,
const TDesC &aServiceType
)[static]

Parameters

CCommsDatabaseBase & aDb
TUint32 aServiceId
const TDesC & aServiceType

OpenL(const TDbQuery &)

voidOpenL(const TDbQuery &aQuery)

Parameters

const TDbQuery & aQuery

PutRecordChanges(TBool, TBool)

IMPORT_C TIntPutRecordChanges(TBoolaHidden = EFalse,
TBoolaReadOnly = EFalse
)

Parameters

TBool aHidden = EFalse
TBool aReadOnly = EFalse

ReadBoolL(const TDesC &, TBool &)

IMPORT_C voidReadBoolL(const TDesC &aColumn,
TBool &aValue
)

Parameters

const TDesC & aColumn
TBool & aValue

ReadColumnLengthL(const TDesC &, TInt &)

IMPORT_C voidReadColumnLengthL(const TDesC &aColumn,
TInt &aLength
)

Parameters

const TDesC & aColumn
TInt & aLength

ReadColumnMaxLengthL(const TDesC &, TInt &)

IMPORT_C voidReadColumnMaxLengthL(const TDesC &aColumn,
TInt &aLength
)

Parameters

const TDesC & aColumn
TInt & aLength

ReadLongTextLC(const TDesC &)

IMPORT_C HBufC *ReadLongTextLC(const TDesC &aColumn)

Parameters

const TDesC & aColumn

ReadTextL(const TDesC &, TDes8 &)

IMPORT_C voidReadTextL(const TDesC &aColumn,
TDes8 &aValue
)

Parameters

const TDesC & aColumn
TDes8 & aValue

ReadTextL(const TDesC &, TDes16 &)

IMPORT_C voidReadTextL(const TDesC &aColumn,
TDes16 &aValue
)

Parameters

const TDesC & aColumn
TDes16 & aValue

ReadTypeAttribL(const TDesC &, TDbColType &, TUint32 &)

IMPORT_C voidReadTypeAttribL(const TDesC &aColumn,
TDbColType &aColType,
TUint32 &aAttrib
)

Parameters

const TDesC & aColumn
TDbColType & aColType
TUint32 & aAttrib

ReadUintL(const TDesC &, TUint32 &)

IMPORT_C voidReadUintL(const TDesC &aColumn,
TUint32 &aValue
)

Parameters

const TDesC & aColumn
TUint32 & aValue

SetNullL(const TDesC &)

IMPORT_C voidSetNullL(const TDesC &aColumn)

Parameters

const TDesC & aColumn

TableWithTemplateRecord()

TBool TableWithTemplateRecord()const [private]

UpdateRecord()

IMPORT_C TIntUpdateRecord()

Modify the current record of this view. `PutRecordChanges()` is called to complete the transaction

WriteBoolL(const TDesC &, const TBool &)

IMPORT_C voidWriteBoolL(const TDesC &aColumn,
const TBool &aValue
)

Parameters

const TDesC & aColumn
const TBool & aValue

WriteLongTextL(const TDesC &, const TDesC &)

IMPORT_C voidWriteLongTextL(const TDesC &aColumn,
const TDesC &aValue
)

Parameters

const TDesC & aColumn
const TDesC & aValue

WriteTextL(const TDesC &, const TDesC8 &)

IMPORT_C voidWriteTextL(const TDesC &aColumn,
const TDesC8 &aValue
)

Parameters

const TDesC & aColumn
const TDesC8 & aValue

WriteTextL(const TDesC &, const TDesC16 &)

IMPORT_C voidWriteTextL(const TDesC &aColumn,
const TDesC16 &aValue
)

Parameters

const TDesC & aColumn
const TDesC16 & aValue

WriteUintL(const TDesC &, const TUint32 &)

IMPORT_C voidWriteUintL(const TDesC &aColumn,
const TUint32 &aValue
)

Parameters

const TDesC & aColumn
const TUint32 & aValue

Member Enumerations Documentation

Enum TTableState

Enumerators

EClosed
EOpenIdle
EInsert
EUpdate

Member Data Documentation

TUint32 iCurrentId

TUint32 iCurrentId[private]

CCommsDatabaseBase & iDb

CCommsDatabaseBase &iDb[protected]

TUint32 iInsertedRecordIndex

TUint32 iInsertedRecordIndex[private]

TTableState iState

TTableState iState[private]

CCommDbTableExtension * iTableExt

CCommDbTableExtension *iTableExt[protected]

TBuf< KCommsDbSvrMaxColumnNameLength > iTableName

TBuf< KCommsDbSvrMaxColumnNameLength >iTableName[protected]

RDbView iTableView

RDbView iTableView[protected]

CCommsDbTemplateRecord * iTemplate

CCommsDbTemplateRecord *iTemplate[private]

TBool iTsyNameChanged

TBool iTsyNameChanged[private]