kexi

#include <kexidblabel.h>

Inheritance diagram for KexiDBLabel:
KexiDBTextWidgetInterface KexiFormDataItemInterface KexiDataItemInterface

Public Slots

void setDataSource (const TQString &ds)
void setDataSourceMimeType (const TQCString &ds)
virtual void setText (const TQString &text)
void setShadowEnabled (bool state)
virtual void setPalette (const TQPalette &pal)
virtual void setFrameColor (const TQColor &color)

Public Member Functions

 KexiDBLabel (TQWidget *parent, const char *name=0, WFlags f=0)
 KexiDBLabel (const TQString &text, TQWidget *parent, const char *name=0, WFlags f=0)
TQString dataSource () const
TQCString dataSourceMimeType () const
virtual TQVariant value ()
bool shadowEnabled () const
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 bool setProperty (const char *name, const TQVariant &value)
virtual const TQColor & frameColor () const
Public Member Functions inherited from KexiFormDataItemInterface
TQString dataSource () const
void setDataSource (const TQString &ds)
TQCString dataSourceMimeType () const
void setDataSourceMimeType (const TQCString &ds)
virtual void setDisplayDefaultValue (TQWidget *widget, bool displayDefaultValue)
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

virtual void setReadOnly (bool readOnly)
void updatePixmap ()

Protected Member Functions

void init ()
virtual void setColumnInfo (KexiDB::QueryColumnInfo *cinfo)
virtual void paintEvent (TQPaintEvent *)
virtual void resizeEvent (TQResizeEvent *e)
virtual void setValueInternal (const TQVariant &add, bool removeOld)
virtual void fontChange (const TQFont &font)
virtual void styleChange (TQStyle &style)
virtual void enabledChange (bool enabled)
virtual void paletteChange (const TQPalette &oldPal)
virtual void frameChanged ()
virtual void showEvent (TQShowEvent *e)
virtual void drawFrame (TQPainter *)
void updatePixmapLater ()
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 void setDisplayDefaultValue (TQWidget *widget, bool displayDefaultValue)
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

Private * d
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

An extended, data-aware, read-only text label.

It's text may have a drop-shadow.

Author
Christian Nitschkowski, Jaroslaw Staniek

Definition at line 42 of file kexidblabel.h.

Constructor & Destructor Documentation

◆ KexiDBLabel() [1/2]

KexiDBLabel::KexiDBLabel ( TQWidget * parent,
const char * name = 0,
WFlags f = 0 )

Definition at line 398 of file kexidblabel.cpp.

◆ KexiDBLabel() [2/2]

KexiDBLabel::KexiDBLabel ( const TQString & text,
TQWidget * parent,
const char * name = 0,
WFlags f = 0 )

Definition at line 407 of file kexidblabel.cpp.

◆ ~KexiDBLabel()

KexiDBLabel::~KexiDBLabel ( )
virtual

Definition at line 417 of file kexidblabel.cpp.

Member Function Documentation

◆ clear()

void KexiDBLabel::clear ( )
virtual

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

Implements KexiDataItemInterface.

Definition at line 549 of file kexidblabel.cpp.

◆ cursorAtEnd()

bool KexiDBLabel::cursorAtEnd ( )
virtual

always false

Implements KexiDataItemInterface.

Definition at line 544 of file kexidblabel.cpp.

◆ cursorAtStart()

bool KexiDBLabel::cursorAtStart ( )
virtual

always false

Implements KexiDataItemInterface.

Definition at line 539 of file kexidblabel.cpp.

◆ dataSource()

TQString KexiDBLabel::dataSource ( ) const
inline

Definition at line 58 of file kexidblabel.h.

◆ dataSourceMimeType()

TQCString KexiDBLabel::dataSourceMimeType ( ) const
inline

Definition at line 59 of file kexidblabel.h.

◆ drawFrame()

virtual void KexiDBLabel::drawFrame ( TQPainter * )
protectedvirtual

Reimplemented to paint using real frame color instead of froeground. Also allows to paint more types of frame.

◆ enabledChange()

void KexiDBLabel::enabledChange ( bool enabled)
protectedvirtual

Definition at line 601 of file kexidblabel.cpp.

◆ fontChange()

void KexiDBLabel::fontChange ( const TQFont & font)
protectedvirtual

Definition at line 590 of file kexidblabel.cpp.

◆ frameChanged()

