Test for 0022778: Bug in BRepMesh
[occt.git] / src / TDocStd / TDocStd_MultiTransactionManager.cdl
1 -- Created on: 2002-11-18
2 -- Created by: Vladimir ANIKIN
3 -- Copyright (c) 2002-2012 OPEN CASCADE SAS
4 --
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
9 --
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 --
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
19
20
21
22 class MultiTransactionManager from TDocStd inherits TShared from MMgt
23
24     ---Purpose: Class for synchronization of transactions within multiple documents.
25     --          Each transaction of this class involvess one transaction in each modified document.
26     --
27     --          The documents to be synchronized should be added explicitly to
28     --          the manager; then its interface is uesd to ensure that all transactions
29     --          (Open/Commit, Undo/Redo) are performed synchronously in all managed documents.
30     --
31     --          The current implementation does not support nested transactions
32     --          on multitransaction manager level. It only sets the flag enabling
33     --          or disabling nested transactions in all its documents, so that 
34     --          a nested transaction can be opened for each particular document 
35     --          with TDocStd_Document class interface.
36     --
37     --          NOTE: When you invoke CommitTransaction of multi transaction
38     --          manager, all nested transaction of its documents will be closed (commited).
39
40 uses SequenceOfApplicationDelta from TDocStd,
41      ExtendedString             from TCollection,
42      Document                   from TDocStd,
43      SequenceOfDocument         from TDocStd
44
45 is
46
47     Create returns MultiTransactionManager from TDocStd;
48     ---Purpose: Constructor
49
50     SetUndoLimit (me : mutable;
51                   theLimit : Integer from Standard);
52     ---Purpose: Sets undo limit for the manager and all documents.
53
54     GetUndoLimit (me)
55     returns Integer from Standard;
56     ---Purpose: Returns undo limit for the manager.
57     ---C++: inline
58     
59     
60     Undo (me : mutable);
61     ---Purpose: Undoes the current transaction of the manager.
62     --          It calls the Undo () method of the document being
63     --          on top of the manager list of undos (list.First())
64     --          and moves the list item to the top of the list of manager
65     --          redos (list.Prepend(item)).
66
67     Redo (me : mutable);
68     ---Purpose: Redoes the current transaction of the application. It calls
69     --          the Redo () method of the document being on top of the
70     --          manager list of redos (list.First()) and moves the list
71     --          item to the top of the list of manager undos (list.Prepend(item)).
72
73     GetAvailableUndos (me)
74     returns SequenceOfApplicationDelta from TDocStd;
75     ---Purpose: Returns available manager undos.
76     ---C++: inline
77     ---C++: return const &
78
79     GetAvailableRedos (me)
80     returns SequenceOfApplicationDelta from TDocStd;
81     ---Purpose: Returns available manager redos.
82     ---C++: inline
83     ---C++: return const &
84
85     OpenCommand (me : mutable);
86     ---Purpose: Opens transaction in each document and sets the flag that
87     --          transaction is opened. If there are already opened transactions in the documents,
88     --          these transactions will be aborted before openning new ones.
89
90     AbortCommand (me : mutable);
91     ---Purpose: Unsets the flag of started manager transaction and aborts
92     --          transaction in each document.
93
94     CommitCommand (me : mutable) returns Boolean;
95     ---Purpose: Commits transaction in all documents and fills the transaction manager
96     --          with the documents that have been changed during the transaction.
97     --          Returns True if new data has been added to myUndos.
98     --          NOTE: All nested transactions in the documents will be commited.
99     
100     CommitCommand (me : mutable;
101                    theName : ExtendedString from TCollection) returns Boolean;
102     ---Purpose: Makes the same steps as the previous function but defines the name for transaction.
103     --          Returns True if new data has been added to myUndos.
104
105     HasOpenCommand (me)
106     returns Boolean from Standard;
107     ---Purpose: Returns true if a transaction is opened.
108     ---C++: inline
109
110     RemoveLastUndo (me : mutable);
111     ---Purpose: Removes undo information from the list of undos of the manager and
112     --          all documents which have been modified during the transaction.
113
114     DumpTransaction(me; theOS : in out OStream from Standard);
115     ---Purpose: Dumps transactions in undos and redos
116
117     AddDocument(me : mutable; theDoc : Document from TDocStd);
118     ---Purpose: Adds the document to the transaction manager and
119     --          checks if it has been already added
120
121     RemoveDocument(me : mutable; theDoc : Document from TDocStd);
122     ---Purpose: Removes the document from the transaction manager.
123
124     Documents(me) returns SequenceOfDocument from TDocStd;
125     ---Purpose: Returns the added documents to the transaction manager.
126     ---C++: inline
127     ---C++: return const &
128
129     SetNestedTransactionMode(me : mutable; isAllowed : Boolean = Standard_True);
130     ---Purpose: Sets nested transaction mode if isAllowed == Standard_True
131     --          NOTE: field myIsNestedTransactionMode exists only for synchronization
132     --           between several documents and has no effect on transactions
133     --          of multitransaction manager.
134
135     IsNestedTransactionMode (me)
136     returns Boolean from Standard;
137     ---Purpose: Returns Standard_True if NestedTransaction mode is set.
138     ---C++: inline
139
140     ---Purpose: Methods for protection of changes outside transactions
141
142     SetModificationMode (me : mutable; theTransactionOnly : Boolean from Standard);
143     ---Purpose: If theTransactionOnly is True, denies all changes outside transactions.
144     
145     ModificationMode (me) returns Boolean from Standard;
146     ---Purpose: Returns True if changes are allowed only inside transactions.
147     ---C++: inline
148     
149     ClearUndos (me : mutable);
150     ---Purpose: Clears undos in the manager and in documents.
151     
152     ClearRedos (me : mutable);
153     ---Purpose: Clears redos in the manager and in documents.
154     
155 fields
156
157     ---Purpose: Data framework 
158
159     myDocuments       : SequenceOfDocument         from TDocStd;
160     myUndos           : SequenceOfApplicationDelta from TDocStd;
161     myRedos           : SequenceOfApplicationDelta from TDocStd;
162     myUndoLimit       : Integer                    from Standard;
163     myOpenTransaction : Boolean                    from Standard;
164     
165     ---Purpose: A flag for nested transaction mode.
166
167     myIsNestedTransactionMode : Boolean   from Standard;
168
169     ---Purpose: Data for protection of changes outside transactions.
170
171     myOnlyTransactionModification : Boolean from Standard;
172
173 end MultiTransactionManager;