1*651e8326SStephan Aßmus /* 2*651e8326SStephan Aßmus * Copyright 2006-2012, Stephan Aßmus <superstippi@gmx.de> 3*651e8326SStephan Aßmus * Distributed under the terms of the MIT License. 4*651e8326SStephan Aßmus */ 5*651e8326SStephan Aßmus 6*651e8326SStephan Aßmus #include "UndoableEdit.h" 7*651e8326SStephan Aßmus 8*651e8326SStephan Aßmus #include <stdio.h> 9*651e8326SStephan Aßmus 10*651e8326SStephan Aßmus #include <OS.h> 11*651e8326SStephan Aßmus #include <String.h> 12*651e8326SStephan Aßmus 13*651e8326SStephan Aßmus 14*651e8326SStephan Aßmus //static int32 sInstanceCount = 0; 15*651e8326SStephan Aßmus 16*651e8326SStephan Aßmus 17*651e8326SStephan Aßmus UndoableEdit::UndoableEdit() 18*651e8326SStephan Aßmus : 19*651e8326SStephan Aßmus fTimeStamp(system_time()) 20*651e8326SStephan Aßmus { 21*651e8326SStephan Aßmus // sInstanceCount++; 22*651e8326SStephan Aßmus // printf("UndoableEdits: %ld\n", sInstanceCount); 23*651e8326SStephan Aßmus } 24*651e8326SStephan Aßmus 25*651e8326SStephan Aßmus 26*651e8326SStephan Aßmus UndoableEdit::~UndoableEdit() 27*651e8326SStephan Aßmus { 28*651e8326SStephan Aßmus // sInstanceCount--; 29*651e8326SStephan Aßmus // printf("UndoableEdits: %ld\n", sInstanceCount); 30*651e8326SStephan Aßmus } 31*651e8326SStephan Aßmus 32*651e8326SStephan Aßmus 33*651e8326SStephan Aßmus status_t 34*651e8326SStephan Aßmus UndoableEdit::InitCheck() 35*651e8326SStephan Aßmus { 36*651e8326SStephan Aßmus return B_NO_INIT; 37*651e8326SStephan Aßmus } 38*651e8326SStephan Aßmus 39*651e8326SStephan Aßmus 40*651e8326SStephan Aßmus status_t 41*651e8326SStephan Aßmus UndoableEdit::Perform(EditContext& context) 42*651e8326SStephan Aßmus { 43*651e8326SStephan Aßmus return B_ERROR; 44*651e8326SStephan Aßmus } 45*651e8326SStephan Aßmus 46*651e8326SStephan Aßmus 47*651e8326SStephan Aßmus status_t 48*651e8326SStephan Aßmus UndoableEdit::Undo(EditContext& context) 49*651e8326SStephan Aßmus { 50*651e8326SStephan Aßmus return B_ERROR; 51*651e8326SStephan Aßmus } 52*651e8326SStephan Aßmus 53*651e8326SStephan Aßmus 54*651e8326SStephan Aßmus status_t 55*651e8326SStephan Aßmus UndoableEdit::Redo(EditContext& context) 56*651e8326SStephan Aßmus { 57*651e8326SStephan Aßmus return Perform(context); 58*651e8326SStephan Aßmus } 59*651e8326SStephan Aßmus 60*651e8326SStephan Aßmus 61*651e8326SStephan Aßmus void 62*651e8326SStephan Aßmus UndoableEdit::GetName(BString& name) 63*651e8326SStephan Aßmus { 64*651e8326SStephan Aßmus name << "Name of edit goes here."; 65*651e8326SStephan Aßmus } 66*651e8326SStephan Aßmus 67*651e8326SStephan Aßmus 68*651e8326SStephan Aßmus bool 69*651e8326SStephan Aßmus UndoableEdit::UndoesPrevious(const UndoableEdit* previous) 70*651e8326SStephan Aßmus { 71*651e8326SStephan Aßmus return false; 72*651e8326SStephan Aßmus } 73*651e8326SStephan Aßmus 74*651e8326SStephan Aßmus 75*651e8326SStephan Aßmus bool 76*651e8326SStephan Aßmus UndoableEdit::CombineWithNext(const UndoableEdit* next) 77*651e8326SStephan Aßmus { 78*651e8326SStephan Aßmus return false; 79*651e8326SStephan Aßmus } 80*651e8326SStephan Aßmus 81*651e8326SStephan Aßmus 82*651e8326SStephan Aßmus bool 83*651e8326SStephan Aßmus UndoableEdit::CombineWithPrevious(const UndoableEdit* previous) 84*651e8326SStephan Aßmus { 85*651e8326SStephan Aßmus return false; 86*651e8326SStephan Aßmus } 87