Akonadi

schematypes.h
1 /***************************************************************************
2  * SPDX-FileCopyrightText: 2006 Tobias Koenig <[email protected]> *
3  * SPDX-FileCopyrightText: 2013 Volker Krause <[email protected]> *
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 
15 namespace Akonadi
16 {
17 namespace Server
18 {
19 /**
20  * @short A helper class that describes a column of a table for the DbInitializer
21  */
22 class ColumnDescription
23 {
24 public:
25  ColumnDescription();
26 
27  enum ReferentialAction {
28  Cascade,
29  Restrict,
30  SetNull,
31  };
32 
33  QString name;
34  QString type;
35  int size;
36  bool allowNull;
37  bool isAutoIncrement;
38  bool isPrimaryKey;
39  bool isUnique;
40  bool isEnum;
41  QString refTable;
42  QString refColumn;
43  QString defaultValue;
44  ReferentialAction onUpdate;
45  ReferentialAction onDelete;
46  bool noUpdate;
47 
48  QMap<QString, int> enumValueMap;
49 };
50 
51 /**
52  * @short A helper class that describes indexes of a table for the DbInitializer
53  */
54 class IndexDescription
55 {
56 public:
58 
59  QString name;
60  QStringList columns;
61  bool isUnique;
62  QString sort;
63 };
64 
65 /**
66  * @short A helper class that describes the predefined data of a table for the DbInitializer
67  */
68 class DataDescription
69 {
70 public:
72 
73  /**
74  * Key contains the column name, value the data.
75  */
77 };
78 
79 /**
80  * @short A helper class that describes a table for the DbInitializer
81  */
82 class TableDescription
83 {
84 public:
86  int primaryKeyColumnCount() const;
87 
88  QString name;
92 };
93 
94 /**
95  * @short A helper class that describes the relation between two tables for the DbInitializer
96  */
98 {
99 public:
101 
102  QString firstTable;
103  QString firstColumn;
104  QString secondTable;
105  QString secondColumn;
106  QList<IndexDescription> indexes;
107 };
108 
109 /**
110  * @short TableDescription constructed based on RelationDescription
111  */
113 {
114 public:
115  explicit RelationTableDescription(const RelationDescription &relation);
116 };
117 
118 } // namespace Server
119 } // namespace Akonadi
120 
121 Q_DECLARE_TYPEINFO(Akonadi::Server::ColumnDescription, Q_RELOCATABLE_TYPE);
122 Q_DECLARE_TYPEINFO(Akonadi::Server::IndexDescription, Q_RELOCATABLE_TYPE);
123 Q_DECLARE_TYPEINFO(Akonadi::Server::DataDescription, Q_RELOCATABLE_TYPE);
124 Q_DECLARE_TYPEINFO(Akonadi::Server::TableDescription, Q_RELOCATABLE_TYPE);
125 Q_DECLARE_TYPEINFO(Akonadi::Server::RelationDescription, Q_RELOCATABLE_TYPE);
126 Q_DECLARE_TYPEINFO(Akonadi::Server::RelationTableDescription, Q_RELOCATABLE_TYPE);
A helper class that describes a column of a table for the DbInitializer.
Definition: schematypes.h:32
A helper class that describes the relation between two tables for the DbInitializer.
Definition: schematypes.h:107
QMap< QString, QString > data
Key contains the column name, value the data.
Definition: schematypes.h:86
A helper class that describes indexes of a table for the DbInitializer.
Definition: schematypes.h:64
Definition: item.h:29
TableDescription constructed based on RelationDescription.
Definition: schematypes.h:122
A helper class that describes a table for the DbInitializer.
Definition: schematypes.h:92
A helper class that describes the predefined data of a table for the DbInitializer.
Definition: schematypes.h:78
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Sep 30 2023 04:01:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.