00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Ramin Kamal 00008 * Side Effects Software Inc 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: OP_UndoBundle.h ( Operator Library, C++) 00015 * 00016 * COMMENTS: 00017 * This is the Undo class that is responsible for undoing all 00018 * changes to OP bundles. It even handles creation and deletion. 00019 */ 00020 00021 #ifndef __OP_UndoBundle__ 00022 #define __OP_UndoBundle__ 00023 00024 #include "OP_API.h" 00025 #include <UT/UT_Undo.h> 00026 #include <UT/UT_IntArray.h> 00027 00028 class OP_Bundle; 00029 class OP_BundleFilter; 00030 00031 enum OP_UndoBundleOperation 00032 { 00033 OP_UNDO_BUNDLE_CREATE, // Create a new bundle 00034 OP_UNDO_BUNDLE_DELETE, // Delete a bundle 00035 OP_UNDO_BUNDLE_MODIFY, // Add/Remove ops to a bundle 00036 OP_UNDO_BUNDLE_FILTER, // Change bundle filter 00037 OP_UNDO_BUNDLE_LOCK_FLAG, // Change flag 00038 OP_UNDO_BUNDLE_NAME // Name change 00039 }; 00040 00041 class OP_API OP_UndoBundle : public UT_Undo 00042 { 00043 public: 00044 OP_UndoBundle(OP_Bundle *, OP_UndoBundleOperation); 00045 OP_UndoBundle(OP_Bundle *, const char *oldname); 00046 virtual ~OP_UndoBundle(); 00047 00048 virtual void undo(); 00049 virtual void redo(); 00050 00051 private: 00052 void resetSize(); 00053 void swap(OP_Bundle *bundle); 00054 void swapFilter(OP_Bundle *bundle); 00055 void swapName(); 00056 00057 UT_String myBundleName; 00058 UT_String myPattern; 00059 const OP_BundleFilter *myFilter; 00060 int myLockFlag:1; 00061 int myPatternNode; 00062 UT_IntArray myNodeIds; 00063 OP_UndoBundleOperation myOperation; 00064 }; 00065 #endif 00066
1.5.9