Eneboo - Documentación para desarrolladores
|
00001 /*************************************************************************** 00002 FLFormDB.h 00003 ------------------- 00004 begin : Sat Jul 28 2001 00005 copyright : (C) 2001-2005 by InfoSiAL S.L. 00006 email : mail@infosial.com 00007 ***************************************************************************/ 00008 /*************************************************************************** 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; version 2 of the License. * 00012 ***************************************************************************/ 00013 /*************************************************************************** 00014 Este programa es software libre. Puede redistribuirlo y/o modificarlo 00015 bajo los términos de la Licencia Pública General de GNU en su 00016 versión 2, publicada por la Free Software Foundation. 00017 ***************************************************************************/ 00018 00019 #ifndef FLFORMDB_H 00020 #define FLFORMDB_H 00021 00022 #include <qapplication.h> 00023 #include <qlayout.h> 00024 #include <qmessagebox.h> 00025 #include <qobjectlist.h> 00026 #include <qtoolbutton.h> 00027 #include <qpushbutton.h> 00028 #include <qtooltip.h> 00029 #include <qwhatsthis.h> 00030 #include <qimage.h> 00031 #include <qfocusdata.h> 00032 00033 class FLSqlCursor; 00034 class FLAction; 00035 class FLFormDBInterface; 00036 00056 class FLFormDB: public QWidget 00057 { 00058 Q_OBJECT 00059 00060 friend class FLFormDBInterface; 00061 00062 public: 00063 00067 explicit FLFormDB(QWidget *parent = 0, const char *name = 0, WFlags f = 0); 00068 00074 FLFormDB(const QString &actionName, QWidget *parent = 0, WFlags f = 0); 00075 00082 FLFormDB(FLSqlCursor *cursor, const QString &actionName = QString::null, 00083 QWidget *parent = 0, WFlags f = 0); 00084 00088 virtual ~FLFormDB(); 00089 00095 virtual void setCursor(FLSqlCursor *c); 00096 00103 FLSqlCursor *cursor() const { 00104 return cursor_; 00105 } 00106 00112 QWidget *mainWidget() const { 00113 return mainWidget_; 00114 } 00115 00119 void setIdMDI(const QString &id) { 00120 idMDI_ = id; 00121 } 00122 00126 QString idMDI() const { 00127 return idMDI_; 00128 } 00129 00142 virtual void setMainWidget(QWidget *w); 00143 00149 virtual void setMainWidget(); 00150 00158 virtual void setMainWidget(const QString &uiFileName); 00159 00163 QImage snapShot(); 00164 00170 void saveSnapShot(const QString &pathFile); 00171 00172 public slots: 00173 00177 bool close(); 00178 00182 virtual void initScript(); 00183 00188 void showForDocument(); 00189 00193 void setMaximized(); 00194 00195 private slots: 00196 00197 void callInitScript(); 00198 00199 protected: 00200 00204 void initForm(); 00205 00209 virtual void closeEvent(QCloseEvent *e); 00210 00214 virtual void showEvent(QShowEvent *e); 00215 00219 virtual void hideEvent(QHideEvent *h); 00220 00227 void initMainWidget(QWidget *w = 0); 00228 00232 FLSqlCursor *cursor_; 00233 00238 QString name_; 00239 00243 QVBoxLayout *layout; 00244 00248 QWidget *mainWidget_; 00249 00253 const FLAction *action_; 00254 00260 QString idMDI_; 00261 00265 QHBoxLayout *layoutButtons; 00266 00270 QPushButton *pushButtonCancel; 00271 00275 bool showed; 00276 00280 QObject *oldCursorCtxt; 00281 00285 bool isClosing_; 00286 00290 QWidget *initFocusWidget_; 00291 00292 protected slots: 00293 00297 void emitFormReady(); 00298 00299 private: 00300 00304 FLFormDBInterface *iface; 00305 00306 signals: 00307 00311 void closed(); 00312 00316 void formReady(); 00317 }; 00318 00319 #endif