1#ifndef _FS_UNDO_REDO_H 2#define _FS_UNDO_REDO_H 3 4 5#include "ObjectList.h" 6#include <Entry.h> 7 8 9namespace BPrivate { 10 11class UndoItem; 12 13class Undo { 14 public: 15 ~Undo(); 16 void UpdateEntry(BEntry* entry, const char* destName); 17 void Remove(); 18 19 protected: 20 UndoItem* fUndo; 21}; 22 23 24class MoveCopyUndo : public Undo { 25 public: 26 MoveCopyUndo(BObjectList<entry_ref>* sourceList, BDirectory &dest, 27 BList* pointList, uint32 moveMode); 28}; 29 30 31class NewFolderUndo : public Undo { 32 public: 33 NewFolderUndo(const entry_ref &ref); 34}; 35 36 37class RenameUndo : public Undo { 38 public: 39 RenameUndo(BEntry &entry, const char* newName); 40}; 41 42 43class RenameVolumeUndo : public Undo { 44 public: 45 RenameVolumeUndo(BVolume &volume, const char* newName); 46}; 47 48 49static 50inline bool FSIsUndoMoveMode(uint32 moveMode) 51{ 52 return (moveMode & '\xff\0\0\0') == 'U\0\0\0'; 53} 54 55 56static 57inline uint32 FSUndoMoveMode(uint32 moveMode) 58{ 59 return (moveMode & ~'\xff\0\0\0') | 'U\0\0\0'; 60} 61 62 63static 64inline uint32 FSMoveMode(uint32 moveMode) 65{ 66 return (moveMode & ~'\xff\0\0\0') | 'T\0\0\0'; 67} 68 69 70extern void FSUndo(); 71extern void FSRedo(); 72 73} // namespace BPrivate 74 75#endif // _FS_UNDO_REDO_H 76