kexi

#include <kexidblineedit.h>

Inheritance diagram for KexiDBLineEdit:
KexiDBTextWidgetInterface KexiFormDataItemInterface KexiSubwidgetInterface KexiDataItemInterface

Public Slots

void setDataSource (const TQString &ds)
void setDataSourceMimeType (const TQCString &ds)
virtual void setReadOnly (bool readOnly)
virtual void undo ()
virtual void moveCursorToEnd ()
virtual void moveCursorToStart ()
virtual void selectAll ()

Public Member Functions

 KexiDBLineEdit (TQWidget *parent, const char *name=0)
TQString dataSource () const
TQCString dataSourceMimeType () const
virtual TQVariant value ()
virtual void setInvalidState (const TQString &displayText)
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
virtual bool valueIsValid ()
virtual bool isReadOnly () const
virtual void setDisplayDefaultValue (TQWidget *widget, bool displayDefaultValue)
virtual TQWidget * widget ()
virtual bool cursorAtStart ()
virtual bool cursorAtEnd ()
virtual void clear ()
virtual void setColumnInfo (KexiDB::QueryColumnInfo *cinfo)
virtual void handleAction (const TQString &actionName)
virtual bool keyPressed (TQKeyEvent *ke)
Public Member Functions inherited from KexiFormDataItemInterface
TQString dataSource () const
void setDataSource (const TQString &ds)
TQCString dataSourceMimeType () const
void setDataSourceMimeType (const TQCString &ds)
virtual bool hasDisplayedDefaultValue () const
virtual void setReadOnly (bool readOnly)=0
virtual KexiDB::Field * field () const
virtual KexiDB::QueryColumnInfo * columnInfo () const
virtual void setVisibleColumnInfo (KexiDB::QueryColumnInfo *cinfo)
virtual KexiDB::QueryColumnInfo * visibleColumnInfo () const
virtual void hideWidget ()
virtual void showWidget ()
virtual void undoChanges ()
void cancelEditor ()
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 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
Public Member Functions inherited from KexiSubwidgetInterface
virtual bool subwidgetStretchRequired (KexiDBAutoField *autoField) const

Protected Slots

void slotTextChanged (const TQString &)

Protected Member Functions

virtual void paintEvent (TQPaintEvent *)
virtual void setValueInternal (const TQVariant &add, bool removeOld)
virtual bool event (TQEvent *)
virtual TQPopupMenu * createPopupMenu ()
virtual bool appendStretchRequired (KexiDBAutoField *autoField) const
Protected Member Functions inherited from KexiDBTextWidgetInterface
void setColumnInfo (KexiDB::QueryColumnInfo *cinfo, TQWidget *w)
void paint (TQFrame *w, TQPainter *p, bool textIsEmpty, int alignment, bool hasFocus)
void event (TQEvent *e, TQWidget *w, bool textIsEmpty)
Protected Member Functions inherited from KexiFormDataItemInterface
TQString dataSource () const
void setDataSource (const TQString &ds)
TQCString dataSourceMimeType () const
void setDataSourceMimeType (const TQCString &ds)
virtual bool hasDisplayedDefaultValue () const
virtual void setReadOnly (bool readOnly)=0
virtual KexiDB::Field * field () const
virtual KexiDB::QueryColumnInfo * columnInfo () const
virtual void setVisibleColumnInfo (KexiDB::QueryColumnInfo *cinfo)
virtual KexiDB::QueryColumnInfo * visibleColumnInfo () const
virtual void hideWidget ()
virtual void showWidget ()
virtual void undoChanges ()
void cancelEditor ()
Protected Member Functions inherited from KexiDataItemInterface
virtual void setVisibleValueInternal (const TQVariant &value)
virtual void signalValueChanged ()
virtual void beforeSignalValueChanged ()
KexiDataItemChangesListener * listener ()
void setValue (const TQVariant &value, const TQVariant &add=TQVariant(), bool removeOld=false, const TQVariant *visibleValue=0)
virtual void installListener (KexiDataItemChangesListener *listener)
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
Protected Member Functions inherited from KexiSubwidgetInterface
virtual bool subwidgetStretchRequired (KexiDBAutoField *autoField) const

Protected Attributes

