kexi

kexiquerypart.h
1/* This file is part of the KDE project
2 Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
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 KEXIQUERYPART_H
22#define KEXIQUERYPART_H
23
24#include <tqmap.h>
25
26#include <kexidialogbase.h>
27#include <kexipart.h>
28#include <kexipartitem.h>
29//#include <kexipartdatasource.h>
30
31#include <kexidb/queryschema.h>
32#include <kexidb/connection.h>
33
34class KexiMainWin;
35namespace KexiDB
36{
37 class QuerySchema;
38 class Connection;
39}
40
41class KexiProject;
42
44class KexiQueryPart : public KexiPart::Part
45{
46 TQ_OBJECT
47
48
49 public:
50 KexiQueryPart(TQObject *parent, const char *name, const TQStringList &);
51 virtual ~KexiQueryPart();
52
53 virtual bool remove(KexiMainWindow *win, KexiPart::Item &item);
54
56 class TempData : public KexiDialogTempData,
57 public KexiDB::Connection::TableSchemaChangeListenerInterface
58 {
59 public:
60 TempData(KexiDialogBase* parent, KexiDB::Connection *conn);
61 virtual ~TempData();
62 virtual tristate closeListener();
63 void clearQuery();
64 void unregisterForTablesSchemaChanges();
65 void registerTableSchemaChanges(KexiDB::QuerySchema *q);
66
74
76 KexiDB::QuerySchema *query() const { return m_query; }
77
81
84
90
91 protected:
92 KexiDB::QuerySchema *m_query;
93 };
94
95 virtual TQString i18nMessage(const TQCString& englishMessage,
96 KexiDialogBase* dlg) const;
97
100 virtual tristate rename(KexiMainWindow * win, KexiPart::Item & item, const TQString& newName);
101
102 protected:
104
105 virtual KexiViewBase* createView(TQWidget *parent, KexiDialogBase* dialog,
106 KexiPart::Item &item, int viewMode = Kexi::DataViewMode, TQMap<TQString,TQString>* staticObjectArgs = 0);
107
108// virtual void initPartActions( TDEActionCollection *col );
109// virtual void initInstanceActions( int mode, TDEActionCollection *col );
110
111 virtual void initPartActions();
112 virtual void initInstanceActions();
113
114 virtual KexiDB::SchemaData* loadSchemaData(KexiDialogBase *dlg,
115 const KexiDB::SchemaData& sdata, int viewMode);
116};
117
118#endif
119
Provides database connection, allowing queries and data modification.
Definition connection.h:62
KexiDB::QuerySchema provides information about database query.
Base class for child window of Kexi's main application window.
Privides temporary data shared between KexiDialogBase's views (KexiView's).
Information about a single object that can be instantiated using Kexi Part.
The main class for kexi frontend parts like tables, queries, forms and reports.
Definition kexipart.h:66
A project's main controller.
Definition kexiproject.h:68
KexiDB::QuerySchema * takeQuery()
KexiDB::QuerySchema * query() const
void setQuery(KexiDB::QuerySchema *query)
KexiDB::Connection * conn
Connection used for retrieving definition of the query.
virtual TQString i18nMessage(const TQCString &englishMessage, KexiDialogBase *dlg) const
virtual KexiViewBase * createView(TQWidget *parent, KexiDialogBase *dialog, KexiPart::Item &item, int viewMode=Kexi::DataViewMode, TQMap< TQString, TQString > *staticObjectArgs=0)
virtual bool remove(KexiMainWindow *win, KexiPart::Item &item)
virtual tristate rename(KexiMainWindow *win, KexiPart::Item &item, const TQString &newName)
virtual KexiDialogTempData * createTempData(KexiDialogBase *dialog)
Base class for single view embeddable of in KexiDialogBase.
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition tristate.h:100
High-level database connectivity library with database backend drivers.