kexi

#include <kexidbform.h>

Inheritance diagram for KexiDBForm:
KFormDesigner::FormWidget KexiFormDataItemInterface KexiDataItemInterface

Public Slots

void setAutoTabStops (bool set)
void setDataSource (const TQString &ds)
void setDataSourceMimeType (const TQCString &ds)
virtual void setReadOnly (bool readOnly)
TQSize sizeInternal () const
void resizeInternal (const TQSize &s)

Signals

void handleDragMoveEvent (TQDragMoveEvent *e)
void handleDropEvent (TQDropEvent *e)

Public Member Functions

 KexiDBForm (TQWidget *parent, KexiDataAwareObjectInterface *dataAwareObject, const char *name="kexi_dbform")
KexiDataAwareObjectInterface * dataAwareObject () const
TQString dataSource () const
TQCString dataSourceMimeType () const
TQVariant value ()
virtual void setInvalidState (const TQString &displayText)
virtual void drawRect (const TQRect &r, int type)
virtual void drawRects (const TQValueList< TQRect > &list, int type)
virtual void initBuffer ()
virtual void clearForm ()
virtual void highlightWidgets (TQWidget *from, TQWidget *to)
virtual TQSize sizeHint () const
bool autoTabStops () const
TQPtrList< TQWidget > * orderedFocusWidgets () const
TQPtrList< TQWidget > * orderedDataAwareWidgets () const
void updateTabStopsOrder (KFormDesigner::Form *form)
void updateTabStopsOrder ()
virtual bool eventFilter (TQObject *watched, TQEvent *e)
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
virtual bool isReadOnly () const
virtual TQWidget * widget ()
virtual bool cursorAtStart ()
virtual bool cursorAtEnd ()
virtual void clear ()
bool preview () const
virtual void setCursor (const TQCursor &cursor)
Public Member Functions inherited from KexiFormDataItemInterface
TQString dataSource () const
void setDataSource (const TQString &ds)
TQCString dataSourceMimeType () const
void setDataSourceMimeType (const TQCString &ds)
virtual void setDisplayDefaultValue (TQWidget *widget, bool displayDefaultValue)
virtual bool hasDisplayedDefaultValue () const
virtual void setReadOnly (bool readOnly)=0
virtual KexiDB::Field * field () const
virtual KexiDB::QueryColumnInfo * columnInfo () const
virtual void setColumnInfo (KexiDB::QueryColumnInfo *cinfo)
virtual void setVisibleColumnInfo (KexiDB::QueryColumnInfo *cinfo)
virtual KexiDB::QueryColumnInfo * visibleColumnInfo () const
virtual void hideWidget ()
virtual void showWidget ()
virtual void undoChanges ()
void cancelEditor ()
virtual bool keyPressed (TQKeyEvent *ke)
Public Member Functions inherited from KexiDataItemInterface
void setValue (const TQVariant &value, const TQVariant &add=TQVariant(), bool removeOld=false, const TQVariant *visibleValue=0)
virtual void installListener (KexiDataItemChangesListener *listener)
virtual bool valueIsValid ()
virtual TQVariant visibleValue ()
virtual bool valueChanged ()
virtual void moveCursorToEnd ()
virtual void moveCursorToStart ()
virtual void selectAll ()
bool hasFocusableWidget () const
virtual void showFocus (const TQRect &r, bool readOnly)
virtual void hideFocus ()
virtual void clickedOnContents ()
bool acceptEditorAfterDeleteContents () const
virtual void setFocus ()
bool cursorAtNewRow ()
void setParentDataItemInterface (KexiDataItemInterface *parentDataItemInterface)
KexiDataItemInterface * parentInterface () const
virtual void handleAction (const TQString &actionName)

Protected Member Functions

virtual void setValueInternal (const TQVariant &, bool)
virtual void dragMoveEvent (TQDragMoveEvent *e)
virtual void dropEvent (TQDropEvent *e)
void updateReadOnlyFlags ()
Protected Member Functions inherited from KexiDataItemInterface
virtual void setVisibleValueInternal (const TQVariant &value)
virtual void signalValueChanged ()
virtual void beforeSignalValueChanged ()
KexiDataItemChangesListener * listener ()

Protected Attributes

