kexi

#include <kexidbtextedit.h>

Inheritance diagram for KexiDBTextEdit:
KexiDBTextWidgetInterface KexiFormDataItemInterface KexiDataItemInterface

Public Slots

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

Public Member Functions

 KexiDBTextEdit (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 isReadOnly () const
 
virtual TQWidget * widget ()
 
virtual bool cursorAtStart ()
 
virtual bool cursorAtEnd ()
 
virtual void clear ()
 
virtual void setColumnInfo (KexiDB::QueryColumnInfo *cinfo)
 
virtual void setDisplayDefaultValue (TQWidget *widget, bool displayDefaultValue)
 
virtual void keyPressEvent (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 ()
 
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 Slots

void slotTextChanged ()
 

Protected Member Functions

virtual void paintEvent (TQPaintEvent *)
 
virtual void setValueInternal (const TQVariant &add, bool removeOld)
 
TQPopupMenu * createPopupMenu (const TQPoint &pos)
 
- 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 ()
 
virtual bool keyPressed (TQKeyEvent *ke)
 
- 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 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 Attributes

KexiDBWidgetContextMenuExtender m_menuExtender
 
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

Multiline edit widget for Kexi forms.

Definition at line 30 of file kexidbtextedit.h.

Constructor & Destructor Documentation

◆ KexiDBTextEdit()

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

Definition at line 31 of file kexidbtextedit.cpp.

◆ ~KexiDBTextEdit()

KexiDBTextEdit::~KexiDBTextEdit ( )
virtual

Definition at line 42 of file kexidbtextedit.cpp.

Member Function Documentation

◆ clear()

void KexiDBTextEdit::clear ( )
virtual

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

Implements KexiDataItemInterface.

Definition at line 131 of file kexidbtextedit.cpp.

◆ createPopupMenu()

TQPopupMenu * KexiDBTextEdit::createPopupMenu ( const TQPoint &  pos)
protected

Definition at line 151 of file kexidbtextedit.cpp.

◆ cursorAtEnd()

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

◆ cursorAtStart()

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

◆ dataSource()

TQString KexiDBTextEdit::dataSource ( ) const
inline

Definition at line 44 of file kexidbtextedit.h.

◆ dataSourceMimeType()

TQCString KexiDBTextEdit::dataSourceMimeType ( ) const
inline

Definition at line 45 of file kexidbtextedit.h.

◆ isReadOnly()

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

Reimplemented from KexiDataItemInterface.

Definition at line 91 of file kexidbtextedit.cpp.

◆ keyPressEvent()

void KexiDBTextEdit::keyPressEvent ( TQKeyEvent *  ke)
virtual

Windows uses Ctrl+Tab for moving between tabs, so do not steal this shortcut.

Definition at line 199 of file kexidbtextedit.cpp.

◆ moveCursorToEnd

void KexiDBTextEdit::moveCursorToEnd ( )
virtualslot

Implemented for KexiDataItemInterface.

Definition at line 184 of file kexidbtextedit.cpp.

◆ moveCursorToStart

void KexiDBTextEdit::moveCursorToStart ( )
virtualslot

Implemented for KexiDataItemInterface.

Definition at line 189 of file kexidbtextedit.cpp.

◆ paintEvent()

void KexiDBTextEdit::paintEvent ( TQPaintEvent *  pe)
protectedvirtual

Definition at line 144 of file kexidbtextedit.cpp.

◆ selectAll

void KexiDBTextEdit::selectAll ( )
virtualslot

Implemented for KexiDataItemInterface.

Definition at line 194 of file kexidbtextedit.cpp.

◆ setColumnInfo()

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

◆ setDataSource

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

Definition at line 81 of file kexidbtextedit.h.

◆ setDataSourceMimeType

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

Definition at line 82 of file kexidbtextedit.h.

◆ setDisplayDefaultValue()

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

Todo:
support rich text...

Reimplemented from KexiFormDataItemInterface.

Definition at line 163 of file kexidbtextedit.cpp.

◆ setInvalidState()

void KexiDBTextEdit::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 46 of file kexidbtextedit.cpp.

◆ setReadOnly

void KexiDBTextEdit::setReadOnly ( bool  readOnly)
virtualslot

Definition at line 96 of file kexidbtextedit.cpp.

◆ setText

void KexiDBTextEdit::setText ( const TQString &  text,
const TQString &  context 
)
virtualslot

Definition at line 107 of file kexidbtextedit.cpp.

◆ setValueInternal()

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

Todo:
temporary solution for booleans!

Implements KexiDataItemInterface.

Definition at line 55 of file kexidbtextedit.cpp.

◆ slotTextChanged

void KexiDBTextEdit::slotTextChanged ( )
protectedslot

Definition at line 74 of file kexidbtextedit.cpp.

◆ undo

void KexiDBTextEdit::undo ( )
virtualslot

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

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

Definition at line 158 of file kexidbtextedit.cpp.

◆ value()

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

Implements KexiDataItemInterface.

Definition at line 69 of file kexidbtextedit.cpp.

◆ valueIsEmpty()

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

◆ valueIsNull()

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

◆ widget()

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

Reimplemented from KexiFormDataItemInterface.

Definition at line 112 of file kexidbtextedit.cpp.

Member Data Documentation

◆ m_menuExtender

KexiDBWidgetContextMenuExtender KexiDBTextEdit::m_menuExtender
protected

Used for extending context menu.

Definition at line 108 of file kexidbtextedit.h.

◆ m_slotTextChanged_enabled

bool KexiDBTextEdit::m_slotTextChanged_enabled
protected

Used to disable slotTextChanged()

Definition at line 111 of file kexidbtextedit.h.


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