Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

QlabDatabaseCashboxClient Class Reference
[Cashbox Related Classes]

#include <qlabdatabasecashboxclient.h>

List of all members.


Detailed Description

The QlabDatabaseCashboxClient provides an simpler interface to QlabDatabase class, which better fits cashbox management.

A strip was decided for 2 reasons:

QlabDatabaseCashboxClient provides basic QlabDatabase services, stripped from the multiple backend evaluator, abstract schema obliterator, polymorphic evaluator. On the other hand, it provides some interesting services such as checkUser() (without relying on the huge UserToAcl server class), a simple informMaster() to be used in lieu of the complex MPI messages or MultiWay routing schemes from servers plus some signals to interact with the cashbox logic.

Sample code can be found in labibm4694cashbox.cpp

Public Types

Public Slots

Signals

Public Member Functions

Private Member Functions

Private Attributes


Member Enumeration Documentation

enum QlabDatabaseCashboxClient::MasterConversation
 

Message Types between Cashbox and Server.

enum QlabDatabaseCashboxClient::Modes
 

Determines the active access mode to underlying data.

Note:
You'll have to check active mode when dealing with the object.
Enumeration values:
None  No access mode declared. Client will reject queries
Select  Read Mode. Client will agree with the select() method
Edit  Edit Mode. Client will allow adding data or editing current data
Delete  Delete Mode. Client will accept the del() method


Constructor & Destructor Documentation

QlabDatabaseCashboxClient::QlabDatabaseCashboxClient const QString &  tablename = 0,
QObject *  parent = 0,
char *  name = 0
 

Builds a new QlabDatabaseCashboxClient instance for tablename, with parent and with name.

This is the entry point for each and every cashbox to database connection to a table or an associative set.

Todo:
Document the underlying associative methods.

QlabDatabaseCashboxClient::~QlabDatabaseCashboxClient  ) 
 

Deletes a QlabDatabase instance


Member Function Documentation

void QlabDatabaseCashboxClient::create  )  [slot]
 

Creates an empty data set using the default values from the Data Collection descriptor.

Note:
a dataset may have associates with or without size constraints. You'll have to check the data definition schema to see what you get when using this method.

bool QlabDatabaseCashboxClient::createConnection const QString &  connectionName  )  [slot]
 

Creates the connection for the table.

If a connection to host/dbType/dbname has not yet been initiated, first init and check the connection. Else add this table to the connection list.

void QlabDatabaseCashboxClient::currentChanged int  recid  )  [signal]
 

Emited when the current data Item in Collection has been changed. The signal holds the recid ObjectID.

QString QlabDatabaseCashboxClient::defaultGetField  )  const [slot]
 

Returns the default Get Field association.

void QlabDatabaseCashboxClient::error MasterConversation  mc,
const QString &  msg
[signal]
 

Sends a MasterType and error message.

QSqlRecord * QlabDatabaseCashboxClient::first  )  [slot]
 

Returns the first logical record in dataset.

bool QlabDatabaseCashboxClient::get const QVariant &  itemInfo,
bool  unique = TRUE
[slot]
 

Retrieves a dataset from the backend using itemInfo discriminant.

The system will return TRUE if an itemset at least has been fetched.

bool QlabDatabaseCashboxClient::informMaster QlabDatabaseCashboxClient::MasterConversation  mc,
QObject *  clnt
[slot]
 

informs Master Server of some events data.

This allows for discussions between the Cashbox Client with master server. You have to pass a MasterConversation mc, and a clnt QObject. The method returns TRUE on success.

QSqlRecord * QlabDatabaseCashboxClient::last  )  [slot]
 

Returns the last logical record in dataset.

QSqlRecord * QlabDatabaseCashboxClient::next  )  [slot]
 

Returns the next logical record in dataset.

QSqlRecord * QlabDatabaseCashboxClient::seek int  pos  )  [slot]
 

Returns the pos logical record in dataset.

void QlabDatabaseCashboxClient::selectionChanged  )  [signal]
 

Selection from the data collection has changed.

int QlabDatabaseCashboxClient::sequenceGetNextValue  )  [slot]
 

Returns the next valid ObjectInstanceID.

void QlabDatabaseCashboxClient::setDefaultGetField const QString &  fld  )  [slot]
 

Sets the default Get Field to fld.

Note:
This should be scarsely used, as the deault system Get association uses the ObjectInstanceID (recid) field.
One can change this to another field only when the primary identifier is something else than standard ObjectInstanceID

void QlabDatabaseCashboxClient::setTableName const QString &  tblName  )  [slot]
 

Sets the base table name to tblNmae.

void QlabDatabaseCashboxClient::setup  )  [slot]
 

Setup fo the instance.

For internal use only.

This has be removed from constructor to allow reconfig when switching from one table to another with the same instance.

While reconfig is a very rarely used option, I had to deal with it to simplify GECIS model importers.

void QlabDatabaseCashboxClient::setValue const QString &  fld,
const QVariant &  value
[slot]
 

Sets the field fld to a value value.

Note:
If the value variant is invalid, it will be silently discarded, in compliance with the standard setValue() method.

uint QlabDatabaseCashboxClient::size  )  [slot]
 

Returns the dataset size (number of data items in group).

bool QlabDatabaseCashboxClient::store  )  [slot]
 

Stores a dataset to the backend.

The system will return TRUE if all of the set could be stored.

QString QlabDatabaseCashboxClient::tableName  )  const [slot]
 

Returns the base table name associated with this instance.

QVariant QlabDatabaseCashboxClient::value const QString &  fld  )  [slot]
 

Returns the value for the field fld as a QVariant.


Member Data Documentation

Modes QlabDatabaseCashboxClient::activeMode [private]
 

Holds the active mode

int QlabDatabaseCashboxClient::activeRecord [private]
 

Current active Record in set

QMap< QString, QlabDatabaseCashboxClient> QlabDatabaseCashboxClient::associations [private]
 

Holds data associations

QlabDatabaseCashboxClient_priv* QlabDatabaseCashboxClient::cursor [private]
 

V Cursor reference

QString QlabDatabaseCashboxClient::defGetField [private]
 

Place holder for the default Get Field name

QString QlabDatabaseCashboxClient::table [private]
 

Virtual table name place holder

 

L.A.B. Project © 2001-2004 LAB Project & DJ Anubis