Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <DAMDBMS.H>
Link against: damodl.lib
This item is not part of the S60 5th Edition SDK

Class CDaModel

Interface status: deprecated

class CDaModel : public CBase;

Description

Database application engine.

The class:

Derivation

Members

Defined in CDaModel:

Inherited from CBase:


Construction and destruction


NewL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C static CDaModel* NewL();

Description

Allocates and constructs a new database application engine.

Return value

CDaModel *

New database application engine


NewL(CFileStore &)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C static CDaModel* NewL(CFileStore &fileStore);

Description

Allocates and constructs a new database application engine, initialising it from a store holding a store database.

The store database is found in the specified store, and opened.

Parameters

CFileStore &fileStore

Store holding a store database

Return value

CDaModel *

New database application engine

[Top]


Member functions


Attach(MDaObserver *)

Interface status: deprecated Inherited from: CDaModel

inline void Attach(MDaObserver *aObserver);

Description

Sets a database application engine observer.

Parameters

MDaObserver *aObserver

Database application engine observer


CloseDatabase()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void CloseDatabase();

Description

Closes the object's store database if one is open.


NewDatabaseL(CStreamStore &)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void NewDatabaseL(CStreamStore &aStore);

Description

Creates and opens a new store database for the object.

The existing user column set is set for the new database.

Parameters

CStreamStore &aStore

Store in which to write the new store database


ExternalizeL(RWriteStream &)const

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Externalises the engine setttings to a stream.

Parameters

RWriteStream &aStream

Stream to which to write


InternalizeL(RReadStream &)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void InternalizeL(RReadStream &source);

Description

Internalises the engine setttings from a stream.

Parameters

RReadStream &source

Stream from which to read


OpenDatabaseL(CStreamStore &)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void OpenDatabaseL(CStreamStore &aStore);

Description

Opens an existing store database.

If a database is already open, it is closed.

Parameters

CStreamStore &aStore

Store holding a store database


OpenDatabaseL(RDbStoreDatabase &,CStreamStore &)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void OpenDatabaseL(RDbStoreDatabase &aDatabase, CStreamStore &aStore);

Description

Opens and returns an existing store database.

If a database is already open, it is closed.

Parameters

RDbStoreDatabase &aDatabase

On return, the opened database

CStreamStore &aStore

Store holding a store database


CloseView()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void CloseView();

Description

Closes the open database view and destroys the associated column set.


FirstL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void FirstL();

Description

Moves to the first row in the view.


LastL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void LastL();

Description

Moves to the last row in the view.


NextL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void NextL();

Description

Moves to the next row in the view.

If the position is already on the last row, it remains there.


PreviousL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void PreviousL();

Description

Moves to the previous row in the view.

If the position is already on the first row, it remains there.


MoveToRowL(TInt)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void MoveToRowL(TInt aRow);

Description

Moves to a specified row in the view.

If the requested row is greater than the last row, the position is set to the last row. If the requested row in less than the first row, the position is set to the first row.

Parameters

TInt aRow

Row to move to


IsValid()const

Interface status: deprecated Inherited from: CDaModel

inline TBool IsValid() const;

Description

Tests if a valid position in a valid view is set.

Return value

TBool

True if a valid view and position is set, otherwise false


DefaultIndexName()const

Interface status: deprecated Inherited from: CDaModel

inline const TPtrC& DefaultIndexName() const;

Description

Gets the default index name.

Return value

const TPtrC16 &

Default index name


AtRow()

Interface status: deprecated Inherited from: CDaModel

inline TInt AtRow();

Description

Gets the current row in the view.

Return value

TInt

Current row


HasRDbView()const

Interface status: deprecated Inherited from: CDaModel

inline TBool HasRDbView() const;

Description

Tests if a valid view is set.

Return value

TBool

True if a valid view is set, otherwise false


ViewHasRows()const

Interface status: deprecated Inherited from: CDaModel

inline TBool ViewHasRows() const;

Description

Tests if the view has any rows (i.e. is not empty).

Return value

TBool

True if the view has any rows, otherwise false


HasOpenDatabase()const

Interface status: deprecated Inherited from: CDaModel

inline TBool HasOpenDatabase() const;

Description

Tests if the object has an open database.

Return value

TBool

True if the object has an open database


DbRecordCount()const

Interface status: deprecated Inherited from: CDaModel

inline TInt DbRecordCount() const;

Description

Gets the stored record count variable (settable with CDaModel::SetDbRecordCountL()).

Return value

TInt

Record count


RowSetCount()const

