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 
14 namespace MessageList
15 {
16 namespace Core
17 {
18 class MessageItem;
19 
20 using 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  */
33 class MessageItemSetManager
34 {
35 public:
36  MessageItemSetManager();
37  ~MessageItemSetManager();
38 
39 private:
41 
42 public:
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
The MessageItem class.
Definition: messageitem.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 03:55:20 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.