/usr/include/KDb3/KDbQueryColumnInfo.h is in libkdb3-dev 3.1.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | /* This file is part of the KDE project
Copyright (C) 2003-2016 Jarosław Staniek <staniek@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KDB_QUERYCOLUMNINFO_H
#define KDB_QUERYCOLUMNINFO_H
#include "kdb_export.h"
#include <QList>
#include <QVector>
#include <QString>
class KDbField;
//! @short Helper class that assigns additional information for the column in a query
/*! The following information is assigned:
- alias
- visibility
KDbQueryColumnInfo::Vector is created and returned by KDbQuerySchema::fieldsExpanded().
It is efficiently cached within the KDbQuerySchema object.
*/
class KDB_EXPORT KDbQueryColumnInfo
{
public:
typedef QVector<KDbQueryColumnInfo*> Vector;
typedef QList<KDbQueryColumnInfo*> List;
typedef QList<KDbQueryColumnInfo*>::ConstIterator ListIterator;
KDbQueryColumnInfo(KDbField *f, const QString &alias, bool visible,
KDbQueryColumnInfo *foreignColumn = nullptr);
~KDbQueryColumnInfo();
//! @return field for this column
KDbField *field();
//! @overload KDbField *field()
const KDbField *field() const;
//! Sets the field
void setField(KDbField *field);
//! @return alias for this column
QString alias() const;
//! Sets the alias
void setAlias(const QString &alias);
//! @return alias if it is not empty, field's name otherwise.
QString aliasOrName() const;
//! @return field's caption if it is not empty, field's alias otherwise.
//! If alias is also empty - returns field's name.
QString captionOrAliasOrName() const;
//! @return true is this column is visible
bool isVisible() const;
//! Sets the visible flag
void setVisible(bool set);
/*! @return index of column with visible lookup value within the 'fields expanded' vector.
-1 means no visible lookup value is available because there is no lookup for the column defined.
Cached for efficiency as we use this information frequently.
@see KDbLookupFieldSchema::visibleVolumn() */
int indexForVisibleLookupValue() const;
/*! Sets index of column with visible lookup value within the 'fields expanded' vector. */
void setIndexForVisibleLookupValue(int index);
//! @return non-nullptr if this column is a visible column for other column
KDbQueryColumnInfo *foreignColumn();
//! @overload KDbQueryColumnInfo *foreignColumn();
const KDbQueryColumnInfo *foreignColumn() const;
private:
class Private;
Private * const d;
Q_DISABLE_COPY(KDbQueryColumnInfo)
};
//! Sends information about column info @a info to debug output @a dbg.
KDB_EXPORT QDebug operator<<(QDebug dbg, const KDbQueryColumnInfo& info);
#endif
|