kexi
kexiblobtableedit.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _KEXIBLOBTABLEEDIT_H_
00022 #define _KEXIBLOBTABLEEDIT_H_
00023
00024 #include <qcstring.h>
00025 #include <qcache.h>
00026
00027 #include <kurl.h>
00028
00029 #include "kexitableedit.h"
00030 #include "kexicelleditorfactory.h"
00031
00032 class KTempFile;
00033 class KProcess;
00034 class QTextEdit;
00035
00036 class KexiBlobTableEdit : public KexiTableEdit
00037 {
00038 Q_OBJECT
00039 public:
00040 KexiBlobTableEdit(KexiTableViewColumn &column, QWidget *parent=0);
00041 virtual ~KexiBlobTableEdit();
00042
00043 bool valueIsNull();
00044 bool valueIsEmpty();
00045
00046 virtual QVariant value();
00047
00048 virtual bool cursorAtStart();
00049 virtual bool cursorAtEnd();
00050
00052 virtual void resize(int w, int h);
00053
00054 virtual void showFocus( const QRect& r, bool readOnly );
00055
00056 virtual void hideFocus();
00057
00059 virtual QSize totalSize() const;
00060
00061 virtual void paintFocusBorders( QPainter *p, QVariant &, int x, int y, int w, int h );
00062
00064 virtual bool handleKeyPress( QKeyEvent* ke, bool editorActive );
00065
00069 virtual bool handleDoubleClick();
00070
00073 virtual void handleAction(const QString& actionName);
00074
00078 virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue);
00079
00080 virtual void setupContents( QPainter *p, bool focused, const QVariant& val,
00081 QString &txt, int &align, int &x, int &y_offset, int &w, int &h );
00082
00083 protected slots:
00084 void slotUpdateActionsAvailabilityRequested(bool& valueIsNull, bool& valueIsReadOnly);
00085
00086 void handleInsertFromFileAction(const KURL& url);
00087 void handleAboutToSaveAsAction(QString& origFilename, QString& fileExtension, bool& dataIsEmpty);
00088 void handleSaveAsAction(const QString& fileName);
00089 void handleCutAction();
00090 void handleCopyAction();
00091 void handlePasteAction();
00092 virtual void clear();
00093 void handleShowPropertiesAction();
00094
00095 protected:
00097 virtual void setValueInternal(const QVariant& add, bool removeOld);
00098
00099
00100
00101
00103 void updateFocus( const QRect& r );
00104
00105 void signalEditRequested();
00106
00108 void executeCopyAction(const QByteArray& data);
00109
00110 virtual bool eventFilter( QObject *o, QEvent *e );
00111
00112 class Private;
00113 Private *d;
00114
00115
00116
00117 };
00118
00119 KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiBlobEditorFactoryItem)
00120
00121
00122
00123
00124
00125
00128 class KexiKIconTableEdit : public KexiTableEdit
00129 {
00130 public:
00131 KexiKIconTableEdit(KexiTableViewColumn &column, QWidget *parent=0);
00132
00133 virtual ~KexiKIconTableEdit();
00134
00136 virtual bool valueIsNull();
00137
00141 virtual bool valueIsEmpty();
00142
00143 virtual QVariant value();
00144
00145 virtual bool cursorAtStart();
00146 virtual bool cursorAtEnd();
00147
00148 virtual void clear();
00149
00150 virtual void setupContents( QPainter *p, bool focused, const QVariant& val,
00151 QString &txt, int &align, int &x, int &y_offset, int &w, int &h );
00152
00155 virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue);
00156
00157 protected:
00159 virtual void setValueInternal(const QVariant& add, bool removeOld);
00160
00161 void showHintButton();
00162 void init();
00163
00164 class Private;
00165 Private *d;
00166 };
00167
00168 KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiKIconTableEditorFactoryItem)
00169
00170 #endif
|