kexi

KexiDBTextEdit Class Reference

#include <kexidbtextedit.h>

Inheritance diagram for KexiDBTextEdit:

KexiDBTextWidgetInterface KexiFormDataItemInterface KexiDataItemInterface List of all members.

Detailed Description

Multiline edit widget for Kexi forms.

Definition at line 30 of file kexidbtextedit.h.


Public Slots

void setDataSource (const QString &ds)
void setDataSourceMimeType (const QCString &ds)
virtual void setReadOnly (bool readOnly)
virtual void setText (const QString &text, const QString &context)
virtual void undo ()
virtual void moveCursorToEnd ()
virtual void moveCursorToStart ()
virtual void selectAll ()

Public Member Functions

 KexiDBTextEdit (QWidget *parent, const char *name=0)
virtual ~KexiDBTextEdit ()
QString dataSource () const
QCString dataSourceMimeType () const
virtual QVariant value ()
virtual void setInvalidState (const QString &displayText)
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
virtual bool isReadOnly () const
virtual QWidget * widget ()
virtual bool cursorAtStart ()
virtual bool cursorAtEnd ()
virtual void clear ()
virtual void setColumnInfo (KexiDB::QueryColumnInfo *cinfo)
virtual void setDisplayDefaultValue (QWidget *widget, bool displayDefaultValue)

Protected Slots

void slotTextChanged ()

Protected Member Functions

virtual void paintEvent (QPaintEvent *)
virtual void setValueInternal (const QVariant &add, bool removeOld)
QPopupMenu * createPopupMenu (const QPoint &pos)

Protected Attributes

KexiDBWidgetContextMenuExtender m_menuExtender
bool m_slotTextChanged_enabled: 1

Properties

QString dataSource []
QCString dataSourceMimeType []

Member Function Documentation

QString KexiDBTextEdit::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 43 of file kexidbtextedit.h.

QCString KexiDBTextEdit::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 44 of file kexidbtextedit.h.

QVariant KexiDBTextEdit::value (  )  [virtual]

Returns:
value currently represented by this item.

Implements KexiDataItemInterface.

Definition at line 66 of file kexidbtextedit.cpp.

void KexiDBTextEdit::setInvalidState ( const QString &  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.

Implements KexiFormDataItemInterface.

Definition at line 43 of file kexidbtextedit.cpp.

bool KexiDBTextEdit::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 78 of file kexidbtextedit.cpp.

bool KexiDBTextEdit::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 83 of file kexidbtextedit.cpp.

bool KexiDBTextEdit::isReadOnly (  )  const [virtual]

Returns:
'readOnly' flag for this widget.

Reimplemented from KexiDataItemInterface.

Definition at line 88 of file kexidbtextedit.cpp.

QWidget * KexiDBTextEdit::widget (  )  [virtual]

Returns:
the view widget of this item, e.g. line edit widget.

Reimplemented from KexiFormDataItemInterface.

Definition at line 109 of file kexidbtextedit.cpp.

bool KexiDBTextEdit::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 114 of file kexidbtextedit.cpp.

bool KexiDBTextEdit::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 121 of file kexidbtextedit.cpp.

void KexiDBTextEdit::clear (  )  [virtual]

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

Implements KexiDataItemInterface.

Definition at line 128 of file kexidbtextedit.cpp.

void KexiDBTextEdit::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.

Reimplemented from KexiFormDataItemInterface.

Definition at line 133 of file kexidbtextedit.cpp.

void KexiDBTextEdit::setDisplayDefaultValue ( QWidget *  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.

Todo:
support rich text...

Reimplemented from KexiFormDataItemInterface.

Definition at line 160 of file kexidbtextedit.cpp.

void KexiDBTextEdit::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 77 of file kexidbtextedit.h.

void KexiDBTextEdit::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 78 of file kexidbtextedit.h.

void KexiDBTextEdit::setReadOnly ( bool  readOnly  )  [virtual, slot]

Changes 'read only' flag, for this widget. Typically this flag can be passed to a widget itself, e.g. KLineEdit::setReadOnly(bool).

Implements KexiFormDataItemInterface.

Definition at line 93 of file kexidbtextedit.cpp.

void KexiDBTextEdit::undo (  )  [virtual, slot]

Todo:
enable "real" undo internally so user can use ctrl+z while editing

Definition at line 155 of file kexidbtextedit.cpp.

void KexiDBTextEdit::moveCursorToEnd (  )  [virtual, slot]

Implemented for KexiDataItemInterface.

Reimplemented from KexiDataItemInterface.

Definition at line 181 of file kexidbtextedit.cpp.

void KexiDBTextEdit::moveCursorToStart (  )  [virtual, slot]

Implemented for KexiDataItemInterface.

Reimplemented from KexiDataItemInterface.

Definition at line 186 of file kexidbtextedit.cpp.

void KexiDBTextEdit::selectAll (  )  [virtual, slot]

Implemented for KexiDataItemInterface.

Reimplemented from KexiDataItemInterface.

Definition at line 191 of file kexidbtextedit.cpp.

void KexiDBTextEdit::setValueInternal ( const QVariant &  add,
bool  removeOld 
) [protected, virtual]

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 52 of file kexidbtextedit.cpp.


Member Data Documentation

Used for extending context menu.

Definition at line 104 of file kexidbtextedit.h.

Used to disable slotTextChanged().

Definition at line 107 of file kexidbtextedit.h.


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