kexi

kexidatatable.cpp

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
00003    Copyright (C) 2003 Joseph Wenninger <jowenn@kde.org>
00004    Copyright (C) 2003-2006 Jaroslaw Staniek <js@iidea.pl>
00005 
00006    This program is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this program; see the file COPYING.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 */
00021 
00022 
00023 #include <qlayout.h>
00024 #include <qlabel.h>
00025 
00026 #include <kiconloader.h>
00027 #include <klocale.h>
00028 #include <kaction.h>
00029 #include <kpopupmenu.h>
00030 
00031 #include <kexidb/cursor.h>
00032 
00033 #include "kexidatatableview.h"
00034 #include "kexidatatable.h"
00035 #include "kexidialogbase.h"
00036 
00037 KexiDataTable::KexiDataTable(KexiMainWindow *mainWin, QWidget *parent, 
00038     const char *name, bool dbAware)
00039 // : KexiViewBase(mainWin, parent, name)
00040  : KexiDataAwareView( mainWin, parent, name )
00041 {
00042     KexiTableView *view;
00043     if (dbAware)
00044         view = new KexiDataTableView(this, 
00045             QString("%1_datatableview").arg(name ? name : "KexiDataTableView").latin1());
00046     else
00047         view = new KexiTableView(0, this, 
00048             QString("%1_tableview").arg(name ? name : "KexiTableView").latin1());
00049 
00050     KexiDataAwareView::init( view, view, view );
00051 }
00052 
00053 KexiDataTable::KexiDataTable(KexiMainWindow *mainWin, QWidget *parent, 
00054     KexiDB::Cursor *cursor, const char *name)
00055  : KexiDataAwareView( mainWin, parent, name )
00056 {
00057     KexiTableView *view = new KexiDataTableView(this, "view", cursor);
00058     KexiDataAwareView::init( view, view, view );
00059 }
00060 
00061 KexiDataTable::~KexiDataTable()
00062 {
00063 }
00064 
00065 void
00066 KexiDataTable::setData(KexiDB::Cursor *c)
00067 {
00068     if (!dynamic_cast<KexiDataTableView*>(mainWidget()))
00069         return;
00070     dynamic_cast<KexiDataTableView*>(mainWidget())->setData(c);
00071 }
00072 
00073 void KexiDataTable::filter()
00074 {
00075 }
00076 
00077 KexiTableView* KexiDataTable::tableView() const
00078 {
00079     return dynamic_cast<KexiTableView*>(m_internalView);
00080 }
00081 
00082 #include "kexidatatable.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys