1
/* This file is part of the KDE project
2
Copyright (C) 2003 Jarosław Staniek <staniek@kde.org>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
* Boston, MA 02110-1301, USA.
20
#ifndef KEXIDB_SCHEMADATA_H
21
#define KEXIDB_SCHEMADATA_H
29
/*! Container class that stores common kexi object schema's properties like
30
id, name, caption, help text.
31
By kexi object we mean in-db storable object like table schema or query schema.
34
class CALLIGRADB_EXPORT SchemaData
37
SchemaData(int obj_type = KexiDB::UnknownObjectType);
38
virtual ~SchemaData();
46
QString name() const {
49
void setName(const QString& n) {
52
QString caption() const {
55
void setCaption(const QString& c) {
58
QString captionOrName() const {
59
return m_caption.isEmpty() ? m_name : m_caption;
61
QString description() const {
64
void setDescription(const QString& desc) {
68
/*! \return debug string useful for debugging */
69
virtual QString schemaDataDebugString() const;
71
/*! \return true if this is schema of native database object,
72
like, for example like, native table. This flag
73
is set when object schema (currently -- database table)
74
is not retrieved using kexi__* schema storage system,
75
but just based on the information about native table.
77
By native object we mean the one that has no additional
78
data like caption, description, etc. properties (no kexidb extensions).
80
Native objects schemas are used mostly for representing
81
kexi system (kexi__*) tables in memory for later reference;
82
see Connection::tableNames().
84
By default (on allocation) SchemaData objects are not native.
86
virtual bool isNative() const {
90
/* Sets native flag */
91
virtual void setNative(bool set) {
96
//! Clears all properties except 'type'.
106
friend class Connection;