sqlbrowser.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-  (for Emacs)
00002  *
00003  *  sqlbrowser.h
00004  *  Digest
00005  * 
00006  *  Created by Aidan Lane on Thu Jun 30 2005.
00007  *  Copyright (c) 2005-2006 Optimisation and Constraint Solving Group,
00008  *  Monash University. All rights reserved.
00009  *
00010  *  Based on the Qt Toolkit 4.01 SqlBrowser demonstration application.
00011  *  Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
00012  *
00013  *  This program is free software; you can redistribute it and/or modify
00014  *  it under the terms of the GNU General Public License as published by
00015  *  the Free Software Foundation; either version 2 of the License, or
00016  *  (at your option) any later version.
00017  *
00018  *  This program is distributed in the hope that it will be useful,
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *  GNU General Public License for more details.
00022  *
00023  *  You should have received a copy of the GNU General Public License
00024  *  along with this program; if not, write to the Free Software
00025  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00026  */
00027 
00028 #ifndef SQLBROWSER_H
00029 #define SQLBROWSER_H
00030 
00031 
00032 #include "DigestGuiCore/guicomponentwidgets.h"
00033 
00034 #include <QRegExp>
00035 #include <QSqlQuery>
00036 
00037 #include "ui_sqlbrowserform.h"
00038 
00039 
00040 class QSqlQueryModel;
00041 class QSqlTableModel;
00042 
00043 
00044 class SqlBrowser: public GuiDbComponentDialog {
00045 
00046   Q_OBJECT
00047 
00048 public:
00049   SqlBrowser( AbstractController* controller,
00050               QWidget* parent = 0, Qt::WindowFlags flags = 0 );
00051 
00052 protected:
00053   void showEvent( QShowEvent* );
00054 
00055   void resetEvent( VEvent* );
00056   void classesEvent( VClassesEvent* );
00057   void collectionsEvent( VCollectionsEvent* );
00058   void experimentsEvent( VExperimentsEvent* );
00059   void gesturesEvent( VGesturesEvent* );
00060   void trainedRecogsEvent( VTrainedRecogsEvent* );
00061 
00062 
00063 private slots:
00064   void refreshQuery();
00065   void importData();
00066   void exportData();
00067   void execUserQuery();
00068   void showTable( const QString& table );
00069   void setQueryStatus( const QString& message );
00070   void refreshTableList();
00071   void updateNumRecordsLabel();
00072 
00073   void on_tableListWidget_itemSelectionChanged();
00074   void on_submitButton_clicked();
00075   void on_clearButton_clicked();
00076 
00077 
00078 private:
00079   static QString formatSqlValue( QString value );
00080 
00081   // Temporary state:
00082   Ui::SqlBrowserForm  m_ui;
00083   QSqlTableModel*     m_editModel;
00084   QSqlQueryModel*     m_queryModel;
00085   QString             m_queryString;
00086 
00087   // Temporary caches:
00088   QRegExp c_regexp;
00089 };
00090 
00091 
00092 #endif  // ! SQLBROWSER_H

Generated on Mon Jul 30 09:46:50 2007 for Digest by  doxygen 1.5.2