gSAFE  1.3.8
Public Slots | Signals | Public Member Functions | Public Attributes | Protected Attributes | List of all members
HList Class Reference

#include <datalib.h>

Inheritance diagram for HList:
HTableBase HSqlHandler HSqlInterface HBase HFloatTablesAsHList

Public Slots

int actLine (void)
 
int alternateActLine (void)
 
int captureNotify (QString tblname)
 
virtual int clearList (void)
 
virtual int readList (QString filter="", bool all=true)
 
int reReadList (void)
 
- Public Slots inherited from HTableBase
void addDependTableName (QString n)
 
int errorPassSlot (QString err)
 

Signals

void actionOnRecord (QString key)
 
void alternateActionOnRecord (QString key)
 
- Signals inherited from HTableBase
void dataChanged (void)
 
void dataModifiedSignal (void)
 
void dataUpdatedSignal (void)
 
void doWorking (void)
 
void endWorking (void)
 
void startWorking (void)
 
- Signals inherited from HSqlHandler
void errorSignal (QString err)
 

Public Member Functions

 HList (QString t)
 
 HList (HList *t)
 
 ~HList (void)
 
QString activeKey (void)
 
void deepcopy_from_hlist (HList *x)
 
virtual QStringList * getKeys (void)
 
virtual QString getSqlFieldValue (QString sqln)
 
virtual QList< QStringList * > * getValues (void)
 
QString operator[] (int i)
 
QString queryCurrKey (void)
 
QStringList * queryCurrValues (void)
 
QString queryNextKey (void)
 
bool queryNextRecord (void)
 
QStringList * queryNextValues (void)
 
void queryToFirst (void)
 
int recordCount (void)
 
void setActiveKey (QString k)
 
- Public Member Functions inherited from HTableBase
 HTableBase (QString t)
 
 HTableBase (HTableBase *t)
 
 ~HTableBase (void)
 
void addField (HDataField *i)
 
void blockReInitializeBase (QString hide_marker, QString ro_marker)
 
void clearAndFreeConnections (void)
 
void clearConnections (void)
 
void clearRoles (void)
 
void clearSqlSynced (void)
 
void connectTable (HTableBase *ct, int type=INNER_JOIN, QString connconstraint="")
 
void connectTable (HTableBase *ct, QString thiskey, QString thatkey, int type=INNER_JOIN, QString connconstraint="")
 
void dataUpdated (void)
 
void deepcopy_from_htablebase (HTableBase *x)
 
void delRole (QString name)
 
HDataFieldfieldByIndex (int i, bool all=false)
 
HDataFieldfieldBySqlName (QString sqln, bool all=false, QString containerSqlTable="")
 
int fieldCount (bool withconnect=false)
 
void firstField (void)
 
void freeTable (void)
 
QStringList getExplainHeads (void)
 
QStringList getHeads (int what)
 
QStringList getShortTitleHeads (void)
 
bool isChanged (bool all=false)
 
bool isReallyChanged (void)
 
HDataFieldnextField (void)
 
HDataFieldnextFieldAll (void)
 
QVariant operator[] (int i)
 
void removeSqlCooseButtons (void)
 
void resetLogging (void)
 
void returnToDefaultAllMarked (QString mark)
 
void setAllNOSet (void)
 
void setAllYESSet (void)
 
void setColor (int r, int g, int b)
 
void setColorAllMarked (QString mark, int r, int g, int b)
 
void setEditable (void)
 
void setEditableAllMarked (QString mark)
 
void setGuiDisabledAllMarked (QString mark)
 
void setGuiEnabledAllMarked (QString mark)
 
void setHide (void)
 
void setHideAllMarked (QString mark)
 
void setLogging (void)
 
void setLoggingAllMarked (QString mark)
 
void setReadolnyAllMarked (QString mark)
 
void setReadonly (void)
 
void setShow (void)
 
void setShowAllMarked (QString mark)
 
void setTableTitle (QString s)
 
QString sqlCreateString (QString switches="")
 
QString sqlSelect (QString tail="", bool all=false, bool keypart=false)
 
QString sqlSelectAll (QString tail="")
 
QString sqlSelectWk (QString tail="", bool all=false)
 
QString sqlSelectWkAll (QString tail="")
 
void sqlSynced (HDataChangeLogger *dclog=NULL, bool forcechange=false, bool forcelog=false)
 
QString sqlTableName (void)
 
HDataFieldstaticFieldByTitle (QString title="")
 
QString tableTitle (void)
 
void useRole (QString name)
 
QString validate (bool all=true)
 
- Public Member Functions inherited from HSqlHandler
 HSqlHandler (void)
 
 ~HSqlHandler (void)
 
QSqlQuery * allocateQSqlQuery (void)
 
void cloneSqlSettingsFrom (HSqlHandler *other)
 
void commit (void)
 
bool errorStatus (void)
 
void rollback (void)
 
bool submit0ResultQuery (QString q, QString err, bool tdisabled=false)
 
QVariant submit1ResultQuery (QString q, QString err, bool tdisabled=false)
 
HPlainDataMatrixsubmitNResultQuery (int N, QString q, QString err, bool tdisabled=false)
 
void transaction (void)
 
QSqlDatabase workDB (void)
 
- Public Member Functions inherited from HSqlInterface
 HSqlInterface ()
 
 ~HSqlInterface ()
 
void cloneSqlInterfaceSettingsFrom (HSqlInterface *other)
 
HSqlSingleInterfacemyInterface (void)
 
QString sqlConcatenateToLocal (QString string)
 
QString sqlConcatenateToLocal (QStringList fields)
 
- Public Member Functions inherited from HBase
 HBase (void)
 
 ~HBase (void)
 
QString getWhoami (void)
 

Public Attributes

bool last_all
 
QString last_filter
 
QString soft_current_key
 
- Public Attributes inherited from HTableBase
QString errstr
 
bool extrafeatures
 
bool gui_showtabletitle
 

Protected Attributes

QString active_key
 
QStringList * keys
 
QStringList::iterator query_keyiter
 
QList< QStringList * >::iterator query_valiter
 
QList< QStringList * > * values
 
- Protected Attributes inherited from HTableBase
QString conn_part
 
QStack< HTableBase * > * connectedTableBases
 
QStringList * depend
 
int field
 
QString imc_thatkey
 
HTableBaseimc_thattable
 
QString imc_thiskey
 
HDataField_List * run
 
QString sqlTable
 
HDataField_List * table
 
QString tabletitle
 
- Protected Attributes inherited from HSqlHandler
bool query_error_occured
 
- Protected Attributes inherited from HBase
QString whoami
 

Additional Inherited Members

- Static Public Member Functions inherited from HSqlHandler
static void setCustomSqlDatabase (QString databaseName, QString sqlinterfacename="")
 
static void setDefaultSqlDatabase (void)
 
- Static Public Member Functions inherited from HSqlInterface
static HSqlSingleInterfacecurrentDefaultSqlInterface (void)
 
static HSqlSingleInterfacegetSqlInterface (QString interfacename)
 
static void setSqlMode (QString modename)
 
static void setSqlModeBackToFirst (void)
 
- Static Public Attributes inherited from HSqlHandler
static int trans = 0
 

Detailed Description

The HList holds a complete sql table or a subset of a table in readonly mode. It contains more record, and you can browse this records, but you can't edit anything.

hlist.png

This is the base class to browse/search/show the list of elements to the user.
The class have a cursor which points to a record. (The user can select a record with this cursor) The keys is usally the HKey fields. So in details the list is contains records which means that we have a key list and a value array list. The key is used to select a record. (For cursor selection, etc) The value array list is the values of the sql table itself. An value array means a sql record values, so the HList contains the list of these value arrays, this is the data to show on display. This class appear in gui as table view (HDispList class), and also can be send to printer or xml excel table.
This list also can be a connected table. (see HTableBase)
The HList is showed by HDispList in gui, looks like this way:

htablebrowser.png
See Also
HTableBase

Definition at line 1756 of file datalib.h.

Constructor & Destructor Documentation

HList::HList ( QString  t)

Constructor. Creates an empty list.

Parameters
tthe sql name of the related sql table

Definition at line 4396 of file datalib.cpp.

HList::~HList ( void  )

Destructor.

Definition at line 4419 of file datalib.cpp.

HList::HList ( HList t)

Deepcopy constructor. It clones the parameter HList to itself. It copies the full data structure and state and attributes and values of the parameter table. But connected tables is not copied neither the connection data. Only the base table is copied! If you would like to copy a whole connected table you have to copy the tables one by one, and connect them again.

Parameters
xthe source list

Definition at line 4434 of file datalib.cpp.

Member Function Documentation

void HList::actionOnRecord ( QString  key)
signal

This signal is emitted when the user (left) clicked on a record (Can be emitted directly by slot actLine() )

QString HList::activeKey ( void  )

Return the key of the currently active record. (Other subsystems for example gui can set a record as active)

Definition at line 4701 of file datalib.cpp.

int HList::actLine ( void  )
slot

Emits the actionOnRecord signal with the active record ( returned by activeKey() ).

Definition at line 4503 of file datalib.cpp.

void HList::alternateActionOnRecord ( QString  key)
signal

This signal is emitted when the user right clicked on a record (Can be emitted directly by slot alternateActLine() )

int HList::alternateActLine ( void  )
slot

