akonadi
#include <history.h>
Public Types | |
enum | ResultCode { ResultCodeSuccess = 0, ResultCodeError } |
Public Slots | |
bool | clear () |
void | redo (QWidget *parent=0) |
void | undo (QWidget *parent=0) |
Signals | |
void | changed () |
void | redone (Akonadi::History::ResultCode resultCode) |
void | undone (Akonadi::History::ResultCode resultCode) |
Public Member Functions | |
~History () | |
QString | lastErrorString () const |
QString | nextRedoDescription () const |
QString | nextUndoDescription () const |
void | recordCreation (const Akonadi::Item &item, const QString &description, const uint atomicOperationId=0) |
void | recordDeletion (const Akonadi::Item &item, const QString &description, const uint atomicOperationId=0) |
void | recordDeletions (const Akonadi::Item::List &items, const QString &description, const uint atomicOperationId=0) |
void | recordModification (const Akonadi::Item &oldItem, const Akonadi::Item &newItem, const QString &description, const uint atomicOperationId=0) |
bool | redoAvailable () const |
void | undoAll (QWidget *parent=0) |
bool | undoAvailable () const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
History class for implementing undo/redo of calendar operations.
Whenever you use IncidenceChanger to create, delete or modify incidences, this class is used to record those changes onto a stack, so they can be undone or redone.
If needed, groupware invitations will be sent to attendees and organizers when undoing or redoing changes.
This class can't be instantiated directly, use it through IncidenceChanger:
- Since
- 4.11
Member Enumeration Documentation
This enum describes the possible result codes (success/error values) for an undo or redo operation.
Enumerator | |
---|---|
ResultCodeSuccess |
Success. |
ResultCodeError |
An error occurred. Call lastErrorString() for the error message. This isn't very verbose because IncidenceChanger hasn't been refactored yet. |
Constructor & Destructor Documentation
History::~History | ( | ) |
Destroys the History instance.
Definition at line 37 of file history.cpp.
Member Function Documentation
|
signal |
The redo/undo stacks have changed.
|
slot |
Clears the undo and redo stacks.
Won't do anything if there's a undo/redo job currently running.
- Returns
- true if the stacks were cleared, false if there was a job running
Definition at line 148 of file history.cpp.
QString History::lastErrorString | ( | ) | const |
Returns the last error message.
Call this immediately after catching the undone()/redone() signal with an ResultCode != ResultCodeSuccess.
The message is translated.
Definition at line 163 of file history.cpp.
QString History::nextRedoDescription | ( | ) | const |
Returns the description of the next redo.
This is the description that was passed when calling recordCreation(), recordDeletion() or recordModification().
- See also
- nextUndoDescription()
Definition at line 117 of file history.cpp.
QString History::nextUndoDescription | ( | ) | const |
Returns the description of the next undo.
This is the description that was passed when calling recordCreation(), recordDeletion() or recordModification().
- See also
- nextRedoDescription()
Definition at line 109 of file history.cpp.
void History::recordCreation | ( | const Akonadi::Item & | item, |
const QString & | description, | ||
const uint | atomicOperationId = 0 |
||
) |
Pushes an incidence creation onto the undo stack.
The creation can be undone calling undo().
- Parameters
-
item the item that was created. Must be valid and have a Incidence::Ptr payload description text that can be used in the undo/redo menu item to describe the operation If empty, a default one will be provided. atomicOperationId if not 0, specifies which group of changes this change belongs to. When a change is undone/redone, all other changes which are in the same group are also undone/redone
Definition at line 47 of file history.cpp.
void History::recordDeletion | ( | const Akonadi::Item & | item, |
const QString & | description, | ||
const uint | atomicOperationId = 0 |
||
) |
Pushes an incidence deletion onto the undo stack.
The deletion can be undone calling undo().
- Parameters
-
item The item to delete. Must be valid, doesn't need to contain a payload. description text that can be used in the undo/redo menu item to describe the operation If empty, a default one will be provided. atomicOperationId if not 0, specifies which group of changes this change belongs to. When a change is undone/redone, all other changes which are in the same group are also undone/redone
Definition at line 82 of file history.cpp.
void History::recordDeletions | ( | const Akonadi::Item::List & | items, |
const QString & | description, | ||
const uint | atomicOperationId = 0 |
||
) |
Pushes a list of incidence deletions onto the undo stack.
The deletions can be undone calling undo() once.
- Parameters
-
items The list of items to delete. All items must be valid. description text that can be used in the undo/redo menu item to describe the operation If empty, a default one will be provided. atomicOperationId If != 0, specifies which group of changes thischange belongs to. Will be useful for atomic undoing/redoing, not implemented yet.
Definition at line 92 of file history.cpp.
void History::recordModification | ( | const Akonadi::Item & | oldItem, |
const Akonadi::Item & | newItem, | ||
const QString & | description, | ||
const uint | atomicOperationId = 0 |
||
) |
Pushes an incidence modification onto the undo stack.
The modification can be undone calling undo().
- Parameters
-
oldItem item containing the payload before the change. Must be valid and contain an Incidence::Ptr payload. newItem item containing the new payload. Must be valid and contain an Incidence::Ptr payload. description text that can be used in the undo/redo menu item to describe the operation If empty, a default one will be provided. atomicOperationId if not 0, specifies which group of changes this change belongs to. When a change is undone/redone, all other changes which are in the same group are also undone/redone
Definition at line 62 of file history.cpp.
|
slot |
Reverts the change that's on top of the redo stack.
Can't be called if there's an undo/redo operation running, asserts. Can be called if the stack is empty, in this case, nothing happens. This function is async, catch signal redone() to know when the operation finishes.
- Parameters
-
parent will be passed to dialogs created by IncidenceChanger, for example those asking if you want to send invitations.
Definition at line 130 of file history.cpp.
bool History::redoAvailable | ( | ) | const |
Returns true if there are changes that can be redone.
Definition at line 173 of file history.cpp.
|
signal |
This signal is emitted when an redo operation finishes.
- Parameters
-
resultCode History::ResultCodeSuccess on success.
- See also
- lastErrorString()
|
slot |
Reverts the change that's on top of the undo stack.
Can't be called if there's an undo/redo operation running, asserts. Can be called if the stack is empty, in this case, nothing happens. This function is async, catch signal undone() to know when the operation finishes.
- Parameters
-
parent will be passed to dialogs created by IncidenceChanger, for example those asking if you want to send invitations.
Definition at line 125 of file history.cpp.
void History::undoAll | ( | QWidget * | parent = 0 | ) |
Reverts every change in the undo stack.
- Parameters
-
parent will be passed to dialogs created by IncidenceChanger, for example those asking if you want to send invitations.
Definition at line 135 of file history.cpp.
bool History::undoAvailable | ( | ) | const |
Returns true if there are changes that can be undone.
Definition at line 168 of file history.cpp.
|
signal |
This signal is emitted when an undo operation finishes.
- Parameters
-
resultCode History::ResultCodeSuccess on success.
- See also
- lastErrorString()
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.