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

KIO

fileundomanager.h

Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
00003    Copyright (C) 2006, 2008 David Faure <faure@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019 */
00020 #ifndef KIO_FILEUNDOMANAGER_H
00021 #define KIO_FILEUNDOMANAGER_H
00022 
00023 #include <QtCore/QObject>
00024 #include <kurl.h>
00025 
00026 #include <kio/kio_export.h>
00027 
00028 class KDateTime;
00029 
00030 namespace KIO
00031 {
00032 class Job;
00033 class CopyJob;
00034 class FileUndoManagerPrivate;
00035 class FileUndoManagerSingleton;
00036 class CommandRecorder;
00037 class UndoCommand;
00038 class UndoJob;
00039 
00044 class KIO_EXPORT FileUndoManager : public QObject
00045 {
00046     Q_OBJECT
00047 public:
00051     static FileUndoManager *self();
00052 
00063     class KIO_EXPORT UiInterface
00064     {
00065     public:
00066         UiInterface();
00067         virtual ~UiInterface();
00068 
00072         void setShowProgressInfo(bool b);
00076         bool showProgressInfo() const;
00077 
00081         void setParentWidget(QWidget* parentWidget);
00082 
00086         QWidget* parentWidget() const;
00087 
00091         virtual void jobError(KIO::Job* job);
00092 
00097         virtual bool confirmDeletion(const KUrl::List& files);
00098 
00104         virtual bool copiedFileWasModified(const KUrl& src, const KUrl& dest, const KDateTime& srcTime, const KDateTime& destTime);
00105 
00109         virtual void virtual_hook(int id, void* data);
00110 
00111     private:
00112         class UiInterfacePrivate;
00113         UiInterfacePrivate *d;
00114     };
00115 
00121     void setUiInterface(UiInterface* ui);
00122 
00127     UiInterface* uiInterface() const;
00128 
00129     enum CommandType { Copy, Move, Rename, Link, Mkdir, Trash };
00130 
00138     void recordJob(CommandType op, const KUrl::List &src, const KUrl &dst, KIO::Job *job);
00139 
00143     void recordCopyJob(KIO::CopyJob* copyJob);
00144 
00148     bool undoAvailable() const;
00152     QString undoText() const;
00153 
00160     quint64 newCommandSerialNumber();
00161     quint64 currentCommandSerialNumber() const;
00162 
00163 public Q_SLOTS:
00169     void undo();
00170 
00171 Q_SIGNALS:
00173     void undoAvailable(bool avail);
00174 
00176     void undoTextChanged(const QString &text);
00177 
00179     void undoJobFinished();
00180 
00181 private:
00182     FileUndoManager();
00183     virtual ~FileUndoManager();
00184     friend class FileUndoManagerSingleton;
00185 
00186     friend class UndoJob;
00187     friend class CommandRecorder;
00188 
00189     friend class FileUndoManagerPrivate;
00190     FileUndoManagerPrivate *d;
00191 };
00192 
00193 } // namespace
00194 
00195 #endif

KIO

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal