• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kio
fileundomanager.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
3 Copyright (C) 2006, 2008 David Faure <faure@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20#ifndef KIO_FILEUNDOMANAGER_H
21#define KIO_FILEUNDOMANAGER_H
22
23#include <QtCore/QObject>
24#include <kurl.h>
25
26#include <kio/kio_export.h>
27
28class KDateTime;
29
30namespace KIO
31{
32class Job;
33class CopyJob;
34class FileUndoManagerPrivate;
35class FileUndoManagerSingleton;
36class CommandRecorder;
37class UndoCommand;
38class UndoJob;
39
44class KIO_EXPORT FileUndoManager : public QObject
45{
46 Q_OBJECT
47public:
51 static FileUndoManager *self();
52
63 class KIO_EXPORT UiInterface
64 {
65 public:
66 UiInterface();
67 virtual ~UiInterface();
68
72 void setShowProgressInfo(bool b);
76 bool showProgressInfo() const;
77
81 void setParentWidget(QWidget* parentWidget);
82
86 QWidget* parentWidget() const;
87
91 virtual void jobError(KIO::Job* job);
92
97 virtual bool confirmDeletion(const KUrl::List& files);
98
104 virtual bool copiedFileWasModified(const KUrl& src, const KUrl& dest, const KDateTime& srcTime, const KDateTime& destTime);
105
109 virtual void virtual_hook(int id, void* data);
110
111 private:
112 class UiInterfacePrivate;
113 UiInterfacePrivate *d;
114 };
115
121 void setUiInterface(UiInterface* ui);
122
127 UiInterface* uiInterface() const;
128
135 enum CommandType { Copy, Move, Rename, Link, Mkdir, Trash, Put };
136
145 void recordJob(CommandType op, const KUrl::List &src, const KUrl &dst, KIO::Job *job);
146
151 void recordCopyJob(KIO::CopyJob* copyJob);
152
156 bool undoAvailable() const;
160 QString undoText() const;
161
168 quint64 newCommandSerialNumber();
169 quint64 currentCommandSerialNumber() const;
170
171public Q_SLOTS:
177 void undo();
178
179Q_SIGNALS:
181 void undoAvailable(bool avail);
182
184 void undoTextChanged(const QString &text);
185
187 void undoJobFinished();
188
195 void jobRecordingStarted(CommandType op);
196
203 void jobRecordingFinished(CommandType op);
204
205private:
206 FileUndoManager();
207 virtual ~FileUndoManager();
208 friend class FileUndoManagerSingleton;
209
210 friend class UndoJob;
211 friend class CommandRecorder;
212
213 friend class FileUndoManagerPrivate;
214 FileUndoManagerPrivate *d;
215};
216
217} // namespace
218
219#endif
KDateTime
KIO::CommandRecorder
Definition: fileundomanager_p.h:81
KIO::CopyJob
CopyJob is used to move, copy or symlink files and directories.
Definition: copyjob.h:65
KIO::FileUndoManagerPrivate
Definition: fileundomanager_p.h:102
KIO::FileUndoManager::UiInterface
Interface for the gui handling of FileUndoManager.
Definition: fileundomanager.h:64
KIO::FileUndoManager
FileUndoManager: makes it possible to undo kio jobs.
Definition: fileundomanager.h:45
KIO::FileUndoManager::undoJobFinished
void undoJobFinished()
Emitted when an undo job finishes. Used for unit testing.
KIO::FileUndoManager::jobRecordingFinished
void jobRecordingFinished(CommandType op)
Emitted when a job that has been recorded by FileUndoManager::recordJob() or FileUndoManager::recordC...
KIO::FileUndoManager::undoAvailable
void undoAvailable(bool avail)
Emitted when the value of undoAvailable() changes.
KIO::FileUndoManager::jobRecordingStarted
void jobRecordingStarted(CommandType op)
Emitted when a job recording has been started by FileUndoManager::recordJob() or FileUndoManager::rec...
KIO::FileUndoManager::undoTextChanged
void undoTextChanged(const QString &text)
Emitted when the value of undoText() changes.
KIO::FileUndoManager::CommandType
CommandType
The type of job.
Definition: fileundomanager.h:135
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:94
KUrl::List
KUrl
QObject
QWidget
kio_export.h
kurl.h
KIO
A namespace for KIO globals.
Definition: kbookmarkmenu.h:55
undo
KAction * undo(const QObject *recvr, const char *slot, QObject *parent)
Copy
Copy
Link
Link
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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