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

KIO

KIO::FileUndoManager

KIO::FileUndoManager Class Reference

#include <fileundomanager.h>

Inheritance diagram for KIO::FileUndoManager:

Inheritance graph
[legend]

List of all members.


Detailed Description

FileUndoManager: makes it possible to undo kio jobs.

This class is a singleton, use self() to access its only instance.

Definition at line 44 of file fileundomanager.h.


Public Types

enum  CommandType {
  Copy, Move, Rename, Link,
  Mkdir, Trash
}

Public Slots

void undo ()

Signals

void undoAvailable (bool avail)
void undoJobFinished ()
void undoTextChanged (const QString &text)

Public Member Functions

quint64 currentCommandSerialNumber () const
quint64 newCommandSerialNumber ()
void recordCopyJob (KIO::CopyJob *copyJob)
void recordJob (CommandType op, const KUrl::List &src, const KUrl &dst, KIO::Job *job)
void setUiInterface (UiInterface *ui)
UiInterface * uiInterface () const
bool undoAvailable () const
QString undoText () const

Static Public Member Functions

static FileUndoManager * self ()

Classes

class  UiInterface
 Interface for the gui handling of FileUndoManager. More...

Member Enumeration Documentation

enum KIO::FileUndoManager::CommandType

Enumerator:
Copy 
Move 
Rename 
Link 
Mkdir 
Trash 

Definition at line 129 of file fileundomanager.h.


Member Function Documentation

quint64 FileUndoManager::currentCommandSerialNumber (  )  const

Definition at line 303 of file fileundomanager.cpp.

quint64 FileUndoManager::newCommandSerialNumber (  ) 

These two functions are useful when wrapping FileUndoManager and adding custom commands.

Each command has a unique ID. You can get a new serial number for a custom command with newCommandSerialNumber(), and then when you want to undo, check if the command FileUndoManager would undo is newer or older than your custom command.

Definition at line 298 of file fileundomanager.cpp.

void FileUndoManager::recordCopyJob ( KIO::CopyJob *  copyJob  ) 

Record this CopyJob while it's happening and add a command for it so that the user can undo it.

Definition at line 246 of file fileundomanager.cpp.

void FileUndoManager::recordJob ( CommandType  op,
const KUrl::List &  src,
const KUrl &  dst,
KIO::Job *  job 
)

Record this job while it's happening and add a command for it so that the user can undo it.

Parameters:
op the type of job - which is also the type of command that will be created for it
src list of source urls
dst destination url
job the job to record

Definition at line 240 of file fileundomanager.cpp.

FileUndoManager * FileUndoManager::self (  )  [static]

Returns:
the FileUndoManager instance

Definition at line 206 of file fileundomanager.cpp.

void FileUndoManager::setUiInterface ( UiInterface *  ui  ) 

Set a new UiInterface implementation.

This deletes the previous one.

Parameters:
ui the UiInterface instance, which becomes owned by the undo manager.

Definition at line 712 of file fileundomanager.cpp.

FileUndoManager::UiInterface * FileUndoManager::uiInterface (  )  const

Returns:
the UiInterface instance passed to setUiInterface.

This is useful for calling setParentWidget on it. Never delete it!

Definition at line 718 of file fileundomanager.cpp.

void FileUndoManager::undo (  )  [slot]

Undoes the last command Remember to call uiInterface()->setParentWidget(parentWidget) first, if you have multiple mainwindows.

Definition at line 314 of file fileundomanager.cpp.

void KIO::FileUndoManager::undoAvailable ( bool  avail  )  [signal]

Emitted when the value of undoAvailable() changes.

bool FileUndoManager::undoAvailable (  )  const

Returns:
true if undo is possible.

Usually used for enabling/disabling the undo action.

Definition at line 269 of file fileundomanager.cpp.

void KIO::FileUndoManager::undoJobFinished (  )  [signal]

Emitted when an undo job finishes. Used for unit testing.

QString FileUndoManager::undoText (  )  const

Returns:
the current text for the undo action.

Definition at line 274 of file fileundomanager.cpp.

void KIO::FileUndoManager::undoTextChanged ( const QString &  text  )  [signal]

Emitted when the value of undoText() changes.


The documentation for this class was generated from the following files:
  • fileundomanager.h
  • fileundomanager.cpp

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