Kexi API Documentation (2.0 alpha)

KexiDBCheckBox Class Reference

#include <kexidbcheckbox.h>

Inheritance diagram for KexiDBCheckBox:

QCheckBox KexiFormDataItemInterface KexiDataItemInterface List of all members.

Detailed Description

A db-aware check box.

Definition at line 28 of file kexidbcheckbox.h.

Public Types

enum  Tristate { TristateDefault, TristateOn, TristateOff }

Public Slots

void setDataSource (const QString &ds)
 Sets the name of the data source for this widget.
void setDataSourceMimeType (const QCString &ds)
void slotStateChanged (int state)
virtual void setReadOnly (bool readOnly)
 This implementation just disables read only widget.

Public Member Functions

 KexiDBCheckBox (const QString &text, QWidget *parent, const char *name=0)
virtual ~KexiDBCheckBox ()
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 QWidgetwidget ()
virtual bool cursorAtStart ()
virtual bool cursorAtEnd ()
virtual void clear ()
 clears item's data, so the data will contain NULL data
virtual void setEnabled (bool enabled)
void setTristate (Tristate tristate)
Tristate isTristate () const
virtual void setDisplayDefaultValue (QWidget *widget, bool displayDefaultValue)

Protected Member Functions

virtual void setValueInternal (const QVariant &add, bool removeOld)
bool isTristateInternal () const
void updateTristate ()
 Updates tristate in QCheckBox itself according to m_tristate.

Properties

QString dataSource
QCString dataSourceMimeType


Member Enumeration Documentation

enum KexiDBCheckBox::Tristate
 

Enumeration values:
TristateDefault 
TristateOn 
TristateOff 

Definition at line 67 of file kexidbcheckbox.h.


Constructor & Destructor Documentation

KexiDBCheckBox::KexiDBCheckBox const QString text,
QWidget parent,
const char *  name = 0
 

Definition at line 26 of file kexidbcheckbox.cpp.

References slotStateChanged(), and updateTristate().

KexiDBCheckBox::~KexiDBCheckBox  )  [virtual]
 

Definition at line 37 of file kexidbcheckbox.cpp.


Member Function Documentation

void KexiDBCheckBox::clear  )  [virtual]
 

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

Implements KexiDataItemInterface.

Definition at line 120 of file kexidbcheckbox.cpp.

bool KexiDBCheckBox::cursorAtEnd  )  [virtual]
 

Todo:
?

Implements KexiDataItemInterface.

Definition at line 115 of file kexidbcheckbox.cpp.

bool KexiDBCheckBox::cursorAtStart  )  [virtual]
 

Todo:
?

Implements KexiDataItemInterface.

Definition at line 110 of file kexidbcheckbox.cpp.

QString KexiDBCheckBox::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 40 of file kexidbcheckbox.h.

References KexiFormDataItemInterface::dataSource().

Referenced by isTristateInternal(), and updateTristate().

QCString KexiDBCheckBox::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 41 of file kexidbcheckbox.h.

References KexiFormDataItemInterface::dataSourceMimeType().

bool KexiDBCheckBox::isReadOnly  )  const [virtual]
 

Returns:
'readOnly' flag for this widget.

Reimplemented from KexiDataItemInterface.

Definition at line 99 of file kexidbcheckbox.cpp.

KexiDBCheckBox::Tristate KexiDBCheckBox::isTristate  )  const
 

Definition at line 132 of file kexidbcheckbox.cpp.

bool KexiDBCheckBox::isTristateInternal  )  const [protected]
 

Returns:
true in isTristate() == TristateDefault and the widget has bound data source or if isTristate() == TristateOn, else false is returned.

Definition at line 137 of file kexidbcheckbox.cpp.

References dataSource(), TristateDefault, and TristateOn.

Referenced by setValueInternal().

void KexiDBCheckBox::setDataSource const QString ds  )  [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 156 of file kexidbcheckbox.cpp.

References KexiFormDataItemInterface::setDataSource(), and updateTristate().

void KexiDBCheckBox::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 77 of file kexidbcheckbox.h.

References KexiFormDataItemInterface::setDataSourceMimeType().

void KexiDBCheckBox::setDisplayDefaultValue QWidget widget,
bool  displayDefaultValue
[virtual]
 

Reimplemented after KexiFormDataItemInterface.

Reimplemented from KexiFormDataItemInterface.

Definition at line 162 of file kexidbcheckbox.cpp.

References KexiFormDataItemInterface::m_displayParametersForDefaultValue, KexiFormDataItemInterface::m_displayParametersForEnteredValue, KexiFormDataItemInterface::setDisplayDefaultValue(), and KexiDisplayUtils::DisplayParameters::textColor.

void KexiDBCheckBox::setEnabled bool  enabled  )  [virtual]
 

Definition at line 53 of file kexidbcheckbox.cpp.

Referenced by setInvalidState(), and setReadOnly().

void KexiDBCheckBox::setInvalidState const QString displayText  )  [virtual]
 

Todo:
move this to KexiDataItemInterface::setInvalidStateInternal() ?

Implements KexiFormDataItemInterface.

Definition at line 41 of file kexidbcheckbox.cpp.

References setEnabled().

void KexiDBCheckBox::setReadOnly bool  readOnly  )  [virtual, slot]
 

This implementation just disables read only widget.

Implements KexiFormDataItemInterface.

Definition at line 61 of file kexidbcheckbox.cpp.

References setEnabled().

void KexiDBCheckBox::setTristate Tristate  tristate  ) 
 

Definition at line 125 of file kexidbcheckbox.cpp.

References updateTristate().

void KexiDBCheckBox::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 66 of file kexidbcheckbox.cpp.

References isTristateInternal(), and KexiDataItemInterface::m_origValue.

void KexiDBCheckBox::slotStateChanged int  state  )  [slot]
 

Definition at line 84 of file kexidbcheckbox.cpp.

References KexiDataItemInterface::signalValueChanged().

Referenced by KexiDBCheckBox().

void KexiDBCheckBox::updateTristate  )  [protected]
 

Updates tristate in QCheckBox itself according to m_tristate.

Todo:
the data source may be defined as NOT NULL... thus disallowing NULL state

Definition at line 145 of file kexidbcheckbox.cpp.

References dataSource(), TristateDefault, and TristateOn.

Referenced by KexiDBCheckBox(), setDataSource(), and setTristate().

QVariant KexiDBCheckBox::value  )  [virtual]
 

Returns:
value currently represented by this item.

Implements KexiDataItemInterface.

Definition at line 77 of file kexidbcheckbox.cpp.

bool KexiDBCheckBox::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 94 of file kexidbcheckbox.cpp.

bool KexiDBCheckBox::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 89 of file kexidbcheckbox.cpp.

QWidget * KexiDBCheckBox::widget  )  [virtual]
 

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

Reimplemented from KexiFormDataItemInterface.

Definition at line 105 of file kexidbcheckbox.cpp.


Property Documentation

QString KexiDBCheckBox::dataSource [read, write]
 

Definition at line 31 of file kexidbcheckbox.h.

QCString KexiDBCheckBox::dataSourceMimeType [read, write]
 

Definition at line 32 of file kexidbcheckbox.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:49:46 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003