Kexi API Documentation (2.0 alpha)

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/property set.

Following functionality is built-in:

Definition at line 53 of file kexidataawarepropertyset.h.

Public Slots

void removeCurrentPropertySet ()
void clear (uint minimumSize=0)
void insert (uint row, KoProperty::Set *set, 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
uint currentRow () const
KoProperty::Set * at (uint row) const
KoProperty::Set * findPropertySetForItem (KexiTableItem &item)
int findRowForPropertyValue (const QCString &propertyName, const QVariant &value)

Protected Slots

void slotDataSet (KexiTableViewData *data)
void slotRowDeleted ()
 Called on row delete in a tableview.
void slotRowsDeleted (const QValueList< int > &rows)
 Called on multiple rows delete in a tableview.
void slotRowInserted (KexiTableItem *item, uint row, bool repaint)
 Called on row insertion in a tableview.
void slotCellSelected (int, int row)
 Called on selecting another cell in a tableview.
void slotReloadRequested ()
 Called on clearing tableview's data: just clears all property sets.

Protected Attributes

SetVector m_sets
 prop. sets vector
QGuardedPtr< KexiViewBasem_view
KexiDataAwareObjectInterfacem_dataObject
QGuardedPtr< KexiTableViewDatam_currentTVData
int m_row
 used to know if a new row is selected in slotCellSelected()


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.

References clear(), KexiDataAwareObjectInterface::connectCellSelectedSignal(), KexiDataAwareObjectInterface::connectDataSetSignal(), KexiDataAwareObjectInterface::data(), KexiViewBase::dirty(), m_dataObject, m_sets, KexiViewBase::setDirty(), slotCellSelected(), and slotDataSet().

KexiDataAwarePropertySet::~KexiDataAwarePropertySet  )  [virtual]
 

Definition at line 52 of file kexidataawarepropertyset.cpp.


Member Function Documentation

KoProperty::Set* KexiDataAwarePropertySet::at uint  row  )  const [inline]
 

Definition at line 73 of file kexidataawarepropertyset.h.

Referenced by KexiTableDesignerView::buildSchema(), KexiTableDesignerView::changeFieldPropertyForRow(), KexiTableDesignerView::changePropertyVisibility(), KexiTableDesignerView::insertFieldInternal(), KexiTableDesignerView::slotAboutToDeleteRow(), KexiTableDesignerView::slotRowUpdated(), and KexiTableDesignerView::switchPrimaryKey().

void KexiDataAwarePropertySet::clear uint  minimumSize = 0  )  [slot]
 

Definition at line 95 of file kexidataawarepropertyset.cpp.

References m_sets, m_view, and MAX_FIELDS.

Referenced by KexiDataAwarePropertySet(), slotDataSet(), and slotReloadRequested().

KoProperty::Set * KexiDataAwarePropertySet::currentPropertySet  )  const
 

Definition at line 133 of file kexidataawarepropertyset.cpp.

References KexiDataAwareObjectInterface::currentRow(), m_dataObject, and m_sets.

Referenced by KexiTableDesignerView::propertySet().

uint KexiDataAwarePropertySet::currentRow  )  const
 

Definition at line 138 of file kexidataawarepropertyset.cpp.

References KexiDataAwareObjectInterface::currentRow(), and m_dataObject.

KoProperty::Set * KexiDataAwarePropertySet::findPropertySetForItem KexiTableItem item  ) 
 

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

Definition at line 237 of file kexidataawarepropertyset.cpp.

References m_currentTVData, and m_sets.

Referenced by KexiTableDesignerView::slotBeforeCellChanged().

int KexiDataAwarePropertySet::findRowForPropertyValue const QCString &  propertyName,
const QVariant &  value
 

Returns:
number of the first row containing propertyName property equal to value. This is used e.g. in the Table Designer to find a row by field name. If no such row has been found, -1 is returned.

Definition at line 247 of file kexidataawarepropertyset.cpp.

References m_sets, and size().

Referenced by KexiTableDesignerView::changeFieldProperty(), KexiTableDesignerView::changePropertyVisibility(), and KexiTableDesignerView::slotPropertyChanged().

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

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

The property set set will be owned by this object, so you should not delete this property set by hand but call removeCurrentPropertySet() or remove(uint) instead. Note that property set'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.

