• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kmail

  • sources
  • kde-4.12
  • kdepim
  • kmail
undostack.h
Go to the documentation of this file.
1 /*
2  This file is part of KMail
3 
4  Copyright (C) 1999 Waldo Bastian (bastian@kde.org)
5  Copyright (c) 2003 Zack Rusin <zack@kde.org>
6 
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.
10 
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.
15 
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.
20 */
21 
22 #ifndef UNDOSTACK_H
23 #define UNDOSTACK_H
24 
25 #include <QList>
26 #include <QObject>
27 #include <akonadi/collection.h>
28 #include <akonadi/item.h>
29 class KJob;
30 
31 namespace KMail {
32 
34 class UndoInfo
35 {
36 public:
37  int id;
38  Akonadi::Item::List items;
39  Akonadi::Collection srcFolder;
40  Akonadi::Collection destFolder;
41 };
42 
43 class UndoStack : public QObject
44 {
45  Q_OBJECT
46 
47 public:
48  explicit UndoStack(int size);
49  ~UndoStack();
50 
51  void clear();
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 );
55  void undo();
56 
57  void pushSingleAction(const Akonadi::Item &item, const Akonadi::Collection&, const Akonadi::Collection& destFolder);
58  void folderDestroyed( const Akonadi::Collection &folder);
59 
60 public slots:
61  void msgDestroyed( const Akonadi::Item &msg);
62 
63 protected slots:
64  void slotMoveResult(KJob*);
65 
66 protected:
67  QList<UndoInfo*> mStack;
68  int mSize;
69  int mLastId;
70  UndoInfo *mCachedInfo;
71 
72 signals:
73  void undoStackChanged();
74 };
75 
76 }
77 
78 #endif
KMail::UndoStack::~UndoStack
~UndoStack()
Definition: undostack.cpp:45
KMail::UndoStack::clear
void clear()
Definition: undostack.cpp:50
KMail::UndoStack::size
int size() const
Definition: undostack.h:52
KMail::UndoStack::slotMoveResult
void slotMoveResult(KJob *)
Definition: undostack.cpp:105
KMail::UndoInfo::id
int id
Definition: undostack.h:37
KMail::UndoStack::mCachedInfo
UndoInfo * mCachedInfo
Definition: undostack.h:70
KMail::UndoStack::newUndoAction
int newUndoAction(const Akonadi::Collection &srcFolder, const Akonadi::Collection &destFolder)
Definition: undostack.cpp:56
QObject
KMail::UndoStack::undo
void undo()
Definition: undostack.cpp:88
KMail::UndoStack::mLastId
int mLastId
Definition: undostack.h:69
KMail::UndoInfo::destFolder
Akonadi::Collection destFolder
Definition: undostack.h:40
KMail::UndoInfo
A class for storing Undo information.
Definition: undostack.h:34
KMail::UndoStack::UndoStack
UndoStack(int size)
Definition: undostack.cpp:37
KMail::UndoStack::undoStackChanged
void undoStackChanged()
KMail::UndoInfo::srcFolder
Akonadi::Collection srcFolder
Definition: undostack.h:39
KMail::UndoStack::mStack
QList< UndoInfo * > mStack
Definition: undostack.h:67
KMail::UndoStack
Definition: undostack.h:43
KMail::UndoStack::folderDestroyed
void folderDestroyed(const Akonadi::Collection &folder)
Definition: undostack.cpp:134
KMail::UndoInfo::items
Akonadi::Item::List items
Definition: undostack.h:38
KJob
KMail::UndoStack::pushSingleAction
void pushSingleAction(const Akonadi::Item &item, const Akonadi::Collection &, const Akonadi::Collection &destFolder)
Definition: undostack.cpp:111
QList
KMail::UndoStack::mSize
int mSize
Definition: undostack.h:68
KMail::UndoStack::addMsgToAction
void addMsgToAction(int undoId, const Akonadi::Item &item)
Definition: undostack.cpp:71
KMail::UndoStack::msgDestroyed
void msgDestroyed(const Akonadi::Item &msg)
Definition: undostack.cpp:117
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmail

Skip menu "kmail"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal