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

kmail

  • sources
  • kde-4.14
  • 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  UndoInfo()
38  : id (-1),
39  moveToTrash(false)
40  {
41  }
42 
43  int id;
44  Akonadi::Item::List items;
45  Akonadi::Collection srcFolder;
46  Akonadi::Collection destFolder;
47  bool moveToTrash;
48 };
49 
50 class UndoStack : public QObject
51 {
52  Q_OBJECT
53 
54 public:
55  explicit UndoStack(int size);
56  ~UndoStack();
57 
58  void clear();
59  bool isEmpty() const { return mStack.isEmpty(); }
60  int size() const { return mStack.count(); }
61  int newUndoAction( const Akonadi::Collection& srcFolder, const Akonadi::Collection & destFolder );
62  void addMsgToAction( int undoId, const Akonadi::Item &item );
63  void undo();
64 
65  void pushSingleAction(const Akonadi::Item &item, const Akonadi::Collection&, const Akonadi::Collection& destFolder);
66  void folderDestroyed( const Akonadi::Collection &folder);
67 
68  QString undoInfo() const;
69 
70 protected slots:
71  void slotMoveResult(KJob*);
72 
73 protected:
74  QList<UndoInfo*> mStack;
75  int mSize;
76  int mLastId;
77  UndoInfo *mCachedInfo;
78 
79 signals:
80  void undoStackChanged();
81 };
82 
83 }
84 
85 #endif
KMail::UndoStack::undo
void undo()
Definition: undostack.cpp:99
KMail::UndoStack::pushSingleAction
void pushSingleAction(const Akonadi::Item &item, const Akonadi::Collection &, const Akonadi::Collection &destFolder)
Definition: undostack.cpp:122
KMail::UndoStack::size
int size() const
Definition: undostack.h:60
KMail::UndoStack::slotMoveResult
void slotMoveResult(KJob *)
Definition: undostack.cpp:116
KMail::UndoStack::clear
void clear()
Definition: undostack.cpp:50
KMail::UndoInfo::id
int id
Definition: undostack.h:43
KMail::UndoInfo::moveToTrash
bool moveToTrash
Definition: undostack.h:47
KMail::UndoStack::mCachedInfo
UndoInfo * mCachedInfo
Definition: undostack.h:77
KMail::UndoStack::addMsgToAction
void addMsgToAction(int undoId, const Akonadi::Item &item)
Definition: undostack.cpp:82
KMail::UndoStack::mLastId
int mLastId
Definition: undostack.h:76
KMail::UndoInfo::destFolder
Akonadi::Collection destFolder
Definition: undostack.h:46
QObject
KMail::UndoInfo
A class for storing Undo information.
Definition: undostack.h:34
KMail::UndoStack::undoStackChanged
void undoStackChanged()
QString
KMail::UndoStack::isEmpty
bool isEmpty() const
Definition: undostack.h:59
QList
KMail::UndoInfo::srcFolder
Akonadi::Collection srcFolder
Definition: undostack.h:45
KMail::UndoStack::mStack
QList< UndoInfo * > mStack
Definition: undostack.h:74
KMail::UndoStack::UndoStack
UndoStack(int size)
Definition: undostack.cpp:37
KMail::UndoInfo::UndoInfo
UndoInfo()
Definition: undostack.h:37
KMail::UndoStack
Definition: undostack.h:50
KMail::UndoInfo::items
Akonadi::Item::List items
Definition: undostack.h:44
KMail::UndoStack::undoInfo
QString undoInfo() const
Definition: undostack.cpp:56
KMail::UndoStack::newUndoAction
int newUndoAction(const Akonadi::Collection &srcFolder, const Akonadi::Collection &destFolder)
Definition: undostack.cpp:66
KMail::UndoStack::~UndoStack
~UndoStack()
Definition: undostack.cpp:45
KJob
KMail::UndoStack::folderDestroyed
void folderDestroyed(const Akonadi::Collection &folder)
Definition: undostack.cpp:128
KMail::UndoStack::mSize
int mSize
Definition: undostack.h:75
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:33 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
  • pimprint

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