Kexi API Documentation (2.0 alpha)

KexiDBForm Class Reference

#include <kexidbform.h>

Inheritance diagram for KexiDBForm:

KexiDBFormBase KFormDesigner::FormWidget KexiFormDataItemInterface KexiDataItemInterface List of all members.

Detailed Description

A DB-aware form widget, acting as form's toplevel widget.

Definition at line 52 of file kexidbform.h.

Public Slots

void setAutoTabStops (bool set)
void setDataSource (const QString &ds)
 Sets the name of the data source for this widget.
void setDataSourceMimeType (const QCString &ds)
virtual void setReadOnly (bool readOnly)
 This implementation just disables read only widget.
QSize sizeInternal () const
void resizeInternal (const QSize &s)

Signals

void handleDragMoveEvent (QDragMoveEvent *e)
void handleDropEvent (QDropEvent *e)

Public Member Functions

 KexiDBForm (QWidget *parent, KexiDataAwareObjectInterface *dataAwareObject, const char *name="kexi_dbform")
virtual ~KexiDBForm ()
KexiDataAwareObjectInterfacedataAwareObject () const
QString dataSource () const
QCString dataSourceMimeType () const
QVariant value ()
 no effect
virtual void setInvalidState (const QString &displayText)
virtual void drawRect (const QRect &r, int type)
virtual void drawRects (const QValueList< QRect > &list, int type)
virtual void initBuffer ()
virtual void clearForm ()
virtual void highlightWidgets (QWidget *from, QWidget *to)
virtual QSize sizeHint () const
bool autoTabStops () const
QPtrList< QWidget > * orderedFocusWidgets () const
QPtrList< QWidget > * orderedDataAwareWidgets () const
void updateTabStopsOrder (KFormDesigner::Form *form)
void updateTabStopsOrder ()
virtual bool eventFilter (QObject *watched, QEvent *e)
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
virtual bool isReadOnly () const
virtual QWidgetwidget ()
virtual bool cursorAtStart ()
virtual bool cursorAtEnd ()
virtual void clear ()
bool preview () const
virtual void setCursor (const QCursor &cursor)

Protected Member Functions

virtual void setValueInternal (const QVariant &, bool)
 no effect
virtual void dragMoveEvent (QDragMoveEvent *e)
virtual void dropEvent (QDropEvent *e)
void updateReadOnlyFlags ()
 called from KexiFormScrollView::initDataContents()

Protected Attributes

KexiFormDataItemInterfaceeditedItem
 Points to a currently edited data item.
Private * d

Properties

QString dataSource
QCString dataSourceMimeType
bool autoTabStops
QSize sizeInternal

Friends

class KexiFormScrollView


Constructor & Destructor Documentation

KexiDBForm::KexiDBForm QWidget parent,
KexiDataAwareObjectInterface dataAwareObject,
const char *  name = "kexi_dbform"
 

Definition at line 100 of file kexidbform.cpp.

References d, editedItem, kexipluginsdbg, KexiDataItemInterface::m_hasFocusableWidget, and setCursor().

KexiDBForm::~KexiDBForm  )  [virtual]
 

Definition at line 117 of file kexidbform.cpp.

References d, and kexipluginsdbg.


Member Function Documentation

bool KexiDBForm::autoTabStops  )  const
 

void KexiDBForm::clear  )  [virtual]
 

Todo:
clear all fields?

Implements KexiDataItemInterface.

Definition at line 621 of file kexidbform.cpp.

void KexiDBForm::clearForm  )  [virtual]
 

Clears the form, ie pastes the whole buffer to repaint the Form.

Implements KFormDesigner::FormWidget.

Definition at line 189 of file kexidbform.cpp.

References d, and repaintAll().

bool KexiDBForm::cursorAtEnd  )  [virtual]
 

Returns:
true if the item widget's cursor (whatever that means, eg. line edit cursor) is at the end of editor's contents. This can inform table/form view that after pressing "right arrow" key should stop editing and move to a field on the right hand.

Implements KexiDataItemInterface.

Definition at line 616 of file kexidbform.cpp.

bool KexiDBForm::cursorAtStart  )  [virtual]
 

Returns:
true if the item widget's cursor (whatever that means, eg. line edit cursor) is at the beginning of editor's contents. This can inform table/form view that after pressing "left arrow" key should stop editing and move to a field on the left hand.

Implements KexiDataItemInterface.

Definition at line 611 of file kexidbform.cpp.

KexiDataAwareObjectInterface * KexiDBForm::dataAwareObject  )  const
 

Definition at line 123 of file kexidbform.cpp.

References d.

Referenced by KexiFormManager::action(), KexiFormPart::slotAssignAction(), and updateReadOnlyFlags().

QString KexiDBForm::dataSource  )  const [inline]
 

Returns:
the name of the data source for this widget. Data source usually means here a table or query, a field name or an expression.

