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 #pragma once
9 
10 #include <QSharedPointer>
11 
12 #include "entities.h"
13 #include "exception.h"
14 
15 namespace Akonadi
16 {
17 namespace Protocol
18 {
19 class PartMetaData;
20 class Command;
21 using CommandPtr = QSharedPointer<Command>;
22 }
23 
24 namespace Server
25 {
26 AKONADI_EXCEPTION_MAKE_INSTANCE(PartStreamerException);
27 
28 class PimItem;
29 class Part;
30 class Connection;
31 
32 class PartStreamer
33 {
34 public:
35  explicit PartStreamer(Connection *connection, const PimItem &pimItem);
36  ~PartStreamer();
37 
38  /**
39  * @throws PartStreamException
40  */
41  void stream(bool checkExists, const QByteArray &partName, qint64 &partSize, bool *changed = nullptr);
42 
43  /**
44  * @throws PartStreamerException
45  */
46  void streamAttribute(bool checkExists, const QByteArray &partName, const QByteArray &value, bool *changed = nullptr);
47 
48 private:
49  void streamPayload(Part &part, const QByteArray &partName);
50  void streamPayloadToFile(Part &part, const Protocol::PartMetaData &metaPart);
51  void streamPayloadData(Part &part, const Protocol::PartMetaData &metaPart);
52  void streamForeignPayload(Part &part, const Protocol::PartMetaData &metaPart);
53 
54  Protocol::PartMetaData requestPartMetaData(const QByteArray &partName);
55  void preparePart(bool checkExists, const QByteArray &partName, Part &part);
56 
57  Connection *mConnection;
58  PimItem mItem;
59  bool mCheckChanged;
60  bool mDataChanged;
61 };
62 
63 } // namespace Server
64 } // namespace Akonadi
65 
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jun 30 2022 03:51:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.