Akonadi

relation.h
1 /*
2  SPDX-FileCopyrightText: 2014 Christian Mollekopf <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef AKONADI_RELATION_H
8 #define AKONADI_RELATION_H
9 
10 #include "akonadicore_export.h"
11 
12 namespace Akonadi
13 {
14 class Relation;
15 
16 AKONADICORE_EXPORT unsigned int qHash(const Akonadi::Relation &);
17 }
18 
19 #include <QSharedDataPointer>
20 #include <QByteArray>
21 #include <QDebug>
22 
23 namespace Akonadi
24 {
25 class Item;
26 
39 class AKONADICORE_EXPORT Relation
40 {
41 public:
42  typedef QVector<Relation> List;
43 
47  static const char *GENERIC;
48 
52  Relation();
53 
57  explicit Relation(const QByteArray &type, const Item &left, const Item &right);
58 
59  Relation(const Relation &);
60  Relation(Relation &&) noexcept;
61  ~Relation();
62 
63  Relation &operator=(const Relation &);
64  Relation &operator=(Relation &&) noexcept;
65 
66  bool operator==(const Relation &) const;
67  bool operator!=(const Relation &) const;
68 
72  void setLeft(const Item &item);
73 
77  Q_REQUIRED_RESULT Item left() const;
78 
82  void setRight(const Akonadi::Item &item);
83 
87  Q_REQUIRED_RESULT Item right() const;
88 
92  void setType(const QByteArray &type);
93 
97  Q_REQUIRED_RESULT QByteArray type() const;
98 
102  void setRemoteId(const QByteArray &type);
103 
107  Q_REQUIRED_RESULT QByteArray remoteId() const;
108 
109  Q_REQUIRED_RESULT bool isValid() const;
110 
111 private:
112  struct Private;
113  QSharedDataPointer<Private> d;
114 };
115 
116 }
117 
118 AKONADICORE_EXPORT QDebug &operator<<(QDebug &debug, const Akonadi::Relation &tag);
119 
120 Q_DECLARE_METATYPE(Akonadi::Relation)
121 Q_DECLARE_METATYPE(Akonadi::Relation::List)
122 Q_DECLARE_METATYPE(QSet<Akonadi::Relation>)
123 Q_DECLARE_TYPEINFO(Akonadi::Relation, Q_MOVABLE_TYPE);
124 #endif
An Akonadi Relation.
Definition: relation.h:39
KCALENDARCORE_EXPORT uint qHash(const KCalendarCore::Period &key)
Helper integration between Akonadi and Qt.
static const char * GENERIC
The GENERIC type represents a generic relation between two items.
Definition: relation.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 7 2020 23:14:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.