KexiTextFormatter m_textFormatter
TQGuardedPtr< const TQValidator > m_readOnlyValidator
TQGuardedPtr< const TQValidator > m_readWriteValidator
KexiDBWidgetContextMenuExtender m_menuExtender
bool m_internalReadOnly: 1
bool m_slotTextChanged_enabled: 1
Protected Attributes inherited from KexiDBTextWidgetInterface
KexiDisplayUtils::DisplayParameters * m_autonumberDisplayParameters
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

Detailed Description

Line edit widget for Kexi forms.

Handles many data types. User input is validated by using validators and/or input masks.

Definition at line 43 of file kexidblineedit.h.

Constructor & Destructor Documentation

◆ KexiDBLineEdit()

KexiDBLineEdit::KexiDBLineEdit ( TQWidget * parent,
const char * name = 0 )

Definition at line 53 of file kexidblineedit.cpp.

◆ ~KexiDBLineEdit()

KexiDBLineEdit::~KexiDBLineEdit ( )
virtual

Definition at line 73 of file kexidblineedit.cpp.

Member Function Documentation

◆ appendStretchRequired()

bool KexiDBLineEdit::appendStretchRequired ( KexiDBAutoField * autoField) const
protectedvirtual

Implemented for KexiSubwidgetInterface.

Reimplemented from KexiSubwidgetInterface.

Definition at line 360 of file kexidblineedit.cpp.

◆ clear()

void KexiDBLineEdit::clear ( )
virtual

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

Implements KexiDataItemInterface.

Definition at line 291 of file kexidblineedit.cpp.

◆ createPopupMenu()

TQPopupMenu * KexiDBLineEdit::createPopupMenu ( )
protectedvirtual

Definition at line 268 of file kexidblineedit.cpp.

◆ cursorAtEnd()

bool KexiDBLineEdit::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 286 of file kexidblineedit.cpp.

◆ cursorAtStart()

bool KexiDBLineEdit::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 281 of file kexidblineedit.cpp.

◆ dataSource()

TQString KexiDBLineEdit::dataSource ( ) const
inline

Definition at line 59 of file kexidblineedit.h.

◆ dataSourceMimeType()

TQCString KexiDBLineEdit::dataSourceMimeType ( ) const
inline

Definition at line 60 of file kexidblineedit.h.

◆ event()

bool KexiDBLineEdit::event ( TQEvent * e)
protectedvirtual
Todo
add option to set cursor at the beginning

Definition at line 344 of file kexidblineedit.cpp.

◆ handleAction()

void KexiDBLineEdit::handleAction ( const TQString & actionName)
virtual

Handles action having standard name actionName. Action could be: "edit_copy", "edit_paste", etc. Reimplemented after KexiDataItemChangesListener.

Todo
?

Reimplemented from KexiDataItemInterface.

Definition at line 365 of file kexidblineedit.cpp.

◆ isReadOnly()

bool KexiDBLineEdit::isReadOnly ( ) const
virtual
Returns
'readOnly' flag for this widget.

Reimplemented from KexiDataItemInterface.

Definition at line 242 of file kexidblineedit.cpp.

◆ keyPressed()

bool KexiDBLineEdit::keyPressed ( TQKeyEvent * ke)
virtual

Called by top-level form on key press event to consume widget-specific shortcuts.

Reimplemented from KexiFormDataItemInterface.

Definition at line 411 of file kexidblineedit.cpp.

◆ moveCursorToEnd

void KexiDBLineEdit::moveCursorToEnd ( )
virtualslot

Implemented for KexiDataItemInterface.

mark

Definition at line 396 of file kexidblineedit.cpp.

◆ moveCursorToStart

void KexiDBLineEdit::moveCursorToStart ( )
virtualslot

Implemented for KexiDataItemInterface.

mark

Definition at line 401 of file kexidblineedit.cpp.

◆ paintEvent()

void KexiDBLineEdit::paintEvent ( TQPaintEvent * pe)
protectedvirtual

Definition at line 337 of file kexidblineedit.cpp.

◆ selectAll

void KexiDBLineEdit::selectAll ( )
virtualslot

Implemented for KexiDataItemInterface.

Definition at line 406 of file kexidblineedit.cpp.

◆ setColumnInfo()

void KexiDBLineEdit::setColumnInfo ( KexiDB::QueryColumnInfo * cinfo)
virtual

Used internally to set database column information. Reimplement if you need to do additional actions, e.g. set data validator based on field type. Don't forget about calling superclass implementation.

Todo
handle input mask (via TQLineEdit::setInputMask()) using a special KexiDB::FieldInputMask class

