Messagelib

messageitemsetmanager.h
1/******************************************************************************
2 *
3 * SPDX-FileCopyrightText: 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 *
7 *******************************************************************************/
8
9#pragma once
10
11#include <QHash>
12#include <QList>
13
14namespace MessageList
15{
16namespace Core
17{
18class MessageItem;
19
20using MessageItemSetReference = long;
21
22/**
23 * This class manages sets of messageitem references.
24 * It can be used to create a set, add some messages to it
25 * and get a reference that later can be used to retrieve
26 * the stored messages.
27 *
28 * It's used by Model to keep track of jobs requested
29 * from outside that operate on sets of MessageItem instances.
30 * Model takes care of removing the deleted MessageItem objects
31 * from the sets in order to avoid invalid references.
32 */
34{
35public:
38
39private:
41
42public:
43 void clearAllSets();
44 [[nodiscard]] int setCount() const;
45 void removeSet(MessageItemSetReference ref);
46 void removeMessageItemFromAllSets(MessageItem *mi);
47 [[nodiscard]] QList<MessageItem *> messageItems(MessageItemSetReference ref);
48 [[nodiscard]] MessageItemSetReference createSet();
49 [[nodiscard]] bool addMessageItem(MessageItemSetReference ref, MessageItem *mi);
50};
51} // namespace Core
52} // namespace MessageList
This class manages sets of messageitem references.
The MessageItem class.
Definition messageitem.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:50:54 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.