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 KEXIQUERYDESIGNERSQL_H
22
#define KEXIQUERYDESIGNERSQL_H
24
#include "kexiquerypart.h"
27
#include <KTitleWidget>
30
class KexiQueryDesignerSQLEditor;
32
//! The KexiQueryDesignerSQLView class for editing Queries in text mode.
33
/*! It is a view containing SQL text editor
34
and SQL history/status widget split vertically.
35
Depending on user's will, the widget can be in "sql history"
36
mode or in "sql status" mode. */
37
class KexiQueryDesignerSQLView : public KexiView
42
KexiQueryDesignerSQLView(QWidget *parent);
43
virtual ~KexiQueryDesignerSQLView();
45
QString sqlText() const;
46
KexiQueryDesignerSQLEditor *editor() const;
48
// virtual bool eventFilter ( QObject *o, QEvent *e );
51
KexiQueryPart::TempData * tempData() const;
53
virtual tristate beforeSwitchTo(Kexi::ViewMode mode, bool &dontStore);
54
virtual tristate afterSwitchFrom(Kexi::ViewMode mode);
55
virtual KexiDB::SchemaData* storeNewData(const KexiDB::SchemaData& sdata, bool &cancel);
56
virtual tristate storeData(bool dontAsk = false);
59
void setStatusError(const QString& msg);
60
void setStatusEmpty();
61
void setStatusText(const QString& text);
63
virtual void updateActions(bool activated);
66
/*! Performs query checking (by text parsing). \return true and sets d->parsedQuery
67
to the new query schema object on success. */
68
bool slotCheckQuery();
69
void slotUpdateMode();
70
void slotTextChanged();
71
// void slotHistoryHeaderButtonClicked(const QString& buttonIdentifier);
72
void slotSelectQuery();
81
friend class KexiQueryView; // for storeNewData() and storeData() only