Reimplemented from KexiFormDataItemInterface.

Definition at line 69 of file kexidbform.h.

References KexiFormDataItemInterface::dataSource().

QCString KexiDBForm::dataSourceMimeType  )  const [inline]
 

Returns:
the mime type of the data source for this widget. Data source mime type means here types like "kexi/table" or "kexi/query" in.the data source is set to object (as within form or subform) or is empty if the data source is set to table field or query column.

Reimplemented from KexiFormDataItemInterface.

Definition at line 70 of file kexidbform.h.

References KexiFormDataItemInterface::dataSourceMimeType().

void KexiDBForm::dragMoveEvent QDragMoveEvent *  e  )  [protected, virtual]
 

Definition at line 631 of file kexidbform.cpp.

References handleDragMoveEvent().

void KexiDBForm::drawRect const QRect &  r,
int  type
[virtual]
 

Implements KFormDesigner::FormWidget.

Definition at line 137 of file kexidbform.cpp.

References drawRects().

void KexiDBForm::drawRects const QValueList< QRect > &  list,
int  type
[virtual]
 

This function draws the rects in the list in the Form, above of all widgets, using double-buffering. type can be 1 (selection rect) or 2 (insert rect, dotted).

Implements KFormDesigner::FormWidget.

Definition at line 145 of file kexidbform.cpp.

References d.

Referenced by drawRect().

void KexiDBForm::dropEvent QDropEvent *  e  )  [protected, virtual]
 

Definition at line 636 of file kexidbform.cpp.

References handleDropEvent().

bool KexiDBForm::eventFilter QObject *  watched,
QEvent *  e
[virtual]
 

fullRowSelection

Todo:
remove hardcoded shortcuts: can be reconfigured...

Definition at line 387 of file kexidbform.cpp.

References d, editedItem, kexipluginsdbg, kexipluginswarn, KexiFormDataItemInterface::keyPressed(), KexiDataItemInterface::parentInterface(), preview(), SET_FOCUS_USING_REASON, and UNSET_FOCUS_USING_REASON.

void KexiDBForm::handleDragMoveEvent QDragMoveEvent *  e  )  [signal]
 

Referenced by dragMoveEvent().

void KexiDBForm::handleDropEvent QDropEvent *  e  )  [signal]
 

Referenced by dropEvent().

void KexiDBForm::highlightWidgets QWidget from,
QWidget to
[virtual]
 

This function highlights two widgets (to is optional), which are sender and receiver, and draws a link between them.

Implements KFormDesigner::FormWidget.

Definition at line 207 of file kexidbform.cpp.

References d.

void KexiDBForm::initBuffer  )  [virtual]
 

This function inits the buffer used for double-buffering. Called before drawing rect.

Implements KFormDesigner::FormWidget.

Definition at line 180 of file kexidbform.cpp.

References d, and repaintAll().

bool KexiDBForm::isReadOnly  )  const [virtual]
 

Todo:
?

Reimplemented from KexiDataItemInterface.

Definition at line 592 of file kexidbform.cpp.

References d.

Referenced by updateReadOnlyFlags().

QPtrList< QWidget > * KexiDBForm::orderedDataAwareWidgets  )  const
 

Definition at line 296 of file kexidbform.cpp.

References d.

QPtrList< QWidget > * KexiDBForm::orderedFocusWidgets  )  const
 

Definition at line 291 of file kexidbform.cpp.

References d.

Referenced by KexiFormView::afterSwitchFrom().

bool KexiDBForm::preview  )  const
 

Definition at line 626 of file kexidbform.cpp.

References d.

Referenced by eventFilter().

void KexiDBForm::resizeInternal const QSize &  s  )  [inline, slot]
 

Definition at line 121 of file kexidbform.h.

void KexiDBForm::setAutoTabStops bool  set  )  [slot]
 

Definition at line 286 of file kexidbform.cpp.

References d.

Referenced by KexiFormView::afterSwitchFrom().

void KexiDBForm::setCursor const QCursor &  cursor  )  [virtual]
 

Todo:
?

Definition at line 641 of file kexidbform.cpp.

References KFormDesigner::FormManager::self().

Referenced by KexiDBForm().

void KexiDBForm::setDataSource const QString ds  )  [inline, slot]
 

Sets the name of the data source for this widget.

Data source usually means here a table or query or field name name.

Reimplemented from KexiFormDataItemInterface.

Definition at line 111 of file kexidbform.h.

References KexiFormDataItemInterface::setDataSource().

void KexiDBForm::setDataSourceMimeType const QCString &  ds  )  [inline, slot]
 

Sets the mime type of the data source for this widget. Data source usually means here a "kexi/table" or "kexi/query".

See also:
dataSourceMimeType()

Reimplemented from KexiFormDataItemInterface.

Definition at line 112 of file kexidbform.h.

References KexiFormDataItemInterface::setDataSourceMimeType().

void KexiDBForm::setInvalidState const QString displayText  )  [virtual]
 

Todo:
draw "invalid data source" text on the surface?

Implements KexiFormDataItemInterface.

Definition at line 274 of file kexidbform.cpp.

void KexiDBForm::setReadOnly bool  readOnly  )  [virtual, slot]
 

This implementation just disables read only widget.

Implements KexiFormDataItemInterface.

Definition at line 600 of file kexidbform.cpp.

References d.

virtual void KexiDBForm::setValueInternal const QVariant &  ,
bool 
[inline, protected, virtual]
 

no effect

Implements KexiDataItemInterface.

Definition at line 129 of file kexidbform.h.

QSize KexiDBForm::sizeHint  )  const [virtual]
 

Definition at line 268 of file kexidbform.cpp.

QSize KexiDBForm::sizeInternal  )  const [inline, slot]
 

Definition at line 118 of file kexidbform.h.

References size.

void KexiDBForm::updateReadOnlyFlags  )  [protected]
 

called from KexiFormScrollView::initDataContents()

Definition at line 375 of file kexidbform.cpp.

References d, dataAwareObject(), KexiFormDataItemInterface::dataSource(), isReadOnly(), and KexiFormDataItemInterface::setReadOnly().

void KexiDBForm::updateTabStopsOrder  ) 
 

Definition at line 365 of file kexidbform.cpp.

References d.

void KexiDBForm::updateTabStopsOrder KFormDesigner::Form form  ) 
 

Todo:
d->indicesForDataAwareWidgets SHOULDNT BE UPDATED HERE BECAUSE // THERE CAN BE ALSO NON-TABSTOP DATA WIDGETS! //

Definition at line 301 of file kexidbform.cpp.

References d, KexiFormDataItemInterface::dataSource(), kexipluginsdbg, and KFormDesigner::Form::tabStopsIterator().

Referenced by KexiFormView::initDataSource(), and KexiFormView::initForm().

QVariant KexiDBForm::value  )  [inline, virtual]
 

no effect

Implements KexiDataItemInterface.

Definition at line 73 of file kexidbform.h.

bool KexiDBForm::valueIsEmpty  )  [virtual]
 

Returns:
true if editor's value is empty (not necessary null). Only few data types can accept "EMPTY" property (use KexiDB::Field::hasEmptyProperty() to check this). Used for checking if a given constraint within table of form is met.

Implements KexiDataItemInterface.

Definition at line 587 of file kexidbform.cpp.

bool KexiDBForm::valueIsNull  )  [virtual]
 

Returns:
true if editor's value is null (not empty) Used for checking if a given constraint within table or form is met.

Implements KexiDataItemInterface.

Definition at line 582 of file kexidbform.cpp.

QWidget * KexiDBForm::widget  )  [virtual]
 

Convenience function: casts this item to a QWidget. Can return 0 if the item is not a QWidget-derived object.

Reimplemented from KexiFormDataItemInterface.

Definition at line 606 of file kexidbform.cpp.


Friends And Related Function Documentation

friend class KexiFormScrollView [friend]
 

Definition at line 145 of file kexidbform.h.


Member Data Documentation

Private* KexiDBForm::d [protected]
 

Definition at line 142 of file kexidbform.h.

Referenced by clearForm(), dataAwareObject(), drawRects(), eventFilter(), highlightWidgets(), initBuffer(), isReadOnly(), KexiDBForm(), orderedDataAwareWidgets(), orderedFocusWidgets(), preview(), setAutoTabStops(), setReadOnly(), updateReadOnlyFlags(), updateTabStopsOrder(), and ~KexiDBForm().

KexiFormDataItemInterface* KexiDBForm::editedItem [protected]
 

Points to a currently edited data item.

It is cleared when the focus is moved to other

Definition at line 140 of file kexidbform.h.

Referenced by eventFilter(), and KexiDBForm().


Property Documentation

bool KexiDBForm::autoTabStops [read, write]
 

Definition at line 60 of file kexidbform.h.

Referenced by KexiFormView::loadForm().

QString KexiDBForm::dataSource [read, write]
 

Definition at line 58 of file kexidbform.h.

Referenced by KexiFormView::initDataSource(), KexiFormManager::setFormDataSource(), KexiFormManager::slotHistoryCommandExecuted(), KexiFormView::updateAutoFieldsDataSource(), and KexiFormView::updateValuesForSubproperties().

QCString KexiDBForm::dataSourceMimeType [read, write]
 

Definition at line 59 of file kexidbform.h.

Referenced by KexiFormView::initDataSource(), KexiFormManager::setFormDataSource(), KexiFormManager::slotHistoryCommandExecuted(), KexiFormView::updateAutoFieldsDataSource(), and KexiFormView::updateValuesForSubproperties().

QSize KexiDBForm::sizeInternal [read, write]
 

Definition at line 62 of file kexidbform.h.


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:50:00 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003