Akonadi

partstreamer.h
1/*
2 * SPDX-FileCopyrightText: 2014 Daniel Vrátil <dvratil@redhat.com>
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
15namespace Akonadi
16{
17namespace Protocol
18{
19class PartMetaData;
20class Command;
21using CommandPtr = QSharedPointer<Command>;
22}
23
24namespace Server
25{
26AKONADI_EXCEPTION_MAKE_INSTANCE(PartStreamerException);
27
28class PimItem;
29class Part;
30class Connection;
31
32class PartStreamer
33{
34public:
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
48private:
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
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.