Interface status: deprecated Inherited from: CDaModel

inline TInt RowSetCount() const;

Description

Gets the stored row set count variable (settable with CDaModel::SetRowSetCountL()).

Return value

TInt

Row set count


ColSet()const

Interface status: deprecated Inherited from: CDaModel

inline CDbColSet* ColSet() const;

Description

Gets the column definition set for the view.

Return value

CDbColSet *

Column definition set


UserDbDesc()const

Interface status: deprecated Inherited from: CDaModel

inline CDaUserDbDesc* UserDbDesc() const;

Description

Gets the object's database application helper object.

Return value

CDaUserDbDesc *

Database application helper object


CurrentRow()const

Interface status: deprecated Inherited from: CDaModel

inline TInt CurrentRow() const;

Description

Gets the stored current row variable (settable with CDaModel::SetCurrentRow(TInt)).

Return value

TInt

Current row


Database()

Interface status: deprecated Inherited from: CDaModel

inline RDbDatabase& Database();

Description

Gets the current database.

Return value

RDbDatabase &

Database


DbStreamId()const

Interface status: deprecated Inherited from: CDaModel

inline TStreamId DbStreamId() const;

Description

Gets the ID of the stream in the store holding the database.

Return value

TStreamId

Stream ID


RowPosState()const

Interface status: deprecated Inherited from: CDaModel

inline TState RowPosState() const;

Description

Gets the result of the last row traversal operation.

Return value

CDaModel::TState

Result of the last row traversal operation


SqlParams()const

Interface status: deprecated Inherited from: CDaModel

inline CDaSqlParams* SqlParams() const;

Description

Gets the SQL parameters object.

Return value

CDaSqlParams *

SQL parameters object


TableDef()const

Interface status: deprecated Inherited from: CDaModel

inline CDbColSet* TableDef() const;

Description

Gets the column definition set for the database table.

Return value

CDbColSet *

Column definition set


RecordStatsWin()

Interface status: deprecated Inherited from: CDaModel

inline MDaObserver* RecordStatsWin();

Description

Gets the database observer set through CDaModel::SetRecordStatsWin(MDaObserver *).

Return value

MDaObserver *

Database observer


View()

Interface status: deprecated Inherited from: CDaModel

inline RDbView& View();

Description

Gets the database view.

Return value

RDbView &

Database view


View()const

Interface status: deprecated Inherited from: CDaModel

inline const RDbView& View() const;

Description

Gets the database view (const overload).

Return value

const RDbView &

Database view


Observer()const

Interface status: deprecated Inherited from: CDaModel

inline MDaObserver* Observer() const;

Description

Gets the database observer set through CDaModel::Attach(MDaObserver *).

Return value

MDaObserver *

Database observer


UndoStack()const

Interface status: deprecated Inherited from: CDaModel

inline const CDaUndoStack& UndoStack() const;

Description

Gets the object's undo stack.

Return value

const CDaUndoStack &

Undo stack


YesNoArray()const

Interface status: deprecated Inherited from: CDaModel

inline const CDesCArray* YesNoArray() const;

Description

Gets the string array set by CDaModel::SetYesNoArray(const CDesCArray &).

The array is not used by the engine.

Return value

const CDesC16Array *

String array


SetDbColNo()

Interface status: deprecated Inherited from: CDaModel

inline void SetDbColNo();

Description

Sets the column number fields.


SetCurrentRow(TInt)

Interface status: deprecated Inherited from: CDaModel

inline void SetCurrentRow(TInt aCurrentRow);

Description

Sets the stored current row variable.

Parameters

TInt aCurrentRow

Current row


RowPosState(TState)

Interface status: deprecated Inherited from: CDaModel

inline void RowPosState(TState aState);

Description

Sets the result of the last row traversal operation.

Parameters

CDaModel::TState aState

Result of the last row traversal operation


SetDbRecordCountL()

Interface status: deprecated Inherited from: CDaModel

inline void SetDbRecordCountL();

Description

Sets the database record count variable to the number of rows in the current view.


SetRowSetCountL()

Interface status: deprecated Inherited from: CDaModel

inline void SetRowSetCountL();

Description

Sets the database row set count variable to the number of rows in the current view.


SetRecordStatsWin(MDaObserver *)

Interface status: deprecated Inherited from: CDaModel

inline void SetRecordStatsWin(MDaObserver *anObserver);

Description

Sets the statistics window database engine observer.

The observer is called for every Put() operation.

Parameters

MDaObserver *anObserver

Database engine observer


