Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

readonlyformbase.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   readonlyformbase.h                                                            *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   Read the file COPYING for details.                                    *
00011  *                                                                         *
00012  *   copyright: (C) 2003 by Jan Mueller                                    *
00013  *   email: janmueller7@hotmail.com                                        *
00014  *                                                                         *
00015  ***************************************************************************/
00016 
00017 #ifndef ReadOnlyFormBase_h
00018 #define ReadOnlyFormBase_h
00019 #include <qwidget.h>
00020 #include <qmainwindow.h>
00021 #include <qsqlform.h>
00022 #include "liturl.h"
00023 #include <qsqlcursor.h>
00024 #include <qsqldatabase.h>
00025 
00036 class QToolBar;
00037 class QPopupMenu;
00038 class QAction;
00039 class ReadOnlyFormBase: public QWidget {
00040     Q_OBJECT
00041    
00042 private:
00043         ReadOnlyFormBase(const ReadOnlyFormBase&);
00044         ReadOnlyFormBase& operator=(const ReadOnlyFormBase&);
00045         QPopupMenu *romenu;     
00046         bool valid;
00047         
00048 protected:
00049         LitUrl _url;
00050         QSqlForm form;
00051         QSqlCursor formcursor;
00052         QToolBar *rotoolbar;
00055         QAction *selBackgrAction;
00056         QAction *reloadRecAction;
00057         void initToolBar();
00058         virtual bool setData() { return true; };
00059         QPopupMenu *roMenu();
00060         
00061 public slots:
00062         virtual void selBackgr();       
00063         virtual void reloadRec();
00064 
00065 public:
00068         ReadOnlyFormBase(LitUrl u, QObject *receiver, QString slot, QWidget *parent=0, const char *name=0): QWidget(parent, name,Qt::WDestructiveClose), romenu(0L), valid(false), _url(u), rotoolbar(0L) {
00069           connect(this, SIGNAL(workingGui(bool)), receiver, slot);
00070           initToolBar();
00071         };
00072 
00073         ~ReadOnlyFormBase() { delete rotoolbar; };
00074         bool isValid() { return valid; }
00077         QMainWindow *mainWindow() {
00078           QMainWindow *m=dynamic_cast<QMainWindow*>(topLevelWidget());
00079           ASSERT(m);
00080           return m;
00081         }
00082 
00083         QString buildLinkWhereClause(QString target, QString source, QString no);
00084         
00087         LitUrl url() { return _url; };
00088 
00089         
00090 protected slots:
00091         virtual void setValid(bool t) { valid=t; }
00092         QString no(LitUrl o);
00093         QString tab(LitUrl o);
00094 
00095 signals:
00098         virtual void workingGui(bool);
00101         virtual void readonlyGui(bool);
00104         virtual void invalidGui(bool);
00105 
00106 };
00107 
00108 #endif

Generated on Sat Mar 27 19:20:43 2004 for Literature by doxygen 1.3.6-20040222