Changeset View
Changeset View
Standalone View
Standalone View
src/KDbQueryColumnInfo.h
1 | /* This file is part of the KDE project | 1 | /* This file is part of the KDE project | ||
---|---|---|---|---|---|
2 | Copyright (C) 2003-2016 Jarosław Staniek <staniek@kde.org> | 2 | Copyright (C) 2003-2018 Jarosław Staniek <staniek@kde.org> | ||
3 | 3 | | |||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or | ||
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public | ||
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either | ||
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. | ||
8 | 8 | | |||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 10 Lines | |||||
21 | #define KDB_QUERYCOLUMNINFO_H | 21 | #define KDB_QUERYCOLUMNINFO_H | ||
22 | 22 | | |||
23 | #include "kdb_export.h" | 23 | #include "kdb_export.h" | ||
24 | 24 | | |||
25 | #include <QList> | 25 | #include <QList> | ||
26 | #include <QVector> | 26 | #include <QVector> | ||
27 | #include <QString> | 27 | #include <QString> | ||
28 | 28 | | |||
29 | class KDbConnection; | ||||
29 | class KDbField; | 30 | class KDbField; | ||
31 | class KDbQuerySchema; | ||||
30 | 32 | | |||
31 | //! @short Helper class that assigns additional information for the column in a query | 33 | //! @short Helper class that assigns additional information for the column in a query | ||
32 | /*! The following information is assigned: | 34 | /*! The following information is assigned: | ||
33 | - alias | 35 | - alias | ||
34 | - visibility | 36 | - visibility | ||
35 | KDbQueryColumnInfo::Vector is created and returned by KDbQuerySchema::fieldsExpanded(). | 37 | KDbQueryColumnInfo::Vector is created and returned by KDbQuerySchema::fieldsExpanded(). | ||
36 | It is efficiently cached within the KDbQuerySchema object. | 38 | It is efficiently cached within the KDbQuerySchema object. | ||
37 | */ | 39 | */ | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 42 | public: | |||
84 | void setIndexForVisibleLookupValue(int index); | 86 | void setIndexForVisibleLookupValue(int index); | ||
85 | 87 | | |||
86 | //! @return non-nullptr if this column is a visible column for other column | 88 | //! @return non-nullptr if this column is a visible column for other column | ||
87 | KDbQueryColumnInfo *foreignColumn(); | 89 | KDbQueryColumnInfo *foreignColumn(); | ||
88 | 90 | | |||
89 | //! @overload KDbQueryColumnInfo *foreignColumn(); | 91 | //! @overload KDbQueryColumnInfo *foreignColumn(); | ||
90 | const KDbQueryColumnInfo *foreignColumn() const; | 92 | const KDbQueryColumnInfo *foreignColumn() const; | ||
91 | 93 | | |||
94 | /** | ||||
95 | * Returns query schema for this column | ||||
96 | * | ||||
97 | * @since 3.2 | ||||
98 | */ | ||||
99 | const KDbQuerySchema* querySchema() const; | ||||
100 | | ||||
101 | /** | ||||
102 | * Returns connection for this column | ||||
103 | * | ||||
104 | * @since 3.2 | ||||
105 | */ | ||||
106 | KDbConnection* connection(); | ||||
107 | | ||||
108 | /** | ||||
109 | * @overload | ||||
110 | * | ||||
111 | * @since 3.2 | ||||
112 | */ | ||||
113 | const KDbConnection* connection() const; | ||||
114 | | ||||
92 | private: | 115 | private: | ||
116 | friend class KDbQuerySchema; | ||||
93 | class Private; | 117 | class Private; | ||
94 | Private * const d; | 118 | Private * const d; | ||
95 | Q_DISABLE_COPY(KDbQueryColumnInfo) | 119 | Q_DISABLE_COPY(KDbQueryColumnInfo) | ||
96 | }; | 120 | }; | ||
97 | 121 | | |||
98 | //! Sends information about column info @a info to debug output @a dbg. | 122 | //! Sends information about column info @a info to debug output @a dbg. | ||
99 | KDB_EXPORT QDebug operator<<(QDebug dbg, const KDbQueryColumnInfo& info); | 123 | KDB_EXPORT QDebug operator<<(QDebug dbg, const KDbQueryColumnInfo& info); | ||
100 | 124 | | |||
101 | #endif | 125 | #endif |