Akonadi

partstreamer.h
1 /*
2  * SPDX-FileCopyrightText: 2014 Daniel Vrátil <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  *
6  */
7 
8 #ifndef AKONADI_SERVER_PARTSTREAMER_H
9 #define AKONADI_SERVER_PARTSTREAMER_H
10 
11 #include <QSharedPointer>
12 
13 #include "entities.h"
14 #include "exception.h"
15 
16 namespace Akonadi
17 {
18 
19 namespace Protocol
20 {
21 class PartMetaData;
22 class Command;
23 using CommandPtr = QSharedPointer<Command>;
24 }
25 
26 namespace Server
27 {
28 
29 AKONADI_EXCEPTION_MAKE_INSTANCE(PartStreamerException);
30 
31 class PimItem;
32 class Part;
33 class Connection;
34 
35 class PartStreamer
36 {
37 public:
38  explicit PartStreamer(Connection *connection, const PimItem &pimItem);
39  ~PartStreamer();
40 
44  void stream(bool checkExists, const QByteArray &partName, qint64 &partSize, bool *changed = nullptr);
45 
49  void streamAttribute(bool checkExists, const QByteArray &partName, const QByteArray &value, bool *changed = nullptr);
50 
51 private:
52  void streamPayload(Part &part, const QByteArray &partName);
53  void streamPayloadToFile(Part &part, const Protocol::PartMetaData &metaPart);
54  void streamPayloadData(Part &part, const Protocol::PartMetaData &metaPart);
55  void streamForeignPayload(Part &part, const Protocol::PartMetaData &metaPart);
56 
57  Protocol::PartMetaData requestPartMetaData(const QByteArray &partName);
58  void preparePart(bool checkExists, const QByteArray &partName, Part &part);
59 
60  Connection *mConnection;
61  PimItem mItem;
62  bool mCheckChanged;
63  bool mDataChanged;
64 };
65 
66 } // namespace Server
67 } // namespace Akonadi
68 
69 #endif // AKONADI_SERVER_PARTSTREAMER_H
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 8 2020 23:15:03 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.