KexiFormDataItemInterface * editedItem
Private * d
Protected Attributes inherited from KFormDesigner::FormWidget
Form * m_form
Protected Attributes inherited from KexiFormDataItemInterface
TQString m_dataSource
TQCString m_dataSourceMimeType
KexiDB::QueryColumnInfo * m_columnInfo
KexiDisplayUtils::DisplayParameters * m_displayParametersForEnteredValue
KexiDisplayUtils::DisplayParameters * m_displayParametersForDefaultValue
bool m_displayDefaultValue: 1
Protected Attributes inherited from KexiDataItemInterface
TQGuardedPtr< TQObject > m_listenerObject
KexiDataItemChangesListener * m_listener
bool m_listenerIsTQObject
TQVariant m_origValue
KexiDataItemInterface * m_parentDataItemInterface
bool m_hasFocusableWidget: 1
bool m_disable_signalValueChanged: 1
bool m_acceptEditorAfterDeleteContents: 1

Friends

class KexiFormScrollView

Detailed Description

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

Definition at line 40 of file kexidbform.h.

Constructor & Destructor Documentation

◆ KexiDBForm()

KexiDBForm::KexiDBForm ( TQWidget * parent,
KexiDataAwareObjectInterface * dataAwareObject,
const char * name = "kexi_dbform" )

Definition at line 103 of file kexidbform.cpp.

◆ ~KexiDBForm()

KexiDBForm::~KexiDBForm ( )
virtual

Definition at line 120 of file kexidbform.cpp.

Member Function Documentation

◆ autoTabStops()

bool KexiDBForm::autoTabStops ( ) const

Definition at line 284 of file kexidbform.cpp.

◆ clear()

void KexiDBForm::clear ( )
virtual

clears item's data, so the data will contain NULL data

Todo
clear all fields?

Implements KexiDataItemInterface.

Definition at line 663 of file kexidbform.cpp.

◆ clearForm()

void KexiDBForm::clearForm ( )
virtual

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

Implements KFormDesigner::FormWidget.

Definition at line 192 of file kexidbform.cpp.

◆ cursorAtEnd()

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 658 of file kexidbform.cpp.

◆ cursorAtStart()

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 653 of file kexidbform.cpp.

◆ dataAwareObject()

KexiDataAwareObjectInterface * KexiDBForm::dataAwareObject ( ) const

Definition at line 126 of file kexidbform.cpp.

◆ dataSource()

TQString KexiDBForm::dataSource ( ) const
inline

Definition at line 58 of file kexidbform.h.

◆ dataSourceMimeType()

TQCString KexiDBForm::dataSourceMimeType ( ) const
inline

Definition at line 59 of file kexidbform.h.

◆ dragMoveEvent()

void KexiDBForm::dragMoveEvent ( TQDragMoveEvent * e)
protectedvirtual

Used to emit handleDragMoveEvent() signal needed to control dragging over the container's surface.

Definition at line 673 of file kexidbform.cpp.

◆ drawRect()

void KexiDBForm::drawRect ( const TQRect & r,
int type )
virtual

Implements KFormDesigner::FormWidget.

Definition at line 140 of file kexidbform.cpp.

◆ drawRects()

void KexiDBForm::drawRects ( const TQValueList< TQRect > & 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 148 of file kexidbform.cpp.

◆ dropEvent()

void KexiDBForm::dropEvent ( TQDropEvent * e)
protectedvirtual

Used to emit handleDropEvent() signal needed to control dropping on the container's surface.

Definition at line 679 of file kexidbform.cpp.

◆ eventFilter()

bool KexiDBForm::eventFilter ( TQObject * watched,
TQEvent * e )
virtual

fullRowSelection

Todo
remove hardcoded shortcuts: can be reconfigured...

Definition at line 390 of file kexidbform.cpp.

◆ highlightWidgets()

void KexiDBForm::highlightWidgets ( TQWidget * from,
TQWidget * 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 210 of file kexidbform.cpp.

◆ initBuffer()

void KexiDBForm::initBuffer ( )
virtual

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

Implements KFormDesigner::FormWidget.

Definition at line 183 of file kexidbform.cpp.

◆ isReadOnly()

bool KexiDBForm::isReadOnly ( ) const
virtual
Returns
'readOnly' flag for this item. The flag is usually taken from the item's widget, e.g. KLineEdit::isReadOnly(). By default, always returns false.
Todo
?

Reimplemented from KexiDataItemInterface.

Definition at line 634 of file kexidbform.cpp.

◆ orderedDataAwareWidgets()

TQPtrList< TQWidget > * KexiDBForm::orderedDataAwareWidgets ( ) const

Definition at line 299 of file kexidbform.cpp.

◆ orderedFocusWidgets()

TQPtrList< TQWidget > * KexiDBForm::orderedFocusWidgets ( ) const

Definition at line 294 of file kexidbform.cpp.

◆ preview()

bool KexiDBForm::preview ( ) const

Definition at line 668 of file kexidbform.cpp.

◆ resizeInternal

void KexiDBForm::resizeInternal ( const TQSize & s)
inlineslot

Definition at line 110 of file kexidbform.h.

◆ setAutoTabStops

void KexiDBForm::setAutoTabStops ( bool set)
slot

Definition at line 289 of file kexidbform.cpp.

◆ setCursor()

void KexiDBForm::setCursor ( const TQCursor & cursor)
virtual
Todo
?

Definition at line 685 of file kexidbform.cpp.

◆ setDataSource

void KexiDBForm::setDataSource ( const TQString & ds)
inlineslot

Definition at line 100 of file kexidbform.h.

◆ setDataSourceMimeType

void KexiDBForm::setDataSourceMimeType ( const TQCString & ds)
inlineslot

Definition at line 101 of file kexidbform.h.

◆ setInvalidState()

void KexiDBForm::setInvalidState ( const TQString & displayText)
virtual

Sets 'invalid' state, e.g. a text editor widget should display text displayText and become read only to prevent entering data, because updating at the database backend is not available. displayText is usually set to something i18n'd like "#NAME?". Note: that even widgets that usualy do not display texts (e.g. pixmaps) should display displayText too.

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

Implements KexiFormDataItemInterface.

Definition at line 277 of file kexidbform.cpp.

◆ setReadOnly

void KexiDBForm::setReadOnly ( bool readOnly)
virtualslot

This implementation just disables read only widget.

Definition at line 642 of file kexidbform.cpp.

◆ setValueInternal()

virtual void KexiDBForm::setValueInternal ( const TQVariant & ,
bool  )
inlineprotectedvirtual

no effect

Implements KexiDataItemInterface.

Definition at line 118 of file kexidbform.h.

◆ sizeHint()

TQSize KexiDBForm::sizeHint ( ) const
virtual

Definition at line 271 of file kexidbform.cpp.

◆ sizeInternal

TQSize KexiDBForm::sizeInternal ( ) const
inlineslot

Definition at line 107 of file kexidbform.h.

◆ updateReadOnlyFlags()

void KexiDBForm::updateReadOnlyFlags ( )
protected

called from KexiFormScrollView::initDataContents()

Definition at line 378 of file kexidbform.cpp.

◆ updateTabStopsOrder() [1/2]

void KexiDBForm::updateTabStopsOrder ( )

Definition at line 368 of file kexidbform.cpp.

◆ updateTabStopsOrder() [2/2]

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 304 of file kexidbform.cpp.

◆ value()

TQVariant KexiDBForm::value ( )
inlinevirtual

no effect

Implements KexiDataItemInterface.

Definition at line 62 of file kexidbform.h.

◆ valueIsEmpty()

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 629 of file kexidbform.cpp.

◆ valueIsNull()

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 624 of file kexidbform.cpp.

◆ widget()

TQWidget * KexiDBForm::widget ( )
virtual

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

Reimplemented from KexiFormDataItemInterface.

Definition at line 648 of file kexidbform.cpp.

◆ KexiFormScrollView

friend class KexiFormScrollView
friend

Definition at line 137 of file kexidbform.h.

Member Data Documentation

◆ d

Private* KexiDBForm::d
protected

Definition at line 135 of file kexidbform.h.

◆ editedItem

KexiFormDataItemInterface* KexiDBForm::editedItem
protected

Points to a currently edited data item. It is cleared when the focus is moved to other

Definition at line 132 of file kexidbform.h.


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