KMbox

mboxentry.h
1/*
2 SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "kmbox_export.h"
10
11#include <QList>
12#include <QPair>
13#include <QSharedDataPointer>
14
15namespace KMBox
16{
17class MBoxEntryPrivate;
18/**
19 * @short A class that encapsulates an entry of a MBox.
20 *
21 * @author Tobias Koenig <tokoe@kde.org>
22 * @since 4.6
23 */
24class KMBOX_EXPORT MBoxEntry
25{
26public:
27 /**
28 * Describes a list of mbox entry objects.
29 */
31
32 /**
33 * Describes a pair of mbox entry objects.
34 */
35 using Pair = QPair<MBoxEntry, MBoxEntry>;
36
37 /**
38 * Creates an invalid mbox entry object.
39 */
40 MBoxEntry();
41
42 /**
43 * Creates an mbox entry object.
44 *
45 * @param offset The offset of the message the object references.
46 */
47 explicit MBoxEntry(quint64 offset);
48
49 /**
50 * Creates an mbox entry object from an @p other object.
51 */
52 MBoxEntry(const MBoxEntry &other);
53
54 /**
55 * Destroys the mbox entry object.
56 */
57 ~MBoxEntry();
58
59 /**
60 * Replaces this mbox entry object with an @p other object.
61 */
62 MBoxEntry &operator=(const MBoxEntry &other);
63
64 /**
65 * Returns whether this mbox entry object is equal to an @p other.
66 */
67 bool operator==(const MBoxEntry &other) const;
68
69 /**
70 * Returns whether this mbox entry object is not equal to an @p other.
71 */
72 bool operator!=(const MBoxEntry &other) const;
73
74 /**
75 * Returns whether this is a valid mbox entry object.
76 */
77 [[nodiscard]] bool isValid() const;
78
79 /**
80 * Returns the offset of the message that is referenced by this
81 * mbox entry object.
82 */
83 [[nodiscard]] quint64 messageOffset() const;
84
85 /**
86 * Returns the size of the message that is referenced by this
87 * mbox entry object.
88 */
89 [[nodiscard]] quint64 messageSize() const;
90
91 /**
92 * Returns the separator size of the message that is referenced by this
93 * mbox entry object.
94 */
95 [[nodiscard]] quint64 separatorSize() const;
96
97private:
98 //@cond PRIVATE
99 friend class MBox;
100
102 //@endcond
103};
104}
105
106Q_DECLARE_TYPEINFO(KMBox::MBoxEntry, Q_RELOCATABLE_TYPE);
A class that encapsulates an entry of a MBox.
Definition mboxentry.h:25
QPair< MBoxEntry, MBoxEntry > Pair
Describes a pair of mbox entry objects.
Definition mboxentry.h:35
A class to access mail storages in MBox format.
Definition mbox.h:26
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:04 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.