Messagelib

messageitemsetmanager.h
1 /******************************************************************************
2  *
3  * SPDX-FileCopyrightText: 2008 Szymon Tomasz Stefanek <[email protected]>
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  */
34 {
35 public:
38 
39 private:
41 
42 public:
43  void clearAllSets();
44  Q_REQUIRED_RESULT int setCount() const;
45  void removeSet(MessageItemSetReference ref);
46  void removeMessageItemFromAllSets(MessageItem *mi);
47  Q_REQUIRED_RESULT QList<MessageItem *> messageItems(MessageItemSetReference ref);
48  Q_REQUIRED_RESULT MessageItemSetReference createSet();
49  Q_REQUIRED_RESULT bool addMessageItem(MessageItemSetReference ref, MessageItem *mi);
50 };
51 } // namespace Core
52 } // namespace MessageList
53 
This class manages sets of messageitem references.
The MessageItem class.
Definition: messageitem.h:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Dec 2 2021 23:06:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.