kexi
kexicomboboxtableedit.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _KEXICOMBOBOXTABLEEDIT_H_
00022 #define _KEXICOMBOBOXTABLEEDIT_H_
00023
00024 #include "kexidb/field.h"
00025 #include "kexiinputtableedit.h"
00026
00027 class KPushButton;
00028 class KLineEdit;
00029 class KexiComboBoxPopup;
00030 class KexiTableItem;
00031 class KexiTableViewColumn;
00032
00036 class KexiComboBoxTableEdit : public KexiInputTableEdit
00037 {
00038 Q_OBJECT
00039
00040 public:
00041 KexiComboBoxTableEdit(KexiTableViewColumn &column, QScrollView *parent=0);
00042 virtual ~KexiComboBoxTableEdit();
00043
00045 virtual QVariant value();
00046
00047 virtual void clear();
00048
00049
00050
00051 virtual bool valueChanged();
00052 virtual bool valueIsNull();
00053 virtual bool valueIsEmpty();
00054
00056 virtual void resize(int w, int h);
00057
00058 virtual void showFocus( const QRect& r, bool readOnly );
00059
00060 virtual void hideFocus();
00061
00062 virtual void paintFocusBorders( QPainter *p, QVariant &cal, int x, int y, int w, int h );
00063
00064 virtual void setupContents( QPainter *p, bool focused, QVariant val,
00065 QString &txt, int &align, int &x, int &y_offset, int &w, int &h );
00066
00067
00068
00069 virtual bool handleKeyPress( QKeyEvent *ke, bool editorActive );
00070
00071 virtual int widthForValue( QVariant &val, QFontMetrics &fm );
00072
00073 public:
00074 virtual void hide();
00075 virtual void show();
00076
00078 virtual QSize totalSize() const;
00079
00080 protected slots:
00081 void slotButtonClicked();
00082 void showPopup();
00083 void slotRowAccepted(KexiTableItem *item, int row);
00084 void slotItemSelected(KexiTableItem*);
00085 void slotLineEditTextChanged(const QString &newtext);
00086 void slotPopupHidden();
00087
00088 protected:
00090 void updateFocus( const QRect& r );
00091
00092 virtual void setValueInternal(const QVariant& add, bool removeOld);
00093
00094 virtual bool eventFilter( QObject *o, QEvent *e );
00095
00096 void updateTextForHighlightedRow();
00097
00098
00099
00100
00106 QString valueForString(const QString& str, uint lookInColumn,
00107 uint returnFromColumn, bool allowNulls = false);
00108
00109
00112 void setLineEditText(const QString& text);
00113
00114 class Private;
00115 Private *d;
00116 };
00117
00118 KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiComboBoxEditorFactoryItem)
00119
00120 #endif
|