kexi

#include <kexiinputtableedit.h>

Inheritance diagram for KexiInputTableEdit:
KexiTableEdit KexiDataItemInterface KexiComboBoxTableEdit KexiDateTableEdit KexiDateTimeTableEdit KexiTimeTableEdit

Public Slots

virtual void moveCursorToEnd ()
virtual void moveCursorToStart ()
virtual void selectAll ()

Signals

void hintClicked ()
Signals inherited from KexiTableEdit
void editRequested ()
void cancelRequested ()
void acceptRequested ()

Public Member Functions

 KexiInputTableEdit (KexiTableViewColumn &column, TQWidget *parent=0)
virtual bool valueChanged ()
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
virtual TQVariant value ()
virtual bool cursorAtStart ()
virtual bool cursorAtEnd ()
virtual void clear ()
virtual TQSize totalSize ()
virtual void handleAction (const TQString &actionName)
virtual void handleCopyAction (const TQVariant &value, const TQVariant &visibleValue)
virtual bool showToolTipIfNeeded (const TQVariant &value, const TQRect &rect, const TQFontMetrics &fm, bool focused)
Public Member Functions inherited from KexiTableEdit
 KexiTableEdit (KexiTableViewColumn &column, TQWidget *parent=0)
virtual KexiDB::Field * field () const
virtual KexiDB::QueryColumnInfo * columnInfo () const
virtual void setColumnInfo (KexiDB::QueryColumnInfo *)
KexiTableViewColumn * column () const
KexiDB::Field * displayedField () const
virtual void resize (int w, int h)
virtual TQWidget * widget ()
virtual void hideWidget ()
virtual void showWidget ()
virtual void paintFocusBorders (TQPainter *p, TQVariant &cal, int x, int y, int w, int h)
virtual void setupContents (TQPainter *p, bool focused, const TQVariant &val, TQString &txt, int &align, int &x, int &y_offset, int &w, int &h)
bool usesSelectedTextColor () const
virtual void paintSelectionBackground (TQPainter *p, bool focused, const TQString &txt, int align, int x, int y_offset, int w, int h, const TQColor &fillColor, const TQFontMetrics &fm, bool readOnly, bool fullRowSelection)
int leftMargin () const
int rightMargin (bool focused) const
virtual bool handleKeyPress (TQKeyEvent *ke, bool editorActive)
virtual bool handleDoubleClick ()
virtual int widthForValue (TQVariant &val, const TQFontMetrics &fm)
virtual void createInternalEditor (KexiDB::QuerySchema &schema)
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 isReadOnly () const
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 Slots

void setRestrictedCompletion ()
void completed (const TQString &)

Protected Member Functions

virtual void setValueInternal (const TQVariant &add, bool removeOld)
void showHintButton ()
void init ()
virtual void paintEvent (TQPaintEvent *e)
Protected Member Functions inherited from KexiTableEdit
virtual bool eventFilter (TQObject *watched, TQEvent *e)
void setViewWidget (TQWidget *v)
void moveChild (TQWidget *child, int x, int y)
void repaintRelatedCell ()
Protected Member Functions inherited from KexiDataItemInterface
virtual void setVisibleValueInternal (const TQVariant &value)
virtual void signalValueChanged ()
virtual void beforeSignalValueChanged ()
KexiDataItemChangesListener * listener ()

Protected Attributes

KexiTextFormatter m_textFormatter
bool m_calculatedCell
TQString m_decsym
TQString m_origText
KLineEdit * m_lineedit
Protected Attributes inherited from KexiTableEdit
KexiTableViewColumn * m_column
int m_leftMargin
int m_rightMargin
int m_rightMarginWhenFocused
TQScrollView * m_scrollView
bool m_usesSelectedTextColor: 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

General purpose cell editor using line edit widget.

Definition at line 33 of file kexiinputtableedit.h.

Constructor & Destructor Documentation

◆ KexiInputTableEdit()

KexiInputTableEdit::KexiInputTableEdit ( KexiTableViewColumn & column,
TQWidget * parent = 0 )

Definition at line 63 of file kexiinputtableedit.cpp.

◆ ~KexiInputTableEdit()

KexiInputTableEdit::~KexiInputTableEdit ( )
virtual

Definition at line 73 of file kexiinputtableedit.cpp.

Member Function Documentation

◆ clear()

void KexiInputTableEdit::clear ( )
virtual

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

Implements KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit.

Definition at line 316 of file kexiinputtableedit.cpp.

◆ completed

void KexiInputTableEdit::completed ( const TQString & s)
protectedslot

Definition at line 254 of file kexiinputtableedit.cpp.

◆ cursorAtEnd()

bool KexiInputTableEdit::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 326 of file kexiinputtableedit.cpp.

◆ cursorAtStart()

bool KexiInputTableEdit::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 321 of file kexiinputtableedit.cpp.

◆ handleAction()

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

Handles action having standard name actionName. Action could be: "edit_cut", "edit_paste", etc.

Todo
handle rich text?

Reimplemented from KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 345 of file kexiinputtableedit.cpp.

◆ handleCopyAction()

void KexiInputTableEdit::handleCopyAction ( const TQVariant & value,
const TQVariant & visibleValue )
virtual

Handles copy action for value. The value is copied to clipboard in format appropriate for the editor's impementation, e.g. for image cell it can be a pixmap. visibleValue is unused here. Reimplemented after KexiTableEdit.

Todo
handle rich text?

Implements KexiTableEdit.

Reimplemented in KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 338 of file kexiinputtableedit.cpp.

◆ init()

void KexiInputTableEdit::init ( )
protected

Definition at line 77 of file kexiinputtableedit.cpp.

◆ moveCursorToEnd

void KexiInputTableEdit::moveCursorToEnd ( )
virtualslot

Implemented for KexiDataItemInterface.

mark

Definition at line 378 of file kexiinputtableedit.cpp.

◆ moveCursorToStart

void KexiInputTableEdit::moveCursorToStart ( )
virtualslot

Implemented for KexiDataItemInterface.

mark

Definition at line 383 of file kexiinputtableedit.cpp.

◆ paintEvent()

void KexiInputTableEdit::paintEvent ( TQPaintEvent * e)
protectedvirtual

Definition at line 222 of file kexiinputtableedit.cpp.

◆ selectAll

void KexiInputTableEdit::selectAll ( )
virtualslot

Implemented for KexiDataItemInterface.

Definition at line 388 of file kexiinputtableedit.cpp.

◆ setRestrictedCompletion

void KexiInputTableEdit::setRestrictedCompletion ( )
protectedslot

Definition at line 230 of file kexiinputtableedit.cpp.

◆ setValueInternal()

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

initializes this editor with add value

Implements KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 119 of file kexiinputtableedit.cpp.

◆ showToolTipIfNeeded()

bool KexiInputTableEdit::showToolTipIfNeeded ( const TQVariant & value,
const TQRect & rect,
const TQFontMetrics & fm,
bool focused )
virtual

Shows a special tooltip for value if needed, i.e. if the value could not fit inside rect for a given font metrics fm.

Returns
true a normal tooltip should be displayed (using TQToolTip,) and false if no tooltip should be displayed or a custom tooltip was displayed internally (not yet supported). This implementation converts the value to text using valueToText() if calue is not string to see whether it can fit inside the cell's rect. If the cell is currentl focused (selected), focused is true.

Reimplemented from KexiTableEdit.

Definition at line 366 of file kexiinputtableedit.cpp.

◆ totalSize()

TQSize KexiInputTableEdit::totalSize ( )
virtual
Returns
total size of this editor, including any buttons, etc. (if present).

Reimplemented from KexiTableEdit.

Definition at line 331 of file kexiinputtableedit.cpp.

◆ value()

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

js

Todo
PRESERVE PRECISION!
Todo
check constraints

Implements KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit, KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 277 of file kexiinputtableedit.cpp.

◆ valueChanged()

bool KexiInputTableEdit::valueChanged ( )
virtual
Returns
true if editor's value is changed (compared to original value)

Reimplemented from KexiDataItemInterface.

Reimplemented in KexiComboBoxTableEdit.

Definition at line 260 of file kexiinputtableedit.cpp.

◆ valueIsEmpty()

bool KexiInputTableEdit::valueIsEmpty ( )
virtual
Returns
true if editor's value is empty (not null). Only few field types can accept "EMPTY" property (check this with KexiDB::Field::hasEmptyProperty()),

Implements KexiDataItemInterface.

Reimplemented in KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 272 of file kexiinputtableedit.cpp.

◆ valueIsNull()

bool KexiInputTableEdit::valueIsNull ( )
virtual
Returns
true if editor's value is null (not empty)

Implements KexiDataItemInterface.

Reimplemented in KexiDateTableEdit, KexiDateTimeTableEdit, and KexiTimeTableEdit.

Definition at line 267 of file kexiinputtableedit.cpp.

Member Data Documentation

◆ m_calculatedCell

bool KexiInputTableEdit::m_calculatedCell
protected

Definition at line 116 of file kexiinputtableedit.h.

◆ m_decsym

TQString KexiInputTableEdit::m_decsym
protected

Definition at line 117 of file kexiinputtableedit.h.

◆ m_lineedit

KLineEdit* KexiInputTableEdit::m_lineedit
protected

orig. Line Edit's text after conversion - for easy comparing

Definition at line 119 of file kexiinputtableedit.h.

◆ m_origText

TQString KexiInputTableEdit::m_origText
protected

decimal symbol

Definition at line 118 of file kexiinputtableedit.h.

◆ m_textFormatter

KexiTextFormatter KexiInputTableEdit::m_textFormatter
protected

Definition at line 115 of file kexiinputtableedit.h.


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