kexi

#include <kexidatetableedit.h>

Inheritance diagram for KexiDateTableEdit:
KexiInputTableEdit KexiTableEdit KexiDataItemInterface

Public Member Functions

 KexiDateTableEdit (KexiTableViewColumn &column, TQWidget *parent=0)
 
virtual void setupContents (TQPainter *p, bool focused, const TQVariant &val, TQString &txt, int &align, int &x, int &y_offset, int &w, int &h)
 
virtual TQVariant value ()
 
virtual bool valueIsNull ()
 
virtual bool valueIsEmpty ()
 
virtual bool valueIsValid ()
 
virtual void handleAction (const TQString &actionName)
 
virtual void handleCopyAction (const TQVariant &value, const TQVariant &visibleValue)
 
- Public Member Functions inherited from KexiInputTableEdit
 KexiInputTableEdit (KexiTableViewColumn &column, TQWidget *parent=0)
 
virtual bool valueChanged ()
 
virtual bool cursorAtStart ()
 
virtual bool cursorAtEnd ()
 
virtual void clear ()
 
virtual TQSize totalSize ()
 
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)
 
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 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 Member Functions

void setValueInInternalEditor (const TQVariant &value)
 
virtual void setValueInternal (const TQVariant &add, bool removeOld)
 
TQDate dateValue () const
 
- Protected Member Functions inherited from KexiInputTableEdit
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

KexiDateFormatter m_formatter
 
- Protected Attributes inherited from KexiInputTableEdit
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
 

Additional Inherited Members

- Public Slots inherited from KexiInputTableEdit
virtual void moveCursorToEnd ()
 
virtual void moveCursorToStart ()
 
virtual void selectAll ()
 
- Signals inherited from KexiInputTableEdit
void hintClicked ()
 
- Signals inherited from KexiTableEdit
void editRequested ()
 
void cancelRequested ()
 
void acceptRequested ()
 
- Protected Slots inherited from KexiInputTableEdit
void setRestrictedCompletion ()
 
void completed (const TQString &)
 

Detailed Description

Editor class for Date type. It is a replacement TQDateEdit due to usability problems: people are accustomed to use single-character cursor. Date format is retrieved from the KDE global settings. and input/output is performed using KLineEdit (from KexiInputTableEdit).

Definition at line 34 of file kexidatetableedit.h.

Constructor & Destructor Documentation

◆ KexiDateTableEdit()

KexiDateTableEdit::KexiDateTableEdit ( KexiTableViewColumn &  column,
TQWidget *  parent = 0 
)
Todo:
add TQValidator so date like "2006-59-67" cannot be even entered

Definition at line 51 of file kexidatetableedit.cpp.

◆ ~KexiDateTableEdit()

KexiDateTableEdit::~KexiDateTableEdit ( )
virtual

Definition at line 61 of file kexidatetableedit.cpp.

Member Function Documentation

◆ dateValue()

TQDate KexiDateTableEdit::dateValue ( ) const
protected

Definition at line 119 of file kexidatetableedit.cpp.

◆ handleAction()

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

Reimplemented after KexiInputTableEdit.

Reimplemented from KexiInputTableEdit.

Definition at line 145 of file kexidatetableedit.cpp.

◆ handleCopyAction()

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

Reimplemented after KexiInputTableEdit.

Reimplemented from KexiInputTableEdit.

Definition at line 136 of file kexidatetableedit.cpp.

◆ setupContents()

void KexiDateTableEdit::setupContents ( TQPainter *  p,
bool  focused,
const TQVariant &  val,
TQString &  txt,
int &  align,
int &  x,
int &  y_offset,
int &  w,
int &  h 
)
virtual

For reimplementation. Sets up and paints cell's contents using context of val value. focused is true if the cell is focused. align is set using TQt::AlignmentFlags. Some additional things may be painted using p, but it is not needed to paint the text (this is done automatically outside of this method).

Before calling, x, y_offset, w, h parameters are initialized, but you can tune these values depending on the context. You should set txt to a text representation of val, otherwise no text will be painted.

p can be 0 - in this case no painting should be performed, becasue caller only expects that x, y_offset, w, h, txt parameters are tuned, if needed. p painter's pen is set to foreground color (usually black) that should be used to paint foreground information, if needed. For example boolean editor widget paints a rectangle using this color.

Todo:
ADD OPTION to displaying NULL VALUES as e.g. "(null)"

Reimplemented from KexiTableEdit.

Definition at line 87 of file kexidatetableedit.cpp.

◆ setValueInInternalEditor()

void KexiDateTableEdit::setValueInInternalEditor ( const TQVariant &  value)
protected

helper

Definition at line 65 of file kexidatetableedit.cpp.

◆ setValueInternal()

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

initializes this editor with add value

Todo:
cut string if too long..

Reimplemented from KexiInputTableEdit.

Definition at line 73 of file kexidatetableedit.cpp.

◆ value()

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

Reimplemented from KexiInputTableEdit.

Definition at line 124 of file kexidatetableedit.cpp.

◆ valueIsEmpty()

bool KexiDateTableEdit::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()),

Reimplemented from KexiInputTableEdit.

Definition at line 114 of file kexidatetableedit.cpp.

◆ valueIsNull()

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

Reimplemented from KexiInputTableEdit.

Definition at line 106 of file kexidatetableedit.cpp.

◆ valueIsValid()

bool KexiDateTableEdit::valueIsValid ( )
virtual
Returns
true if editor's value is valid for a given type Used for checking if an entered value is valid, E.g. a part of time value can be entered: "12:8" and this is invalid, not only null. Null time or date is valid in Kexi, so it is not enough to test value().isValid(). Default implementation just returns true.

Reimplemented from KexiDataItemInterface.

Definition at line 129 of file kexidatetableedit.cpp.

Member Data Documentation

◆ m_formatter

KexiDateFormatter KexiDateTableEdit::m_formatter
protected

Used to format and convert date values.

Definition at line 62 of file kexidatetableedit.h.


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