Open Reality Reference Guide
fbundomanager.h
Go to the documentation of this file.
1 #ifndef __FBUNDOMANAGER_H__
2 #define __FBUNDOMANAGER_H__
3 /**************************************************************************
4 Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5 All Rights Reserved.
6 
7 The coded instructions, statements, computer programs, and/or related
8 material (collectively the "Data") in these files contain unpublished
9 information proprietary to Autodesk, Inc. and/or its licensors, which is
10 protected by Canada and United States of America federal copyright law
11 and by international treaties.
12 
13 The Data may not be disclosed or distributed to third parties, in whole
14 or in part, without the prior written consent of Autodesk, Inc.
15 ("Autodesk").
16 
17 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20 ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21 OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22 PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23 WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24 FREE.
25 
26 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28 EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29 DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30 OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31 DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32 LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33 LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34 DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35 BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
43 #include <kaydaradef.h>
44 #ifndef FBSDK_DLL
45 
48 #define FBSDK_DLL K_DLLIMPORT
49 #endif
50 
51 #include <fbsdk/fbarray.h>
52 #include <fbsdk/fbplug.h>
53 #include <fbsdk/fbcomponent.h>
54 
55 #ifdef FBSDKUseNamespace
56 namespace FBSDKNamespace {
57 #endif
58 
59 
60 
62  // FBUndoManager
65  FB_FORWARD( FBUndo );
66 
68 
69 
81  {
83 
87  FBUndoManager( const FBUndoManager& );
88 
92  FBUndoManager& operator=( const FBUndoManager& );
93 
94  public:
95 
98  FBUndoManager(HIObject pObject=NULL);
99 
103  bool Clear();
104 
107  void Redo();
108 
112  void Undo( bool pNoRedo = false );
113 
120  bool TransactionBegin(const char *pTransactionName);
121 
126 
134  bool TransactionAdd(FBUndo* pUndo, FBArrayPlug* pDepdendPlugArray = NULL);
135 
142 
149 
157 
164 
169 
174 
175  static FBUndoManager& TheOne();
176  };
177 
181 
182  public:
185  virtual ~FBUndo();
186 
189  virtual void Undo();
190 
193  virtual void Redo();
194 
197  virtual const char* GetName();
198  };
199 
200 #ifdef FBSDKUseNamespace
201 }
202 #endif
203 #endif
204 
FBUndoManager::OnRedoCompleted
FBPropertyEvent OnRedoCompleted
Event: A redo operation has been executed.
Definition: fbundomanager.h:173
FBUndoManager::Undo
void Undo(bool pNoRedo=false)
Undo last action.
FBUndo::Undo
virtual void Undo()
Callback function for undo custom action.
FBUndo::~FBUndo
virtual ~FBUndo()
Destructor.
FBUndoManager::Clear
bool Clear()
Clear the undo and redo stacks.
FBUndo::GetName
virtual const char * GetName()
Get Custom action name.
FBUndoManager
Access to global undo and redo functionality.
Definition: fbundomanager.h:81
FBUndoManager::TransactionAddProperty
bool TransactionAddProperty(FBProperty *pProperty)
Add Transaction if transaction stack is open.
FBUndoManager::Redo
void Redo()
Redo last undone action.
FBUndoManager::TransactionAdd
bool TransactionAdd(FBUndo *pUndo, FBArrayPlug *pDepdendPlugArray=NULL)
Add Transaction if transaction stack is open.
FBUndoManager::TransactionAddModelTRS
bool TransactionAddModelTRS(FBModel *pModel)
Add Transaction if transaction stack is open.
FBSDK_DLL
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbundomanager.h:48
FBUndoManager::OnRedo
FBPropertyEvent OnRedo
Event: A redo operation will be executed.
Definition: fbundomanager.h:172
FBUndoManager::OnUndoCompleted
FBPropertyEvent OnUndoCompleted
Event: An undo operation has been executed.
Definition: fbundomanager.h:171
FBUndoManager::OnUndo
FBPropertyEvent OnUndo
Event: An undo operation will be executed.
Definition: fbundomanager.h:170
FBUndoManager::TransactionBegin
bool TransactionBegin(const char *pTransactionName)
Open transaction stack for adding transactions.
FB_DEFINE_ARRAY
#define FB_DEFINE_ARRAY(DllTag, Type)
Define an array (template) for a component (discard the FB..).
Definition: fbarray.h:360
__FBClassDeclare
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
FBProperty
Property: Base property class.
Definition: fbproperties.h:195
__FB_FORWARD
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBUndo
Base Class for Custom Undoable Actions.
Definition: fbundomanager.h:180
fbarray.h
A template class for arrays.
FBUndoManager::FBUndoManager
FBUndoManager(HIObject pObject=NULL)
Constructor.
FBUndoManager::TransactionIsOpen
bool TransactionIsOpen()
Query if transaction stack is already open.
FBPropertyEvent
PropertyEvent: Base event class.
Definition: fbproperties.h:515
FBUndoManager::TransactionAddObjectDestroy
bool TransactionAddObjectDestroy(FBObject *pObject)
Add Transaction if transaction stack is open.
fbcomponent.h
Basic class definitions.
FBUndoManager::TransactionEnd
bool TransactionEnd()
Close transaction stack.
FBUndoManager::ActiveOperation
bool ActiveOperation()
Determine if an undo operation is in action.
fbplug.h
Definition of the class FBPlug and related enums and utility functions.
FB_FORWARD
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
FBModel
Model class.
Definition: fbmodel.h:274
FBComponent
MotionBuilder SDK base class.
Definition: fbcomponent.h:651
FBUndo::Redo
virtual void Redo()
Callback function for redo custom action.