Emits the alternateActionOnRecord signal with the active record ( returned by activeKey() ).

Definition at line 4511 of file datalib.cpp.

int HList::captureNotify ( QString  tblname)
slot

This function is used by HRefreshAgent automatically. Don't need to touch it...

Definition at line 4472 of file datalib.cpp.

int HList::clearList ( void  )
virtualslot

Clears the whole HList (clears keys and data values )

Definition at line 4490 of file datalib.cpp.

void HList::deepcopy_from_hlist ( HList x)

Deepcopy function. It clones the parameter HList to itself. It copies the full data structure and state and attributes and values of the parameter table. But connected tables is not copied neither the connection data. Only the base table is copied! If you would like to copy a whole connected table you have to copy the tables one by one, and connect them again.

Parameters
xthe source list

Definition at line 4454 of file datalib.cpp.

virtual QStringList* HList::getKeys ( void  )
inlinevirtual

Returns the keys of the whole HList.

Returns
returns a QStringList where one QString is contains the key value of a record

Reimplemented in HFloatTablesAsHList.

Definition at line 1801 of file datalib.h.

QString HList::getSqlFieldValue ( QString  sqln)
virtual

Returns the value of a specified field on the position of active record.

Parameters
sqlnthe name of the field to get.

Definition at line 4519 of file datalib.cpp.

virtual QList<QStringList *>* HList::getValues ( void  )
inlinevirtual

Returns the values of the whole HList.

Returns
returns a list of QStringList where one QStringList is contains the values of a record

Reimplemented in HFloatTablesAsHList.

Definition at line 1798 of file datalib.h.

QString HList::operator[] ( int  i)

Returns the title string of a specified field (by index).

Definition at line 4680 of file datalib.cpp.

QString HList::queryCurrKey ( void  )

Step through the records: Returns the current key value.

See Also
queryToFirst()
queryNextRecord()

Definition at line 4744 of file datalib.cpp.

QStringList * HList::queryCurrValues ( void  )

Step through the records: Returns the values of the current record.

See Also
queryToFirst()
queryNextRecord()

Definition at line 4751 of file datalib.cpp.

QString HList::queryNextKey ( void  )

Step through the records: Step to the next record and returns the value of the key field.

Returns
the key of the next current element, or empty string if we reach the end of the list
See Also
queryToFirst()

Definition at line 4728 of file datalib.cpp.

bool HList::queryNextRecord ( void  )

Step through the records: Step to the next record

Returns
true if success, or false if we reach the end of the list
See Also
queryToFirst()

Definition at line 4718 of file datalib.cpp.

QStringList * HList::queryNextValues ( void  )

Step through the records: Step to the next record and returns the values of the records.

Returns
the values of the next current element, or empty list if we reach the end of the list
See Also
queryToFirst()

Definition at line 4736 of file datalib.cpp.

void HList::queryToFirst ( void  )

Step through the records: Sets the query cursor to the first record.

Definition at line 4712 of file datalib.cpp.

int HList::readList ( QString  filter = "",
bool  all = true 
)
virtualslot

Reads the list from the sql database. Every record returned by the query is appear on the list.

Parameters
allif true the connected tables are readed too.
filterpart of the SQL query. Where filter is "F"
SELECT a,b,c... FROM tablename WHERE TRUE F;
For example F = " AND deadline > date(now()) "

Definition at line 4541 of file datalib.cpp.

int HList::recordCount ( void  )
inline

Returns the number of record's showd in this HList.

Definition at line 1807 of file datalib.h.

int HList::reReadList ( void  )
inlineslot

Reads the list from the sql database. Same as the readList() but all parameter is strictly same as the previous readList(). Useful to re-read (update) the list from the database. This slot is activated when the refresh agent notify tha table to refresh!

See Also
readList()
HRefreshAgent

Definition at line 1870 of file datalib.h.

void HList::setActiveKey ( QString  k)

Sets a record active by specify the key value

Definition at line 4706 of file datalib.cpp.

Member Data Documentation

bool HList::last_all

The last all parameter (Stored on the last readList calling)

Definition at line 1773 of file datalib.h.

QString HList::last_filter

The last filter parameter (Stored on the last readList calling)

Definition at line 1771 of file datalib.h.

QString HList::soft_current_key

Holds a key value. Used by gui related classes. It is not as hard as the active key, this key is that key where the (visible) gui cursor is stand on. Sometimes this variable is hold more current information about the selection of the user becuse it always point a record. The user don't have to explicitly select one record to fill this variable, but need to explicitly click or activate a record to make active. Fox example when the user scrolls through a list, the soft_current_key will set every key value where the cursor was, but only that record will be the active record where the user activate a record by a click.

Definition at line 1824 of file datalib.h.


The documentation for this class was generated from the following files: