Akonadi

schematypes.h
1/***************************************************************************
2 * SPDX-FileCopyrightText: 2006 Tobias Koenig <tokoe@kde.org> *
3 * SPDX-FileCopyrightText: 2013 Volker Krause <vkrause@kde.org> *
4 * *
5 * SPDX-License-Identifier: LGPL-2.0-or-later *
6 ***************************************************************************/
7
8#pragma once
9
10#include <QList>
11#include <QMap>
12#include <QString>
13#include <QStringList>
14
15namespace Akonadi
16{
17namespace Server
18{
19/**
20 * @short A helper class that describes a column of a table for the DbInitializer
21 */
23{
24public:
25 enum ReferentialAction {
26 Cascade,
27 Restrict,
28 SetNull,
29 };
30
31 QString name;
32 QString type;
33 int size = -1;
34 bool allowNull = true;
35 bool isAutoIncrement = false;
36 bool isPrimaryKey = false;
37 bool isUnique = false;
38 bool isEnum = false;
39 QString refTable;
40 QString refColumn;
41 QString defaultValue;
42 ReferentialAction onUpdate = Cascade;
43 ReferentialAction onDelete = Cascade;
44 bool noUpdate = false;
45
46 QMap<QString, int> enumValueMap;
47};
48
49/**
50 * @short A helper class that describes indexes of a table for the DbInitializer
51 */
53{
54public:
55 QString name;
56 QStringList columns;
57 bool isUnique = false;
58 QString sort;
59};
60
61/**
62 * @short A helper class that describes the predefined data of a table for the DbInitializer
63 */
65{
66public:
67 /**
68 * Key contains the column name, value the data.
69 */
71};
72
73/**
74 * @short A helper class that describes a table for the DbInitializer
75 */
77{
78public:
79 int primaryKeyColumnCount() const;
80
81 QString name;
85};
86
87/**
88 * @short A helper class that describes the relation between two tables for the DbInitializer
89 */
91{
92public:
93 QString firstTable;
94 QString firstColumn;
95 QString secondTable;
96 QString secondColumn;
98};
99
100/**
101 * @short TableDescription constructed based on RelationDescription
102 */
104{
105public:
106 explicit RelationTableDescription(const RelationDescription &relation);
107};
108
109} // namespace Server
110} // namespace Akonadi
111
112Q_DECLARE_TYPEINFO(Akonadi::Server::ColumnDescription, Q_RELOCATABLE_TYPE);
113Q_DECLARE_TYPEINFO(Akonadi::Server::IndexDescription, Q_RELOCATABLE_TYPE);
114Q_DECLARE_TYPEINFO(Akonadi::Server::DataDescription, Q_RELOCATABLE_TYPE);
115Q_DECLARE_TYPEINFO(Akonadi::Server::TableDescription, Q_RELOCATABLE_TYPE);
116Q_DECLARE_TYPEINFO(Akonadi::Server::RelationDescription, Q_RELOCATABLE_TYPE);
117Q_DECLARE_TYPEINFO(Akonadi::Server::RelationTableDescription, Q_RELOCATABLE_TYPE);
A helper class that describes a column of a table for the DbInitializer.
Definition schematypes.h:23
A helper class that describes the predefined data of a table for the DbInitializer.
Definition schematypes.h:65
QMap< QString, QString > data
Key contains the column name, value the data.
Definition schematypes.h:70
A helper class that describes indexes of a table for the DbInitializer.
Definition schematypes.h:53
A helper class that describes the relation between two tables for the DbInitializer.
Definition schematypes.h:91
TableDescription constructed based on RelationDescription.
A helper class that describes a table for the DbInitializer.
Definition schematypes.h:77
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.