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

KIO

  • sources
  • kde-4.14
  • kdelibs
  • 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 
28 class KDateTime;
29 
30 namespace KIO
31 {
32 class Job;
33 class CopyJob;
34 class FileUndoManagerPrivate;
35 class FileUndoManagerSingleton;
36 class CommandRecorder;
37 class UndoCommand;
38 class UndoJob;
39 
44 class KIO_EXPORT FileUndoManager : public QObject
45 {
46  Q_OBJECT
47 public:
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 
171 public Q_SLOTS:
177  void undo();
178 
179 Q_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 
205 private:
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
kio_export.h
KIO::FileUndoManager
FileUndoManager: makes it possible to undo kio jobs.
Definition: fileundomanager.h:44
QWidget
undo
KAction * undo(const QObject *recvr, const char *slot, QObject *parent)
kurl.h
KIO::FileUndoManagerPrivate
Definition: fileundomanager_p.h:101
Copy
KUrl
KIO::FileUndoManager::CommandType
CommandType
The type of job.
Definition: fileundomanager.h:135
QObject
QString
KDateTime
KUrl::List
quint64
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:94
KIO::CommandRecorder
Definition: fileundomanager_p.h:80
KIO::FileUndoManager::Trash
Definition: fileundomanager.h:135
Link
KIO::FileUndoManager::UiInterface
Interface for the gui handling of FileUndoManager.
Definition: fileundomanager.h:63
KIO::CopyJob
CopyJob is used to move, copy or symlink files and directories.
Definition: copyjob.h:65
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:52 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

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