void KexiDBLabel::frameChanged ( )
protectedvirtual

Definition at line 623 of file kexidblabel.cpp.

◆ init()

void KexiDBLabel::init ( )
protected

Definition at line 422 of file kexidblabel.cpp.

◆ isReadOnly()

bool KexiDBLabel::isReadOnly ( ) const
virtual

always true

Reimplemented from KexiDataItemInterface.

Definition at line 524 of file kexidblabel.cpp.

◆ paintEvent()

void KexiDBLabel::paintEvent ( TQPaintEvent * e)
protectedvirtual

If required, update the pixmap-cache.

If the part that should be redrawn intersects with our shadow, redraw the shadow where it intersects with e->rect(). Have to move the clipping rect around a bit because the shadow has to be drawn using an offset relative to the widgets border.

Definition at line 467 of file kexidblabel.cpp.

◆ paletteChange()

void KexiDBLabel::paletteChange ( const TQPalette & oldPal)
protectedvirtual

Definition at line 607 of file kexidblabel.cpp.

◆ resizeEvent()

void KexiDBLabel::resizeEvent ( TQResizeEvent * e)
protectedvirtual

Definition at line 583 of file kexidblabel.cpp.

◆ setColumnInfo()

void KexiDBLabel::setColumnInfo ( KexiDB::QueryColumnInfo * cinfo)
protectedvirtual

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 569 of file kexidblabel.cpp.

◆ setDataSource

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

Sets the datasource to ds.

Definition at line 93 of file kexidblabel.h.

◆ setDataSourceMimeType

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

Definition at line 95 of file kexidblabel.h.

◆ setInvalidState()

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

Implements KexiFormDataItemInterface.

Definition at line 509 of file kexidblabel.cpp.

◆ setProperty()

bool KexiDBLabel::setProperty ( const char * name,
const TQVariant & value )
virtual

used to catch setIndent(), etc.

Definition at line 554 of file kexidblabel.cpp.

◆ setReadOnly

void KexiDBLabel::setReadOnly ( bool readOnly)
protectedvirtualslot

empty

Definition at line 529 of file kexidblabel.cpp.

◆ setShadowEnabled

void KexiDBLabel::setShadowEnabled ( bool state)
slot

Enable/Disable the shadow effect. KexiDBLabel acts just like a normal TQLabel when shadow is disabled.

Definition at line 575 of file kexidblabel.cpp.

◆ setText

void KexiDBLabel::setText ( const TQString & text)
virtualslot

Definition at line 634 of file kexidblabel.cpp.

◆ setValueInternal()

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

Sets value value for a widget.

Implements KexiDataItemInterface.

Definition at line 498 of file kexidblabel.cpp.

◆ shadowEnabled()

bool KexiDBLabel::shadowEnabled ( ) const

Definition at line 642 of file kexidblabel.cpp.

◆ showEvent()

void KexiDBLabel::showEvent ( TQShowEvent * e)
protectedvirtual

Definition at line 629 of file kexidblabel.cpp.

◆ styleChange()

void KexiDBLabel::styleChange ( TQStyle & style)
protectedvirtual

Definition at line 596 of file kexidblabel.cpp.

◆ updatePixmap

void KexiDBLabel::updatePixmap ( )
protectedslot

Whatever has changed in KexiDBLabel, every parameter is set to our private-label. Just in case...

Definition at line 447 of file kexidblabel.cpp.

◆ updatePixmapLater()

void KexiDBLabel::updatePixmapLater ( )
protected

Definition at line 432 of file kexidblabel.cpp.

◆ value()

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

Implements KexiDataItemInterface.

Definition at line 505 of file kexidblabel.cpp.

◆ valueIsEmpty()

bool KexiDBLabel::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 of form is met.

Implements KexiDataItemInterface.

Definition at line 519 of file kexidblabel.cpp.

◆ valueIsNull()

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

Implements KexiDataItemInterface.

Definition at line 514 of file kexidblabel.cpp.

◆ widget()

TQWidget * KexiDBLabel::widget ( )
virtual

Convenience function: casts this item to a TQWidget. Can return 0 if the item is not a TQWidget-derived object.

Reimplemented from KexiFormDataItemInterface.

Definition at line 534 of file kexidblabel.cpp.

Member Data Documentation

◆ d

Private* KexiDBLabel::d
protected

Definition at line 138 of file kexidblabel.h.


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