ITransactionHandler.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #include "DgnPlatform.h"
11 
12 struct DropElemFromActive;
13 
15 
16 struct HandlerTxnMonitor;
17 
18 /*=================================================================================**/
38 {
39 
40 protected:
41 
56 virtual void _OnUndoRedo (ElementHandleP afterUndoRedo, ElementHandleP beforeUndoRedo, ChangeTrackAction action, bool isUndo, ChangeTrackSource source) {}
57 
90 virtual void _OnHistoryRestore (ElementHandleP after, ElementHandleP before, ChangeTrackAction actionStep, BentleyDgnHistoryElementChangeType effectiveChange) {}
91 
98 virtual void _OnUndoRedoFinished (ElementRefP element, bool isUndo) {}
99 
102 virtual void _OnDeleted (ElementHandleP element) {}
103 
108 virtual void _OnAdded (ElementHandleP element) {}
109 
114 virtual void _OnAddedComplete (ElementHandleP element) {}
115 
128 virtual void _OnModified (ElementHandleP newElement, ElementHandleP oldElement, ChangeTrackAction action, bool* cantBeUndoneFlag) {}
129 
144 virtual void _OnUndoRedoXAttributeChange (XAttributeHandleCR xAttr, ChangeTrackAction action, bool isUndo, ChangeTrackSource source) {}
145 
154 virtual void _OnXAttributeChanged (XAttributeHandleCR xAttr, ChangeTrackAction action, bool* cantBeUndoneFlag) {}
155 
157  {
158  PRE_ACTION_Ok = 0,
159  PRE_ACTION_Block = 1,
160  };
161 
162 virtual PreActionStatus _OnAdd (EditElementHandleR) {return PRE_ACTION_Ok;};
164 virtual PreActionStatus _OnDelete (ElementHandleCR) {return PRE_ACTION_Ok;};
165 virtual PreActionStatus _OnRemoveHandler (ElementHandleCR) {return PRE_ACTION_Ok;}
166 
167 public:
168  DGNPLATFORM_EXPORT static void CallOnAdded (ElementHandleR);
169  DGNPLATFORM_EXPORT static void CallOnAddedComplete (ElementHandleR);
170 };
171 
173 
174 
A readonly "handle" to an element.
Definition: ElementHandle.h:113
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
virtual void _OnAdded(ElementHandleP element)
Called after an element is added to a model.
Definition: ITransactionHandler.h:108
struct DgnPlatform::XAttributeHandle const & XAttributeHandleCR
Definition: DgnPlatform.h:489
virtual void _OnUndoRedo(ElementHandleP afterUndoRedo, ElementHandleP beforeUndoRedo, ChangeTrackAction action, bool isUndo, ChangeTrackSource source)
Called when an element is changed by either the Undo or Redo command in MicroStation.
Definition: ITransactionHandler.h:56
ChangeTrackAction
ChangeTrackAction's are the type of direct changes that happen to DGN elements.
Definition: DgnPlatform.h:705
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
virtual PreActionStatus _OnRemoveHandler(ElementHandleCR)
Definition: ITransactionHandler.h:165
virtual void _OnUndoRedoXAttributeChange(XAttributeHandleCR xAttr, ChangeTrackAction action, bool isUndo, ChangeTrackSource source)
Called whenever an XAttribute is changed by either the Undo or Redo command in MicroStation.
Definition: ITransactionHandler.h:144
virtual PreActionStatus _OnReplace(EditElementHandleR, ElementHandleCR)
Definition: ITransactionHandler.h:163
virtual void _OnHistoryRestore(ElementHandleP after, ElementHandleP before, ChangeTrackAction actionStep, BentleyDgnHistoryElementChangeType effectiveChange)
Called when an element is changed by design history to restore a historical version.
Definition: ITransactionHandler.h:90
virtual void _OnAddedComplete(ElementHandleP element)
Called after an element is added to a model.
Definition: ITransactionHandler.h:114
virtual void _OnUndoRedoFinished(ElementRefP element, bool isUndo)
Called after undo/redo has restored all elements involved in the transaction and after all undo/redo ...
Definition: ITransactionHandler.h:98
virtual void _OnDeleted(ElementHandleP element)
Called after an element is deleted from a model.
Definition: ITransactionHandler.h:102
virtual void _OnModified(ElementHandleP newElement, ElementHandleP oldElement, ChangeTrackAction action, bool *cantBeUndoneFlag)
Called after an element is directly changed in MicroStation and the DgnModel holds the new state of t...
Definition: ITransactionHandler.h:128
virtual PreActionStatus _OnDelete(ElementHandleCR)
Definition: ITransactionHandler.h:164
PreActionStatus
Definition: ITransactionHandler.h:156
Interface that provides direct and efficient access to element data.
Definition: ElementRefBase.h:120
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
virtual void _OnXAttributeChanged(XAttributeHandleCR xAttr, ChangeTrackAction action, bool *cantBeUndoneFlag)
Called when an XAttribute has been added, removed, or modified on the element.
Definition: ITransactionHandler.h:154
Interface adopted by an Element Handler that wants to participate in MicroStation transactions...
Definition: ITransactionHandler.h:37
ChangeTrackSource
Identifies the transaction manager or the design history manager as the source of the version restore...
Definition: DgnPlatform.h:730
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
ElementChangeType
The kinds of changes recorded in design history.
Definition: DgnPlatform.h:659
virtual PreActionStatus _OnAdd(EditElementHandleR)
Definition: ITransactionHandler.h:162

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.