Ananas Library  0.9.5
Public Slots | Signals | Public Member Functions | Public Attributes | Protected Slots | Protected Member Functions | Properties | Friends | List of all members
wDBTable Class Reference

#include <wdbtable.h>

Inheritance diagram for wDBTable:

Public Slots

QValueList< int > getBindList ()
 
void setWFieldEditor ()
 
void setAvailableTables ()
 
void lineUpdate (QSql::Op mode)
 
void newFilter (const QString &)
 
void newDataId (const Q_ULLONG)
 
QVariant Value (const QString &colname)
 
bool searchColumn (const QString &text, bool FromCurrent=FALSE, bool Forward=TRUE)
 
void searchOpen (const QString &text="")
 
void searchClose ()
 

Signals

void saveLine (QSqlRecord *rec)
 
void deleteLine (QSqlRecord *rec)
 
void selected (Q_ULLONG uid)
 
void selectRecord (Q_ULLONG)
 
void updateCurr (int row, int col)
 
void insertRequest ()
 
void updateRequest ()
 
void deleteRequest ()
 
void viewRequest ()
 

Public Member Functions

 wDBTable (QString objtype, QWidget *parent=0, const char *name=0)
 
void checkFields ()
 
void setFields (int numTable)
 
QStringList getFields (int numTable, bool GetId=false)
 
QString getFieldName (long idField)
 
QString getFieldType (long idField)
 
int getTableInd (int id)
 
int getTableId (int ind)
 
void init ()
 
void init (aDatabase *adb, aEngine *e=0)
 
void OpenEditor ()
 
QStringList getDefFields () const
 
QStringList getDefHeaders () const
 
QStringList getColWidth () const
 
QStringList getDefIdList () const
 
Q_ULLONG getId () const
 
int getTblInd () const
 
bool getOpenEditor () const
 
int getDefColWidth () const
 
void setDefFields (QStringList lst)
 
void setDefHeaders (QStringList lst)
 
void setColWidth (QStringList lst)
 
void setDefIdList (QStringList lst)
 
void setId (Q_ULLONG fn)
 
void setTblInd (int ind)
 
void setOpenEditor (bool fn)
 
void setDefColWidth (int fn)
 
QString getEditFormName () const
 
void setEditFormName (QString name)
 
QString containerType () const
 
void setContainerType (QString name)
 
QPixmap systemIcon ()
 
virtual int Select (ANANAS_UID db_uid)
 

Public Attributes

aCfgmd
 
aDatabasedb
 
aEngineengine
 
QStringList list_available_tables
 
QStringList fname
 
QStringList hname
 
QStringList colWidth
 
QStringList idList
 
int defColWidth
 
int tableInd
 
aCfgItem tables
 
QSqlCursor * cur
 
bool searchMode
 
QString searchString
 
aSearchWidgetsearchWidget
 

Protected Slots

void doubleClickEventHandler (int, int, int, const QPoint &)
 
virtual void updateTableCellHandler (int, int)
 
void dropped (QDropEvent *)
 

Protected Member Functions

virtual QDragObject * dragObject ()
 
virtual void paintField (QPainter *p, const QSqlField *field, const QRect &cr, bool selected)
 
QWidget * beginUpdate (int row, int col, bool replace)
 
virtual bool updateCurrent ()
 
void contentsContextMenuEvent (QContextMenuEvent *e)
 
virtual bool deleteCurrent ()
 
virtual void keyPressEvent (QKeyEvent *e)
 
void EditElement ()
 
virtual void activateNextCell ()
 
virtual bool beginInsert ()
 
virtual QSql::Confirm confirmEdit (QSql::Op m)
 

Properties

Q_ULLONG Id
 
int DefaultColWidth
 
int TableInd
 
QStringList DefFields
 
QStringList DefHeaders
 
QStringList ColWidth
 
QStringList DefIdList
 
QString editFormName
 

Friends

class aForm
 

Detailed Description

Class for editing documents tables.

Constructor & Destructor Documentation

wDBTable::wDBTable ( QString  objtype,
QWidget *  parent = 0,
const char *  name = 0 
)

Constructor.

References init(), lineUpdate(), aLog::print(), and updateTableCellHandler().

Member Function Documentation

void wDBTable::activateNextCell ( )
protectedvirtual

Reimplemented QDataTable function.

QWidget * wDBTable::beginUpdate ( int  row,
int  col,
bool  replace 
)
protected

Reimplemented QDataTable function.

void wDBTable::checkFields ( )

function check property name, id, header and width. If have incorrect field name or id, then print message and all. If have less or more items in DefHeaders or ColWidth, then set them normal.

References getFieldName(), and aLog::print().

Referenced by OpenEditor().

void wDBTable::contentsContextMenuEvent ( QContextMenuEvent *  e)
protected

Reimplemented QDataTable function.

References deleteRequest(), insertRequest(), keyPressEvent(), updateRequest(), and viewRequest().

bool wDBTable::deleteCurrent ( )
protectedvirtual

Delete line function

Returns
true, if no error

References updateCurr().

void wDBTable::deleteLine ( QSqlRecord *  rec)
signal

Signal emitted after table line delete.

Referenced by lineUpdate().

void wDBTable::deleteRequest ( )
signal
void wDBTable::EditElement ( )
protected

Opens form for edit catalogue element.

References getId(), and aEngine::openForm().

Referenced by keyPressEvent().

QValueList< int > wDBTable::getBindList ( )
slot

Gets list of id binding table.

Returns
list of id binding table.

Referenced by setAvailableTables().

QStringList wDBTable::getColWidth ( ) const

Gets list of defined column width.

int wDBTable::getDefColWidth ( ) const

Gets default column width.

QStringList wDBTable::getDefFields ( ) const