References kexiwarn, m_sets, and m_view.

Referenced by KexiTableDesignerView::createPropertySet().

void KexiDataAwarePropertySet::remove uint  row  )  [slot]
 

Removes a property set at row position.

Definition at line 79 of file kexidataawarepropertyset.cpp.

References m_sets, and m_view.

Referenced by KexiTableDesignerView::clearRow(), removeCurrentPropertySet(), and KexiTableDesignerView::slotRowUpdated().

void KexiDataAwarePropertySet::removeCurrentPropertySet  )  [slot]
 

Definition at line 74 of file kexidataawarepropertyset.cpp.

References KexiDataAwareObjectInterface::currentRow(), m_dataObject, and remove().

Referenced by slotRowDeleted().

void KexiDataAwarePropertySet::rowDeleted  )  [signal]
 

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

Referenced by slotDataSet(), and slotRowDeleted().

void KexiDataAwarePropertySet::rowInserted  )  [signal]
 

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

Referenced by slotDataSet(), and slotRowInserted().

uint KexiDataAwarePropertySet::size  )  const
 

Definition at line 90 of file kexidataawarepropertyset.cpp.

References m_sets.

Referenced by findRowForPropertyValue(), slotRowsDeleted(), and KexiTableDesignerView::switchPrimaryKey().

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

Called on selecting another cell in a tableview.

Definition at line 229 of file kexidataawarepropertyset.cpp.

References m_row, and m_view.

Referenced by KexiDataAwarePropertySet().

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

Handles table view's data source changes.

Definition at line 56 of file kexidataawarepropertyset.cpp.

References clear(), m_currentTVData, rowDeleted(), rowInserted(), slotReloadRequested(), slotRowDeleted(), slotRowInserted(), and slotRowsDeleted().

Referenced by KexiDataAwarePropertySet().

void KexiDataAwarePropertySet::slotReloadRequested  )  [protected, slot]
 

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

Definition at line 103 of file kexidataawarepropertyset.cpp.

References clear().

Referenced by slotDataSet().

void KexiDataAwarePropertySet::slotRowDeleted  )  [protected, slot]
 

Called on row delete in a tableview.

Definition at line 143 of file kexidataawarepropertyset.cpp.

References KexiDataAwareObjectInterface::currentRow(), m_dataObject, m_sets, m_view, removeCurrentPropertySet(), and rowDeleted().

Referenced by slotDataSet().

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

Called on row insertion in a tableview.

Definition at line 209 of file kexidataawarepropertyset.cpp.

References m_sets, m_view, and rowInserted().

Referenced by slotDataSet().

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

Called on multiple rows delete in a tableview.

Definition at line 162 of file kexidataawarepropertyset.cpp.

References m_sets, m_view, and size().

Referenced by slotDataSet().


Member Data Documentation

QGuardedPtr<KexiTableViewData> KexiDataAwarePropertySet::m_currentTVData [protected]
 

Definition at line 143 of file kexidataawarepropertyset.h.

Referenced by findPropertySetForItem(), and slotDataSet().

KexiDataAwareObjectInterface* KexiDataAwarePropertySet::m_dataObject [protected]
 

Definition at line 141 of file kexidataawarepropertyset.h.

Referenced by currentPropertySet(), currentRow(), KexiDataAwarePropertySet(), removeCurrentPropertySet(), and slotRowDeleted().

int KexiDataAwarePropertySet::m_row [protected]
 

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

Definition at line 145 of file kexidataawarepropertyset.h.

Referenced by slotCellSelected().

SetVector KexiDataAwarePropertySet::m_sets [protected]
 

prop. sets vector

Definition at line 138 of file kexidataawarepropertyset.h.

Referenced by clear(), currentPropertySet(), findPropertySetForItem(), findRowForPropertyValue(), insert(), KexiDataAwarePropertySet(), remove(), size(), slotRowDeleted(), slotRowInserted(), and slotRowsDeleted().

QGuardedPtr<KexiViewBase> KexiDataAwarePropertySet::m_view [protected]
 

Definition at line 140 of file kexidataawarepropertyset.h.

Referenced by clear(), insert(), remove(), slotCellSelected(), slotRowDeleted(), slotRowInserted(), and slotRowsDeleted().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:49:54 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003