Mailcommon

itemcontext.cpp
1 /*
2  * SPDX-FileCopyrightText: 1996-1998 Stefan Taferner <[email protected]>
3  *
4  * SPDX-License-Identifier: GPL-2.0-or-later
5  *
6  */
7 
8 #include "itemcontext.h"
9 
10 using namespace MailCommon;
11 
12 ItemContext::ItemContext(const Akonadi::Item &item, bool needsFullPayload)
13  : mItem(item)
14  , mItemContextAction(needsFullPayload ? FullPayload : None)
15 {
16 }
17 
19 {
20  return mItem;
21 }
22 
24 {
25  mMoveTargetCollection = collection;
26 }
27 
29 {
30  return mMoveTargetCollection;
31 }
32 
34 {
35  mItemContextAction |= PlayloadStore;
36 }
37 
39 {
40  return mItemContextAction & PlayloadStore;
41 }
42 
44 {
45  mItemContextAction |= FlagStore;
46 }
47 
49 {
50  return mItemContextAction & FlagStore;
51 }
52 
53 void ItemContext::setDeleteItem()
54 {
55  mItemContextAction |= DeleteItem;
56 }
57 
58 bool ItemContext::deleteItem() const
59 {
60  return mItemContextAction & DeleteItem;
61 }
62 
64 {
65  return mItemContextAction & FullPayload;
66 }
Akonadi::Collection moveTargetCollection() const
Returns the target collection the item should be moved to, or an invalid collection if the item shoul...
Definition: itemcontext.cpp:28
bool needsFlagStore() const
Returns whether the item's flags needs to be written back.
Definition: itemcontext.cpp:48
void setNeedsFlagStore()
Marks that the item's flags has been changed and needs to be written back.
Definition: itemcontext.cpp:43
void setNeedsPayloadStore()
Marks that the item's payload has been changed and needs to be written back.
Definition: itemcontext.cpp:33
bool needsPayloadStore() const
Returns whether the item's payload needs to be written back.
Definition: itemcontext.cpp:38
ItemContext(const Akonadi::Item &item, bool needsFullPayload)
Creates an item context for the given item.
Definition: itemcontext.cpp:12
bool needsFullPayload() const
Returns true if the full payload was requested for the item or not.
Definition: itemcontext.cpp:63
Akonadi::Item & item()
Returns the item of the context.
Definition: itemcontext.cpp:18
The filter dialog.
void setMoveTargetCollection(const Akonadi::Collection &collection)
Sets the target collection the item should be moved to.
Definition: itemcontext.cpp:23
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Nov 30 2023 04:02:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.