2 This file is part of KMail
4 Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
5 Copyright (c) 2003 Zack Rusin <zack@kde.org>
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 This software is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this library; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
27 #include <akonadi/collection.h>
28 #include <akonadi/item.h>
33 /** A class for storing Undo information. */
38 Akonadi::Item::List items
;
39 Akonadi::Collection srcFolder
;
40 Akonadi::Collection destFolder
;
43 class UndoStack
: public QObject
52 int size() const { return mStack
.count(); }
53 int newUndoAction( const Akonadi::Collection
& srcFolder
, const Akonadi::Collection
& destFolder
);
54 void addMsgToAction( int undoId
, const Akonadi::Item
&item
);
57 void pushSingleAction(const Akonadi::Item
&item
, const Akonadi::Collection
&, const Akonadi::Collection
& destFolder
);
58 void folderDestroyed( const Akonadi::Collection
&folder
);
61 void msgDestroyed( const Akonadi::Item
&msg
);
64 void slotMoveResult(KJob
*);
67 QList
<UndoInfo
*> mStack
;
70 UndoInfo
*mCachedInfo
;
73 void undoStackChanged();