Reimplemented from KexiFormDataItemInterface.

Definition at line 298 of file kexidblineedit.cpp.

◆ setDataSource

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

Definition at line 104 of file kexidblineedit.h.

◆ setDataSourceMimeType

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

Definition at line 105 of file kexidblineedit.h.

◆ setDisplayDefaultValue()

void KexiDBLineEdit::setDisplayDefaultValue ( TQWidget * widget,
bool displayDefaultValue )
virtual

If displayDefaultValue is true, the value set by KexiDataItemInterface::setValue() is displayed in a special way. Used by KexiFormDataProvider::fillDataItems(). widget is equal to 'this'. Reimplemented after KexiFormDataItemInterface.

Reimplemented from KexiFormDataItemInterface.

Definition at line 379 of file kexidblineedit.cpp.

◆ setInvalidState()

void KexiDBLineEdit::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
move this to KexiDataItemInterface::setInvalidStateInternal() ?

Implements KexiFormDataItemInterface.

Definition at line 79 of file kexidblineedit.cpp.

◆ setReadOnly

void KexiDBLineEdit::setReadOnly ( bool readOnly)
virtualslot

Definition at line 247 of file kexidblineedit.cpp.

◆ setValueInternal()

void KexiDBLineEdit::setValueInternal ( const TQVariant & add,
bool removeOld )
protectedvirtual

Initializes this editor with add value, which should be somewhat added to the current value (already storted in m_origValue). If removeOld is true, a value should be set to add, otherwise -it should be set to current m_origValue + add, if possible. Implement this.

Implements KexiDataItemInterface.

Definition at line 88 of file kexidblineedit.cpp.

◆ slotTextChanged

void KexiDBLineEdit::slotTextChanged ( const TQString & )
protectedslot

Definition at line 185 of file kexidblineedit.cpp.

◆ undo

void KexiDBLineEdit::undo ( )
virtualslot

Reimplemented, so "undo" means the same as "cancelEditor" action.

Definition at line 391 of file kexidblineedit.cpp.

◆ value()

TQVariant KexiDBLineEdit::value ( )
virtual
Returns
value currently represented by this item.

Implements KexiDataItemInterface.

Definition at line 145 of file kexidblineedit.cpp.

◆ valueIsEmpty()

bool KexiDBLineEdit::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 or form is met.

Implements KexiDataItemInterface.

Definition at line 197 of file kexidblineedit.cpp.

◆ valueIsNull()

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

Implements KexiDataItemInterface.

Definition at line 192 of file kexidblineedit.cpp.

◆ valueIsValid()

bool KexiDBLineEdit::valueIsValid ( )
virtual
Returns
true if the value is valid

Reimplemented from KexiDataItemInterface.

Definition at line 219 of file kexidblineedit.cpp.

◆ widget()

TQWidget * KexiDBLineEdit::widget ( )
virtual
Returns
the view widget of this item, e.g. line edit widget.

Reimplemented from KexiFormDataItemInterface.

Definition at line 276 of file kexidblineedit.cpp.

Member Data Documentation

◆ m_internalReadOnly

bool KexiDBLineEdit::m_internalReadOnly
protected

Used in isReadOnly, as sometimes we want to have the flag set tot true when KLineEdit::isReadOnly is still false.

Definition at line 165 of file kexidblineedit.h.

◆ m_menuExtender

KexiDBWidgetContextMenuExtender KexiDBLineEdit::m_menuExtender
protected

Used for extending context menu.

Definition at line 161 of file kexidblineedit.h.

◆ m_readOnlyValidator

TQGuardedPtr<const TQValidator> KexiDBLineEdit::m_readOnlyValidator
protected

Used for read only flag to disable editing.

Definition at line 155 of file kexidblineedit.h.

◆ m_readWriteValidator

TQGuardedPtr<const TQValidator> KexiDBLineEdit::m_readWriteValidator
protected

Used to remember the previous validator used forf r/w mode, after setting the read only flag.

Definition at line 158 of file kexidblineedit.h.

◆ m_slotTextChanged_enabled

bool KexiDBLineEdit::m_slotTextChanged_enabled
protected

Used in slotTextChanged().

Definition at line 168 of file kexidblineedit.h.

◆ m_textFormatter

KexiTextFormatter KexiDBLineEdit::m_textFormatter
protected

Used to format text.

Definition at line 152 of file kexidblineedit.h.


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