kexiblobtableedit.h
1/* This file is part of the KDE project
2 Copyright (C) 2002 Peter Simonsson <psn@linux.se>
3 Copyright (C) 2004, 2006 Jaroslaw Staniek <js@iidea.pl>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this program; see the file COPYING. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _KEXIBLOBTABLEEDIT_H_
22#define _KEXIBLOBTABLEEDIT_H_
23
24#include <tqcstring.h>
25#include <tqcache.h>
26
27#include <kurl.h>
28
29#include "kexitableedit.h"
30#include "kexicelleditorfactory.h"
31
32class KTempFile;
33class TDEProcess;
34class TQTextEdit;
35
36class KexiBlobTableEdit : public KexiTableEdit
37{
38 TQ_OBJECT
39
40 public:
41 KexiBlobTableEdit(KexiTableViewColumn &column, TQWidget *parent=0);
42 virtual ~KexiBlobTableEdit();
43
44 bool valueIsNull();
45 bool valueIsEmpty();
46
47 virtual TQVariant value();
48
49 virtual bool cursorAtStart();
50 virtual bool cursorAtEnd();
51
53 virtual void resize(int w, int h);
54
55 virtual void showFocus( const TQRect& r, bool readOnly );
56
57 virtual void hideFocus();
58
60 virtual TQSize totalSize() const;
61
62 virtual void paintFocusBorders( TQPainter *p, TQVariant &, int x, int y, int w, int h );
63
65 virtual bool handleKeyPress( TQKeyEvent* ke, bool editorActive );
66
70 virtual bool handleDoubleClick();
71
74 virtual void handleAction(const TQString& actionName);
75
79 virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue);
80
81 virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val,
82 TQString &txt, int &align, int &x, int &y_offset, int &w, int &h );
83
84 protected slots:
85 void slotUpdateActionsAvailabilityRequested(bool& valueIsNull, bool& valueIsReadOnly);
86
87 void handleInsertFromFileAction(const KURL& url);
88 void handleAboutToSaveAsAction(TQString& origFilename, TQString& fileExtension, bool& dataIsEmpty);
89 void handleSaveAsAction(const TQString& fileName);
90 void handleCutAction();
91 void handleCopyAction();
92 void handlePasteAction();
93 virtual void clear();
94 void handleShowPropertiesAction();
95
96 protected:
98 virtual void setValueInternal(const TQVariant& add, bool removeOld);
99
100 //todo TQString openWithDlg(const TQString& file);
101 //todo void execute(const TQString& app, const TQString& file);
102
104 void updateFocus( const TQRect& r );
105
106 void signalEditRequested();
107
109 void executeCopyAction(const TQByteArray& data);
110
111 virtual bool eventFilter( TQObject *o, TQEvent *e );
112
113 class Private;
114 Private *d;
115//todo KTempFile* m_tempFile;
116//todo TDEProcess* m_proc;
117//todo TQTextEdit *m_content;
118};
119
120KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiBlobEditorFactoryItem)
121
122
123//=======================
124//This class is temporarily here:
125
126
130{
131 public:
132 KexiTDEIconTableEdit(KexiTableViewColumn &column, TQWidget *parent=0);
133
134 virtual ~KexiTDEIconTableEdit();
135
137 virtual bool valueIsNull();
138
142 virtual bool valueIsEmpty();
143
144 virtual TQVariant value();
145
146 virtual bool cursorAtStart();
147 virtual bool cursorAtEnd();
148
149 virtual void clear();
150
151 virtual void setupContents( TQPainter *p, bool focused, const TQVariant& val,
152 TQString &txt, int &align, int &x, int &y_offset, int &w, int &h );
153
156 virtual void handleCopyAction(const TQVariant& value, const TQVariant& visibleValue);
157
158 protected:
160 virtual void setValueInternal(const TQVariant& add, bool removeOld);
161
162 void showHintButton();
163 void init();
164
165 class Private;
166 Private *d;
167};
168
169KEXI_DECLARE_CELLEDITOR_FACTORY_ITEM(KexiTDEIconTableEditorFactoryItem)
170
171#endif
virtual bool cursorAtEnd()=0
virtual bool cursorAtStart()=0
virtual TQVariant value()=0
virtual bool valueIsNull()=0
virtual void showFocus(const TQRect &r, bool readOnly)
virtual bool valueIsEmpty()=0
virtual void handleAction(const TQString &actionName)
virtual void setValueInternal(const TQVariant &add, bool removeOld)=0
virtual void clear()=0
clears item's data, so the data will contain NULL data
virtual TQVariant visibleValue()
Cell editor for displaying kde icon (using icon name provided as string). Read only.
Abstract class for a cell editor. Handles cell painting and displaying the editor widget.
virtual TQSize totalSize()
virtual bool handleKeyPress(TQKeyEvent *ke, bool editorActive)
KexiTableViewColumn * column() const
virtual void setupContents(TQPainter *p, bool focused, const TQVariant &val, TQString &txt, int &align, int &x, int &y_offset, int &w, int &h)
virtual void resize(int w, int h)
virtual void handleCopyAction(const TQVariant &value, const TQVariant &visibleValue)=0
virtual void paintFocusBorders(TQPainter *p, TQVariant &cal, int x, int y, int w, int h)
virtual bool handleDoubleClick()