home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / include / private / qsqlmanager_p.h < prev    next >
C/C++ Source or Header  |  2001-07-26  |  4KB  |  156 lines

  1. /****************************************************************************
  2. **
  3. ** Definition of QSqlManager class
  4. **
  5. ** Created : 2000-11-03
  6. **
  7. ** Copyright (C) 2000 Trolltech AS.  All rights reserved.
  8. **
  9. ** This file is part of the sql module of the Qt GUI Toolkit.
  10. **
  11. ** This file may be distributed under the terms of the Q Public License
  12. ** as defined by Trolltech AS of Norway and appearing in the file
  13. ** LICENSE.QPL included in the packaging of this file.
  14. **
  15. ** This file may be distributed and/or modified under the terms of the
  16. ** GNU General Public License version 2 as published by the Free Software
  17. ** Foundation and appearing in the file LICENSE.GPL included in the
  18. ** packaging of this file.
  19. **
  20. ** Licensees holding valid Qt Enterprise Edition licenses may use this
  21. ** file in accordance with the Qt Commercial License Agreement provided
  22. ** with the Software.
  23. **
  24. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  25. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  26. **
  27. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  28. **   information about Qt Commercial License Agreements.
  29. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  30. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  31. **
  32. ** Contact info@trolltech.com if any conditions of this licensing are
  33. ** not clear to you.
  34. **
  35. **********************************************************************/
  36.  
  37. #ifndef QSQLMANAGER_P_H
  38. #define QSQLMANAGER_P_H
  39.  
  40. //
  41. //  W A R N I N G
  42. //  -------------
  43. //
  44. // This file is not part of the Qt API.  It exists for the convenience
  45. // of other Qt classes.  This header file may change from version to
  46. // version without notice, or even be removed.
  47. //
  48. // We mean it.
  49. //
  50. //
  51.  
  52. #ifndef QT_H
  53. #include "qglobal.h"
  54. #include "qstring.h"
  55. #include "qstringlist.h"
  56. #include "qsql.h"
  57. #include "qsqlerror.h"
  58. #include "qsqlindex.h"
  59. #include "qsqlcursor.h"
  60. #endif // QT_H
  61.  
  62. #if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL )
  63. #define QM_EXPORT_SQL
  64. #else
  65. #define QM_EXPORT_SQL Q_EXPORT
  66. #endif
  67.  
  68. #ifndef QT_NO_SQL
  69.  
  70. class QSqlCursor;
  71. class QSqlForm;
  72. class QSqlCursorManagerPrivate;
  73.  
  74. class QM_EXPORT_SQL QSqlCursorManager
  75. {
  76. public:
  77.     QSqlCursorManager();
  78.     virtual ~QSqlCursorManager();
  79.  
  80.     virtual void setSort( const QSqlIndex& sort );
  81.     virtual void setSort( const QStringList& sort );
  82.     QStringList  sort() const;
  83.     virtual void setFilter( const QString& filter );
  84.     QString filter() const;
  85.     virtual void setCursor( QSqlCursor* cursor, bool autoDelete = FALSE );
  86.     QSqlCursor* cursor() const;
  87.  
  88.     virtual void setAutoDelete( bool enable );
  89.     bool autoDelete() const;
  90.  
  91.     virtual bool refresh();
  92.     virtual bool findBuffer( const QSqlIndex& idx, int atHint = 0 );
  93.  
  94. private:
  95.     QSqlCursorManagerPrivate* d;
  96. };
  97.  
  98. class QSqlFormManagerPrivate;
  99.  
  100. class QM_EXPORT_SQL QSqlFormManager
  101. {
  102. public:
  103.     QSqlFormManager();
  104.     virtual ~QSqlFormManager();
  105.  
  106.     virtual void setForm( QSqlForm* form );
  107.     QSqlForm* form();
  108.     virtual void setRecord( QSqlRecord* record );
  109.     QSqlRecord* record();
  110.  
  111.     virtual void clearValues();
  112.     virtual void readFields();
  113.     virtual void writeFields();
  114.  
  115. private:
  116.     QSqlFormManagerPrivate* d;
  117. };
  118.  
  119. class QWidget;
  120. class QDataManagerPrivate;
  121.  
  122. class QM_EXPORT_SQL QDataManager
  123. {
  124. public:
  125.     QDataManager();
  126.     virtual ~QDataManager();
  127.  
  128.     virtual void setMode( QSql::Op m );
  129.     QSql::Op mode() const;
  130.     virtual void setAutoEdit( bool autoEdit );
  131.     bool autoEdit() const;
  132.  
  133.     virtual void handleError( QWidget* parent, const QSqlError& error );
  134.     virtual QSql::Confirm confirmEdit( QWidget* parent, QSql::Op m );
  135.     virtual QSql::Confirm confirmCancel( QWidget* parent, QSql::Op m );
  136.  
  137.     virtual void setConfirmEdits( bool confirm );
  138.     virtual void setConfirmInsert( bool confirm );
  139.     virtual void setConfirmUpdate( bool confirm );
  140.     virtual void setConfirmDelete( bool confirm );
  141.     virtual void setConfirmCancels( bool confirm );
  142.  
  143.     bool confirmEdits() const;
  144.     bool confirmInsert() const;
  145.     bool confirmUpdate() const;
  146.     bool confirmDelete() const;
  147.     bool confirmCancels() const;
  148.  
  149. private:
  150.     QDataManagerPrivate* d;
  151. };
  152.  
  153.  
  154. #endif
  155. #endif
  156.