SetYesNoArray(const CDesCArray &)

Interface status: deprecated Inherited from: CDaModel

inline void SetYesNoArray(const CDesCArray &aYesNoArray);

Description

Sets the yes/no string array.

This is not used by the engine.

Parameters

const CDesC16Array &aYesNoArray

String array


AlterTable(CDaUserColSet *)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C TInt AlterTable(CDaUserColSet *aNewUserColSet);

Description

Changes the structure of a specified table in the database to the specified column set.

! for now

Parameters

CDaUserColSet *aNewUserColSet

Column set to change to

Return value

TInt

KErrNone

See also:


CreateDatabaseL(CDaUserColSet *)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void CreateDatabaseL(CDaUserColSet *aUserColSet);

Description

Creates a new database with a specified column set.

An already open database is closed.

Parameters

CDaUserColSet *aUserColSet

Column set


CreateDatabaseL(CStreamStore *,CDaUserColSet *)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void CreateDatabaseL(CStreamStore *aStore, CDaUserColSet *aUserColSet);

Description

Creates and opens a new database with a specified column set.

Parameters

CStreamStore *aStore

Store in which to store the database

CDaUserColSet *aUserColSet

Column set


CreateIndex(const TDesC &,CDbKey *)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C TInt CreateIndex(const TDesC &anIndexName, CDbKey *aCDbKey);

Description

Creates a new index with the specified key.

Parameters

const TDesC16 &anIndexName

The name of the index to create

CDbKey *aCDbKey

The key for the new index

Return value

TInt

KErrNone if successful, or a system-wide or DBMS error code

See also:


HowManySteps(RDbIncremental &,CDaUserColSet *)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C TInt HowManySteps(RDbIncremental &anAlterTable, CDaUserColSet *aNewUserColSet);

Description

Initiates an incremental table alteration operation on a database.

Parameters

RDbIncremental &anAlterTable

Database to alter

CDaUserColSet *aNewUserColSet

Column set to change to

Return value

TInt

The initial step count for the incremental operation. This value should be passed in to subsequent calls to RDbIncremental::NextL().


BuildViewL(const TDesC &)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void BuildViewL(const TDesC &aFindString);

Description

Builds a database view asynchronously from the specified search string.

Parameters

const TDesC16 &aFindString

Search string


BuildViewL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void BuildViewL();

Description

Builds a database view asynchronously from the last requested find string.


BuildViewSyncL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void BuildViewSyncL();

Description

Builds a database view synchronously from the last requested find string.


BuildViewSyncL(const TDesC &)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void BuildViewSyncL(const TDesC &aFindString);

Description

Builds a database view synchronously from the specified search string.

Parameters

const TDesC16 &aFindString

Search string


HandleFirstFindL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void HandleFirstFindL();

Description

Called by the SQL statement evaluator on finding the first result.


DeleteRowL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void DeleteRowL();

Description

Deletes the current row.

The delete operation is put on the undo stack.

It then moves to the next (or last) row in the view.

!! -1 if now rows in view


UndoDeleteRowL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void UndoDeleteRowL();

Description

Undoes the last delete operation.


GetL()

Interface status: deprecated Inherited from: CDaModel

inline void GetL();

Description

Gets the current row data for access using the view's column extractor functions.

See also:


PutL()

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void PutL();

Description

Completes the insertion of a row.

See also:


UpdateAllViewsL(MDaObserver::TNotification)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void UpdateAllViewsL(MDaObserver::TNotification=MDaObserver::EDefaultNotification);

Description

Sends a specified event to the database engine observer.

!late

Parameters

MDaObserver::TNotification

Event to send


GoToBookmarkL(const TDbBookmark &)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C void GoToBookmarkL(const TDbBookmark &aBookmark);

Description

! Only one view is active at any one time

Moves to the specified database bookmark.

Parameters

const TDbBookmark &aBookmark

Database bookmark


Panic(TInt)

Interface status: deprecated Inherited from: CDaModel

IMPORT_C static void Panic(TInt aReason);

Description

Produces a "DaModel" category panic.

Parameters

TInt aReason

Panic code

[Top]


Member enumerations


Enum TState

Interface status: deprecated

TState

Description

Row traversal states.

ETriedBeyondLast

Tried to move beyond last row.

ETriedBeforeFirst

Tried to move before first row.

EAtRow

Moved to the specified row.

ENotAtRow

Did not move to any row.

[Top]


Member data


iDebugWin

Interface status: deprecated Inherited from: CDaModel

MDaObserver * iDebugWin;

Description