Gets list of defined fields.

Referenced by aForm::ColIndex().

QStringList wDBTable::getDefHeaders ( ) const

Gets list of defined headers.

QStringList wDBTable::getDefIdList ( ) const

Gets list of defined column id.

Referenced by aForm::tabValue().

QString wDBTable::getFieldName ( long  id)

Gets field name.

Parameters
id- field id
Returns
field name

References aCfg::attr(), and aCfg::find().

Referenced by checkFields().

QStringList wDBTable::getFields ( int  idTable,
bool  GetId = false 
)

Gets list of id fields or list of name fields.

Parameters
idTable(in) - id of table
GetId(ib) - if GetId == true returns list of id, else returns list of names.
Returns
list of id fields or list of name fields.

References aCfg::attr(), aCfg::countChild(), aCfg::find(), and aCfg::objClass().

QString wDBTable::getFieldType ( long  id)

Gets field type.

Parameters
id- field id
Returns
field type

References aCfg::attr(), aCfg::find(), and aCfg::objClass().

Referenced by aEditorFactory::createEditor(), and aForm::tabValue().

Q_ULLONG wDBTable::getId ( ) const

Gets metadata document id.

Referenced by EditElement().

bool wDBTable::getOpenEditor ( ) const

Olways return false.

Returns
false
int wDBTable::getTableId ( int  numTable)

Gets table id at position table.

Parameters
numTable(in) - Position table in metadata
Returns
table id

References aCfg::id(), and aCfg::objClass().

int wDBTable::getTableInd ( int  id)

Gets table position at id table.

Parameters
id(in) - Id table
Returns
table position for documet or 0 for catalogue and journal

References aCfg::count(), aCfg::id(), and aCfg::objClass().

int wDBTable::getTblInd ( ) const

Gets current table id.

void wDBTable::init ( )

Function init. Sets metadata object and tables object.

References aCfg::find(), aWidget::getMd(), and aCfg::objClass().

Referenced by wDBTable().

void wDBTable::init ( aDatabase adb,
aEngine e = 0 
)

Initialisation the widget on form loaded in engine.

References aDatabase::cfg, aCfg::objClass(), aCfg::objTable(), aLog::print(), setWFieldEditor(), and aWidget::uid().

void wDBTable::insertRequest ( )
signal

signals from context menu for connecting to wJournal if container has another type, then do QDataTable context menu and this signal no emitted

See Also
updateRequest(); deleteRequest(); viewRequest();

Referenced by contentsContextMenuEvent().

void wDBTable::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Key press handler.

References EditElement(), aLog::print(), and selected().

Referenced by contentsContextMenuEvent().

void wDBTable::lineUpdate ( QSql::Op  mode)
slot

Handler line current change signal.

References deleteLine(), and saveLine().

Referenced by wDBTable().

void wDBTable::OpenEditor ( )

Creates property editor dialog window.

References checkFields(), and setAvailableTables().

Referenced by setOpenEditor().

void wDBTable::paintField ( QPainter *  p,
const QSqlField *  field,
const QRect &  cr,
bool  selected 
)
protectedvirtual

Function paint field in table.

References systemIcon().

void wDBTable::saveLine ( QSqlRecord *  rec)
signal

Signal emitted after table line update.

Referenced by lineUpdate().

void wDBTable::selected ( Q_ULLONG  uid)
signal

Signal emitted after select another document.

Referenced by keyPressEvent().

void wDBTable::selectRecord ( Q_ULLONG  )
signal

Signal emitted after change line.

void wDBTable::setAvailableTables ( )
slot

Sets available tables, using object tables.

References aCfg::attr(), aCfg::countChild(), aCfg::find(), getBindList(), aCfg::id(), and aCfg::objClass().

Referenced by OpenEditor().

void wDBTable::setColWidth ( QStringList  lst)

Sets list of columns width.

void wDBTable::setDefColWidth ( int  fn)

Sets default columns width.

void wDBTable::setDefFields ( QStringList  lst)

Sets list of field names.

void wDBTable::setDefHeaders ( QStringList  lst)

Sets list of field headers.

void wDBTable::setDefIdList ( QStringList  lst)

Gets list of column id.

void wDBTable::setFields ( int  idTable)

Sets property `DefFields', `DefHeaders', `ColWidth', `DefIdList' to values from metadata.

Parameters
idTable(in) - table id

References aCfg::attr(), aCfg::countChild(), aCfg::find(), and aCfg::objClass().

void wDBTable::setId ( Q_ULLONG  fn)

Sets metadata document id.

void wDBTable::setOpenEditor ( bool  fn)

Opens property editor.

References OpenEditor().

void wDBTable::setTblInd ( int  ind)

Gets current table id.

void wDBTable::setWFieldEditor ( )
slot

Set custom field editor (wField) used property `value'.

Referenced by init().

QPixmap wDBTable::systemIcon ( )

Return system icon for display object record state. Возвращает иконку для отображения состояния строки.

References aDocJournal::CurrentDocument(), aDocJournal::findDocument(), aDocument::IsConducted(), and aWidget::value().

Referenced by paintField().

void wDBTable::updateCurr ( int  row,
int  col 
)
signal

Signal emitted after update cell.

Referenced by deleteCurrent(), and updateCurrent().

bool wDBTable::updateCurrent ( )
protectedvirtual

Reimplemented QDataTable function.

References updateCurr().

void wDBTable::updateRequest ( )
signal
void wDBTable::updateTableCellHandler ( int  r,
int  c 
)
protectedvirtualslot

Hanler table cell end edit.

Referenced by wDBTable().

QVariant wDBTable::Value ( const QString &  colname)
slot

Get field value slot. Don't implemented.

References aLog::print().

void wDBTable::viewRequest ( )
signal

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