kexi
KexiDBImageBox Class Reference
#include <kexidbimagebox.h>
Inheritance diagram for KexiDBImageBox:

Detailed Description
A data-aware, editable image box.Can also act as a normal static image box.
Definition at line 33 of file kexidbimagebox.h.
Public Slots | |
void | setPixmapId (uint id) |
void | setStoredPixmapId (uint id) |
virtual void | setDataSource (const QString &ds) |
void | setDataSourceMimeType (const QCString &ds) |
virtual void | setReadOnly (bool set) |
void | setScaledContents (bool set) |
void | insertFromFile () |
void | setAlignment (int alignment) |
void | setKeepAspectRatio (bool set) |
void | updateActionsAvailability () |
void | saveAs () |
void | cut () |
void | copy () |
void | paste () |
virtual void | clear () |
void | showProperties () |
Signals | |
virtual void | valueChanged (const QByteArray &data) |
void | idChanged (long id) |
Public Member Functions | |
KexiDBImageBox (bool designMode, QWidget *parent, const char *name=0) | |
virtual | ~KexiDBImageBox () |
QString | dataSource () const |
QCString | dataSourceMimeType () const |
virtual QVariant | value () |
QPixmap | pixmap () const |
uint | pixmapId () const |
uint | storedPixmapId () const |
virtual void | setInvalidState (const QString &displayText) |
virtual bool | valueIsNull () |
virtual bool | valueIsEmpty () |
virtual QWidget * | widget () |
virtual bool | cursorAtStart () |
virtual bool | cursorAtEnd () |
virtual bool | isReadOnly () const |
bool | hasScaledContents () const |
int | alignment () const |
bool | keepAspectRatio () const |
virtual QSize | sizeHint () const |
KActionCollection * | actionCollection () |
Protected Slots | |
void | slotAboutToHidePopupMenu () |
void | slotChooserPressed () |
Protected Member Functions | |
QByteArray | data () const |
virtual void | contextMenuEvent (QContextMenuEvent *e) |
virtual void | paintEvent (QPaintEvent *) |
virtual void | setValueInternal (const QVariant &add, bool) |
void | updateActionStrings () |
void | updatePixmap () |
void | setData (const KexiBLOBBuffer::Handle &handle) |
bool | popupMenuAvailable () |
Protected Attributes | |
QPixmap | m_pixmap |
QByteArray | m_value |
KexiBLOBBuffer::Handle | m_data |
Button * | m_chooser |
KPopupMenu * | m_popup |
KActionCollection | m_actionCollection |
KAction * | m_insertFromFileAction |
KAction * | m_saveAsAction |
KAction * | m_cutAction |
KAction * | m_copyAction |
KAction * | m_pasteAction |
KAction * | m_deleteAction |
KAction * | m_propertiesAction |
QTimer | m_clickTimer |
int | m_titleID |
int | m_alignment |
bool | m_designMode: 1 |
bool | m_readOnly: 1 |
bool | m_scaledContents: 1 |
bool | m_keepAspectRatio: 1 |
bool | m_insideSetData: 1 |
Properties | |
QString | dataSource [] |
QCString | dataSourceMimeType [] |
bool | readOnly [] |
uint | pixmapId [] |
uint | storedPixmapId [] |
bool | scaledContents [] |
bool | keepAspectRatio [] |
Alignment | alignment [] |
Member Function Documentation
void KexiDBImageBox::clear | ( | ) | [virtual, slot] |
clears item's data, so the data will contain NULL data
Implements KexiDataItemInterface.
Definition at line 467 of file kexidbimagebox.cpp.
bool KexiDBImageBox::cursorAtEnd | ( | ) | [virtual] |
bool KexiDBImageBox::cursorAtStart | ( | ) | [virtual] |
QByteArray KexiDBImageBox::data | ( | ) | const [protected] |
- Returns:
- data depending on the current mode (db-aware or static)
Definition at line 368 of file kexidbimagebox.cpp.
QString KexiDBImageBox::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 52 of file kexidbimagebox.h.
QCString KexiDBImageBox::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 53 of file kexidbimagebox.h.
void KexiDBImageBox::insertFromFile | ( | ) | [slot] |
Definition at line 307 of file kexidbimagebox.cpp.
bool KexiDBImageBox::isReadOnly | ( | ) | const [virtual] |
- Returns:
- 'readOnly' flag for this item. The flag is usually taken from the item's widget, e.g. KLineEdit::isReadOnly(). By default, always returns false.
Reimplemented from KexiDataItemInterface.
Definition at line 201 of file kexidbimagebox.cpp.
void KexiDBImageBox::paintEvent | ( | QPaintEvent * | ) | [protected, virtual] |
Definition at line 598 of file kexidbimagebox.cpp.
bool KexiDBImageBox::popupMenuAvailable | ( | ) | [protected] |
Definition at line 566 of file kexidbimagebox.cpp.
void KexiDBImageBox::saveAs | ( | ) | [slot] |
Definition at line 380 of file kexidbimagebox.cpp.
void KexiDBImageBox::setDataSource | ( | const QString & | ds | ) | [virtual, slot] |
Sets the datasource to ds.
Reimplemented from KexiFormDataItemInterface.
Definition at line 574 of file kexidbimagebox.cpp.
void KexiDBImageBox::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 111 of file kexidbimagebox.h.
void KexiDBImageBox::setInvalidState | ( | const QString & | 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 172 of file kexidbimagebox.cpp.
void KexiDBImageBox::setPixmapId | ( | uint | id | ) | [slot] |
- Returns:
- original file name of image loaded from a file. This can be later reused for displaying the image within a collection (to be implemented) or on saving the image data back to file.
Definition at line 230 of file kexidbimagebox.cpp.
void KexiDBImageBox::setScaledContents | ( | bool | set | ) | [slot] |
Sets pixmapData data for this widget.
Sets original file name of image loaded from a file.
- See also:
- originalFileName()
Definition at line 265 of file kexidbimagebox.cpp.
void KexiDBImageBox::setValueInternal | ( | const QVariant & | add, | |
bool | ||||
) | [protected, virtual] |
Sets value value for a widget.
Implements KexiDataItemInterface.
Definition at line 162 of file kexidbimagebox.cpp.
void KexiDBImageBox::showProperties | ( | ) | [slot] |
Definition at line 491 of file kexidbimagebox.cpp.
void KexiDBImageBox::updateActionStrings | ( | ) | [protected] |
Updates i18n'd action strings after datasource change.
Definition at line 549 of file kexidbimagebox.cpp.
QVariant KexiDBImageBox::value | ( | ) | [virtual] |
- Returns:
- value currently represented by this item.
Implements KexiDataItemInterface.
Definition at line 152 of file kexidbimagebox.cpp.
virtual void KexiDBImageBox::valueChanged | ( | const QByteArray & | data | ) | [virtual, signal] |
Emitted when value has been changed. Actual value can be obtained using value().
bool KexiDBImageBox::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 196 of file kexidbimagebox.cpp.
bool KexiDBImageBox::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 190 of file kexidbimagebox.cpp.
QWidget * KexiDBImageBox::widget | ( | ) | [virtual] |
Convenience function: casts this item to a QWidget. Can return 0 if the item is not a QWidget-derived object.
Reimplemented from KexiFormDataItemInterface.
Definition at line 279 of file kexidbimagebox.cpp.
Member Data Documentation
QByteArray KexiDBImageBox::m_value [protected] |
The documentation for this class was generated from the following files: