1
/* This file is part of the KDE project
2
Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
3
Copyright (C) 2004-2007 Jarosław Staniek <staniek@kde.org>
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.
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.
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.
21
#ifndef KEXIQUERYDESIGNERSQLHISTORY_H
22
#define KEXIQUERYDESIGNERSQLHISTORY_H
24
#include <q3scrollview.h>
25
#include <qdatetime.h>
28
#include <QMouseEvent>
30
class Q3SimpleRichText;
32
class KexiQueryDesignerSQLHistory;
37
HistoryEntry(KexiQueryDesignerSQLHistory *parent, bool success, const QTime &time,
38
const QString &statement, /*int y,*/ const QString &error = QString());
41
QRect geometry(int y, int width, const QFontMetrics& f);
42
void drawItem(QPainter *p, int width);
44
void setSelected(bool selected);
45
bool isSelected() const {
50
QString statement() const {
53
void setTime(const QTime &execTime);
57
QString m_execTimeString;
60
Q3SimpleRichText *m_formated;
61
KexiQueryDesignerSQLHistory *m_parent;
68
typedef QList<HistoryEntry*> History;
70
class KexiQueryDesignerSQLHistory : public Q3ScrollView
75
KexiQueryDesignerSQLHistory(QWidget *parent);
76
virtual ~KexiQueryDesignerSQLHistory();
78
KMenu* popupMenu() const;
80
// void contextMenu(const QPoint &pos, HistoryEntry *e);
82
void setHistory(History *h);
84
QString selectedStatement() const;
87
void addEvent(const QString& q, bool s, const QString &error);
89
void slotToClipboard();
94
// HistoryItem itemAt(int y);
97
void addEntry(HistoryEntry *e);
98
virtual void drawContents(QPainter *p, int cx, int cy, int cw, int ch);
99
virtual void contentsMousePressEvent(QMouseEvent * e);
100
virtual void contentsMouseDoubleClickEvent(QMouseEvent * e);
101
virtual bool eventFilter(QObject *obj, QEvent *event);
104
void editRequested(const QString &text);
105
void currentItemDoubleClicked();
109
HistoryEntry *m_selected;
110
QPalette::ColorGroup m_prevColorGroup;