src/qt3support/sql/q3sqlmanager_p.h
changeset 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt3Support module of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef Q3SQLMANAGER_P_H
       
    43 #define Q3SQLMANAGER_P_H
       
    44 
       
    45 //
       
    46 //  W A R N I N G
       
    47 //  -------------
       
    48 //
       
    49 // This file is not part of the Qt API.  It exists for the convenience
       
    50 // of other Qt classes.  This header file may change from version to
       
    51 // version without notice, or even be removed.
       
    52 //
       
    53 // We mean it.
       
    54 //
       
    55 
       
    56 #include "QtCore/qvariant.h"
       
    57 #include "QtCore/qglobal.h"
       
    58 #include "QtCore/qstring.h"
       
    59 #include "QtCore/qstringlist.h"
       
    60 #include "QtSql/qsql.h"
       
    61 #include "QtSql/qsqlerror.h"
       
    62 #include "QtSql/qsqlindex.h"
       
    63 #include "Qt3Support/q3sqlcursor.h"
       
    64 
       
    65 QT_BEGIN_NAMESPACE
       
    66 
       
    67 #ifndef QT_NO_SQL
       
    68 
       
    69 class Q3SqlCursor;
       
    70 class Q3SqlForm;
       
    71 class Q3SqlCursorManagerPrivate;
       
    72 
       
    73 class Q_COMPAT_EXPORT Q3SqlCursorManager
       
    74 {
       
    75 public:
       
    76     Q3SqlCursorManager();
       
    77     virtual ~Q3SqlCursorManager();
       
    78 
       
    79     virtual void setSort(const QSqlIndex& sort);
       
    80     virtual void setSort(const QStringList& sort);
       
    81     QStringList  sort() const;
       
    82     virtual void setFilter(const QString& filter);
       
    83     QString filter() const;
       
    84     virtual void setCursor(Q3SqlCursor* cursor, bool autoDelete = false);
       
    85     Q3SqlCursor* cursor() const;
       
    86 
       
    87     virtual void setAutoDelete(bool enable);
       
    88     bool autoDelete() const;
       
    89 
       
    90     virtual bool refresh();
       
    91     virtual bool findBuffer(const QSqlIndex& idx, int atHint = 0);
       
    92 
       
    93 private:
       
    94     Q3SqlCursorManagerPrivate* d;
       
    95 };
       
    96 
       
    97 #ifndef QT_NO_SQL_FORM
       
    98 
       
    99 class Q3SqlFormManagerPrivate;
       
   100 
       
   101 class Q_COMPAT_EXPORT Q3SqlFormManager
       
   102 {
       
   103 public:
       
   104     Q3SqlFormManager();
       
   105     virtual ~Q3SqlFormManager();
       
   106 
       
   107     virtual void setForm(Q3SqlForm* form);
       
   108     Q3SqlForm* form();
       
   109     virtual void setRecord(QSqlRecord* record);
       
   110     QSqlRecord* record();
       
   111 
       
   112     virtual void clearValues();
       
   113     virtual void readFields();
       
   114     virtual void writeFields();
       
   115 
       
   116 private:
       
   117     Q3SqlFormManagerPrivate* d;
       
   118 };
       
   119 
       
   120 #endif
       
   121 
       
   122 class QWidget;
       
   123 class Q3DataManagerPrivate;
       
   124 
       
   125 class Q_COMPAT_EXPORT Q3DataManager
       
   126 {
       
   127 public:
       
   128     Q3DataManager();
       
   129     virtual ~Q3DataManager();
       
   130 
       
   131     virtual void setMode(QSql::Op m);
       
   132     QSql::Op mode() const;
       
   133     virtual void setAutoEdit(bool autoEdit);
       
   134     bool autoEdit() const;
       
   135 
       
   136     virtual void handleError(QWidget* parent, const QSqlError& error);
       
   137     virtual QSql::Confirm confirmEdit(QWidget* parent, QSql::Op m);
       
   138     virtual QSql::Confirm confirmCancel(QWidget* parent, QSql::Op m);
       
   139 
       
   140     virtual void setConfirmEdits(bool confirm);
       
   141     virtual void setConfirmInsert(bool confirm);
       
   142     virtual void setConfirmUpdate(bool confirm);
       
   143     virtual void setConfirmDelete(bool confirm);
       
   144     virtual void setConfirmCancels(bool confirm);
       
   145 
       
   146     bool confirmEdits() const;
       
   147     bool confirmInsert() const;
       
   148     bool confirmUpdate() const;
       
   149     bool confirmDelete() const;
       
   150     bool confirmCancels() const;
       
   151 
       
   152 private:
       
   153     Q3DataManagerPrivate* d;
       
   154 };
       
   155 
       
   156 #endif // QT_NO_SQL
       
   157 
       
   158 QT_END_NAMESPACE
       
   159 
       
   160 #endif // Q3SQLMANAGER_P_H