Akonadi

changenotification.h
1 /*
2  Copyright (c) 2016 Daniel Vrátil <[email protected]>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
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 the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef AKONADI_CHANGENOTIFICATION_H
21 #define AKONADI_CHANGENOTIFICATION_H
22 
23 #include <QDateTime>
24 #include <QVector>
25 #include <QSharedDataPointer>
26 #include <QSharedPointer>
27 
28 #include <akonadicore_export.h>
29 
30 namespace Akonadi
31 {
32 namespace Protocol
33 {
34 class ChangeNotification;
35 using ChangeNotificationPtr = QSharedPointer<ChangeNotification>;
36 }
37 
46 class AKONADICORE_EXPORT ChangeNotification
47 {
48 public:
49  enum Type {
50  Items,
51  Collection,
52  Tag,
53  Relation,
54  Subscription
55  };
56 
57  explicit ChangeNotification();
58  ChangeNotification(const ChangeNotification &other);
59  ~ChangeNotification();
60 
61  ChangeNotification &operator=(const ChangeNotification &other);
62 
63  Q_REQUIRED_RESULT bool isValid() const;
64 
65  Q_REQUIRED_RESULT QDateTime timestamp() const;
66  void setTimestamp(const QDateTime &timestamp);
67 
68  Q_REQUIRED_RESULT QVector<QByteArray> listeners() const;
69  void setListeners(const QVector<QByteArray> &listeners);
70 
71  Q_REQUIRED_RESULT Type type() const;
72  void setType(Type type);
73 
74  Q_REQUIRED_RESULT Protocol::ChangeNotificationPtr notification() const;
75  void setNotification(const Protocol::ChangeNotificationPtr &ntf);
76 
77 private:
78  class Private;
80 };
81 
82 }
83 
84 #endif
Type type(const QString &mimeType)
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jun 6 2020 23:09:04 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.