kexi

KexiDataAwarePropertySet Class Reference

#include <kexidataawarepropertyset.h>

List of all members.


Detailed Description

This helper class handles data changes of a single object implementing KexiDataAwareObjectInterface (e.g. KexiTableView) inside a KexiViewBase container.

It is currently used in KexiAlterTableDialog and KexiQueryDesignerGuiEditor, and may be used for similar purposes, when each KexiDataAwareObjectInterface's row can be associated with single KoProperty::Set object, and given KexiDataAwareObjectInterface object has to inform the world about currently selected row/buffer.

Following functionality is built-in:

  • auto-initializing after resetting of table view's data
  • destroying single buffer that is associated with deleted row
  • inserting single buffer that and associating it with new row
  • all buffers are cleared when view's data is cleared (using clear())
  • setting view's 'dirty' flag when needed
  • signalling via KexiVieBase::propertyBufferSwitched() that current property buffer has changed (e.g. on moving to other row)

Definition at line 53 of file kexidataawarepropertyset.h.


Public Slots

void removeCurrentPropertySet ()
void clear (uint minimumSize=0)
void insert (uint row, KoProperty::Set *buf, bool newOne=false)
void remove (uint row)

Signals

void rowDeleted ()
void rowInserted ()

Public Member Functions

 KexiDataAwarePropertySet (KexiViewBase *view, KexiDataAwareObjectInterface *dataObject)
virtual ~KexiDataAwarePropertySet ()
uint size () const
KoProperty::Set * currentPropertySet () const
KoProperty::Set * at (uint row) const
KoProperty::Set * listForItem (KexiTableItem &item)

Protected Slots

void slotDataSet (KexiTableViewData *data)
void slotRowDeleted ()
void slotRowsDeleted (const QValueList< int > &rows)
void slotRowInserted (KexiTableItem *item, uint row, bool repaint)
void slotCellSelected (int, int row)
void slotReloadRequested ()

Protected Attributes

SetVector m_sets
QGuardedPtr< KexiViewBasem_view
KexiDataAwareObjectInterfacem_dataObject
QGuardedPtr< KexiTableViewDatam_currentTVData
int m_row

Constructor & Destructor Documentation

KexiDataAwarePropertySet::KexiDataAwarePropertySet ( KexiViewBase view,
KexiDataAwareObjectInterface dataObject 
)

You can instantiate KexiDataAwarePropertySet object for existing tableView and view. tableView can have data assigned (KexiDataAwareObjectInterface::setData()) now but it can be done later as well (but assigning data is needed for proper functionality). Any changed reassignments of table view's data will be handled automatically.

Definition at line 29 of file kexidataawarepropertyset.cpp.


Member Function Documentation

void KexiDataAwarePropertySet::insert ( uint  row,
KoProperty::Set *  buf,
bool  newOne = false 
) [slot]

Inserts buf buffer at row position. If there was a buffer at this position before, it will be destroyed. If newOne is true, the property buffer will be marked as newly created, simply by adding "newrow" property.

The buffer buf will be owned by this object, so you should not delete this buffer by hand but call removeCurrentPropertySet() or remove(uint) instead. Note that buffer's parent (QObject::parent()) must be null or qual to this KexiDataAwarePropertySet object, otherwise this method will fail with a warning.

Definition at line 108 of file kexidataawarepropertyset.cpp.

KoProperty::Set * KexiDataAwarePropertySet::listForItem ( KexiTableItem item  ) 

Returns:
buffer assigned for item or null it item has no buffer assigned or it's not owned by assigned table view or if assigned table view has no data set.

Definition at line 243 of file kexidataawarepropertyset.cpp.

void KexiDataAwarePropertySet::remove ( uint  row  )  [slot]

Removed a buffer at row position.

Definition at line 79 of file kexidataawarepropertyset.cpp.

void KexiDataAwarePropertySet::rowDeleted (  )  [signal]

Emmited when row is deleted. KexiDataAwareObjectInterface::rowDeleted() signal is usuallly used but when you're using KexiDataAwarePropertySet, you never know if currentPropertySet() is updated. So use this signal instead.

void KexiDataAwarePropertySet::rowInserted (  )  [signal]

Emmited when row is inserted. Purpose of this signal is similar to rowDeleted() signal.

void KexiDataAwarePropertySet::slotCellSelected ( int  ,
int  row 
) [protected, slot]

Called on selecting another cell in a tableview.

Definition at line 235 of file kexidataawarepropertyset.cpp.

void KexiDataAwarePropertySet::slotDataSet ( KexiTableViewData data  )  [protected, slot]

Handles table view's data source changes.

Definition at line 56 of file kexidataawarepropertyset.cpp.

void KexiDataAwarePropertySet::slotReloadRequested (  )  [protected, slot]

Called on clearing tableview's data: just clears all buffers.

Definition at line 103 of file kexidataawarepropertyset.cpp.

void KexiDataAwarePropertySet::slotRowDeleted (  )  [protected, slot]

Called on row delete in a tableview.

Definition at line 149 of file kexidataawarepropertyset.cpp.

void KexiDataAwarePropertySet::slotRowInserted ( KexiTableItem item,
uint  row,
bool  repaint 
) [protected, slot]

Called on row insertion in a tableview.

Definition at line 215 of file kexidataawarepropertyset.cpp.

void KexiDataAwarePropertySet::slotRowsDeleted ( const QValueList< int > &  rows  )  [protected, slot]

Called on multiple rows delete in a tableview.

Definition at line 168 of file kexidataawarepropertyset.cpp.


Member Data Documentation

used to know if a new row is selected in slotCellSelected()

Definition at line 136 of file kexidataawarepropertyset.h.

SetVector KexiDataAwarePropertySet::m_sets [protected]

prop. buffers vector

Definition at line 129 of file kexidataawarepropertyset.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys