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 class Private;
00111 Private *d;
00112
00113
00114
00115 };
00116
00117 KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiBlobEditorFactoryItem)
00118
00119
00120
00121
00122
00123
00126 class KexiKIconTableEdit : public KexiTableEdit
00127 {
00128 public:
00129 KexiKIconTableEdit(KexiTableViewColumn &column, QWidget *parent=0);
00130
00131 virtual ~KexiKIconTableEdit();
00132
00134 virtual bool valueIsNull();
00135
00139 virtual bool valueIsEmpty();
00140
00141 virtual QVariant value();
00142
00143 virtual bool cursorAtStart();
00144 virtual bool cursorAtEnd();
00145
00146 virtual void clear();
00147
00148 virtual void setupContents( QPainter *p, bool focused, const QVariant& val,
00149 QString &txt, int &align, int &x, int &y_offset, int &w, int &h );
00150
00153 virtual void handleCopyAction(const QVariant& value, const QVariant& visibleValue);
00154
00155 protected:
00157 virtual void setValueInternal(const QVariant& add, bool removeOld);
00158
00159 void showHintButton();
00160 void init();
00161
00162 class Private;
00163 Private *d;
00164 };
00165
00166 KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiKIconTableEditorFactoryItem)
00167
00168 #endif
|