Mailcommon

itemcontext.cpp
1/*
2 * SPDX-FileCopyrightText: 1996-1998 Stefan Taferner <taferner@kde.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 *
6 */
7
8#include "itemcontext.h"
9
10using namespace MailCommon;
11
12ItemContext::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
53void ItemContext::setDeleteItem()
54{
55 mItemContextAction |= DeleteItem;
56}
57
58bool ItemContext::deleteItem() const
59{
60 return mItemContextAction & DeleteItem;
61}
62
64{
65 return mItemContextAction & FullPayload;
66}
void setNeedsPayloadStore()
Marks that the item's payload has been changed and needs to be written back.
bool needsFullPayload() const
Returns true if the full payload was requested for the item or not.
void setMoveTargetCollection(const Akonadi::Collection &collection)
Sets the target collection the item should be moved to.
bool needsFlagStore() const
Returns whether the item's flags needs to be written back.
bool needsPayloadStore() const
Returns whether the item's payload needs to be written back.
Akonadi::Collection moveTargetCollection() const
Returns the target collection the item should be moved to, or an invalid collection if the item shoul...
Akonadi::Item & item()
Returns the item of the context.
void setNeedsFlagStore()
Marks that the item's flags has been changed and needs to be written back.
ItemContext(const Akonadi::Item &item, bool needsFullPayload)
Creates an item context for the given item.
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:01 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.