kexi

kexiblobtableedit.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2002   Peter Simonsson <psn@linux.se>
00003    Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this program; see the file COPYING.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef _KEXIBLOBTABLEEDIT_H_
00022 #define _KEXIBLOBTABLEEDIT_H_
00023 
00024 #include <qcstring.h>
00025 #include <qcache.h>
00026 
00027 #include "kexitableedit.h"
00028 #include "kexicelleditorfactory.h"
00029 
00030 class KTempFile;
00031 class KProcess;
00032 class QTextEdit;
00033 
00034 class KexiBlobTableEdit : public KexiTableEdit
00035 {
00036     Q_OBJECT
00037     public:
00038 //      KexiBlobTableEdit(KexiDB::Field &f, QScrollView *parent=0);
00039         KexiBlobTableEdit(KexiTableViewColumn &column, QScrollView *parent=0);
00040         virtual ~KexiBlobTableEdit();
00041 
00042         bool valueIsNull();
00043         bool valueIsEmpty();
00044 
00045         virtual QVariant value();
00046 
00047         virtual void clear();
00048         virtual bool cursorAtStart();
00049         virtual bool cursorAtEnd();
00050     protected slots:
00051         void slotFinished(KProcess* p);
00052         void open();
00053         void openWith();
00054         void menu();
00055         void loadFile();
00056         void saveFile();
00057 
00058     protected:
00060         virtual void setValueInternal(const QVariant& add, bool removeOld);
00061 
00062         QString openWithDlg(const QString& file);
00063 
00064         void execute(const QString& app, const QString& file);
00065 
00066         KTempFile* m_tempFile;
00067         KProcess* m_proc;
00068         QTextEdit *m_content;
00069 };
00070 
00071 KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiBlobEditorFactoryItem)
00072 
00073 
00074 //=======================
00075 //This class is temporarily here:
00076 
00077 
00080 class KEXIDATATABLE_EXPORT KexiKIconTableEdit : public KexiTableEdit
00081 {
00082     public:
00083         KexiKIconTableEdit(KexiTableViewColumn &column, QScrollView *parent=0);
00084 
00085         virtual ~KexiKIconTableEdit();
00086 
00088         virtual bool valueIsNull();
00089 
00093         virtual bool valueIsEmpty();
00094 
00095         virtual QVariant value();
00096 
00097         virtual bool cursorAtStart();
00098         virtual bool cursorAtEnd();
00099 
00100         virtual void clear();
00101 
00102         virtual void setupContents( QPainter *p, bool focused, QVariant val, 
00103             QString &txt, int &align, int &x, int &y_offset, int &w, int &h );
00104 
00105     protected:
00107         virtual void setValueInternal(const QVariant& add, bool removeOld);
00108 
00109         void showHintButton();
00110         void init();
00111 
00113         QVariant m_currentValue;
00114 
00115         QCache<QPixmap> m_pixmapCache;
00116 };
00117 
00118 KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiKIconTableEditorFactoryItem)
00119 
00120 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys