File indexing completed on 2024-04-14 14:53:33

0001 /* This file is part of the KDE project
0002    Copyright (C) 2006-2010 Jarosław Staniek <staniek@kde.org>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef KDB_QUERYSCHEMAPARAMETER_H
0021 #define KDB_QUERYSCHEMAPARAMETER_H
0022 
0023 #include "KDbField.h"
0024 
0025 //! @short A single parameter of a query schema
0026 class KDB_EXPORT KDbQuerySchemaParameter //SDC: operator==
0027 {
0028 public:
0029     /*!
0030     @getter
0031     @return datatype of the parameter.
0032     @setter
0033     Sets a datatype of the parameter.
0034     */
0035     KDbField::Type type; //SDC: default=KDbField::InvalidType
0036 
0037     /*!
0038     @getter
0039     @return user-visible message that will be displayed when asking for value of the parameter.
0040     @setter
0041     Sets user-visible message that will be displayed when asking for value of the parameter.
0042     */
0043     QString message; //SDC:
0044 };
0045 
0046 //! @short An iterator for a list of values of query schema parameters
0047 //! Allows to iterate over parameters and returns QVariant value or well-formatted string.
0048 //! The iterator is initially set to the last item because of the parser requirements
0049 class KDB_EXPORT KDbQuerySchemaParameterValueListIterator
0050 {
0051 public:
0052     explicit KDbQuerySchemaParameterValueListIterator(const QList<QVariant>& params);
0053     ~KDbQuerySchemaParameterValueListIterator();
0054 
0055     //! @return previous value
0056     QVariant previousValue() const;
0057 
0058 private:
0059     Q_DISABLE_COPY(KDbQuerySchemaParameterValueListIterator)
0060     class Private;
0061     Private * const d;
0062 };
0063 
0064 //! Sends information about query schema parameter @a parameter to debug output @a dbg.
0065 KDB_EXPORT QDebug operator<<(QDebug dbg, const KDbQuerySchemaParameter& parameter);
0066 
0067 //! Sends information about query schema parameter list @a list to debug output @a dbg.
0068 KDB_EXPORT QDebug operator<<(QDebug dbg, const QList<KDbQuerySchemaParameter>& list);
0069 
0070 #endif