0025367: IGES and BRep persistence - support unicode file names on Windows
[occt.git] / src / IFSelect / IFSelect_ListEditor.cdl
1 -- Created on: 1998-07-28
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1998-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class ListEditor  from IFSelect    inherits TShared  from MMgt
18
19     ---Purpose : A ListEditor is an auxiliary operator for Editor/EditForm
20     --           I.E. it works on parameter values expressed as strings
21     --         
22     --           For a parameter which is a list, it may not be edited in once
23     --           by just setting a new value (as a string)
24     --           
25     --           Firstly, a list can be long (and tedious to be accessed flat)
26     --           then requires a better way of accessing
27     --           
28     --           Moreover, not only its VALUES may be changed (SetValue), but
29     --           also its LENGTH : items may be added or removed ...
30     --           
31     --           Hence, the way of editing a parameter as a list is :
32     --           - edit it separately, with the help of a ListEditor
33     --           - it remains possible to prepare a new list of values apart
34     --           - then give the new list in once to the EditForm
35     --           
36     --           An EditList is produced by the Editor, with a basic definition
37     --           This definition (brought by this class) can be redefined
38     --           Hence the Editor may produce a specific ListEditor as needed
39
40 uses CString, HAsciiString from TCollection,
41      HSequenceOfHAsciiString from TColStd,
42      HSequenceOfInteger from TColStd,
43      TypedValue from Interface, InterfaceModel from Interface
44
45 is
46
47     Create returns ListEditor;
48     ---Purpose : Creates a ListEditor with absolutely no constraint
49
50     Create (def : TypedValue; max : Integer = 0) returns ListEditor;
51     ---Purpose : Creates a ListEditor, for which items of the list to edit are
52     --           defined by <def>, and <max> describes max length :
53     --           0 (D) means no limit
54     --           value > 0 means : no more the <max> items are allowed
55
56     LoadModel  (me : mutable; model : InterfaceModel);
57     ---Purpose : Loads a Model. It is used to check items of type Entity(Ident)
58
59     LoadValues (me : mutable; vals : HSequenceOfHAsciiString);
60     ---Purpose : Loads the original values for the list
61     --           Remark : If its length is mor then MaxLength, editions remain
62     --           allowed, except Add
63
64     SetTouched (me : mutable);
65     ---Purpose : Declares this ListEditor to have been touched (whatever action)
66
67     ClearEdit (me : mutable);
68     ---Purpose : Clears all editions already recorded
69
70         --- Editing : can be specialised
71
72     LoadEdited (me : mutable; list : HSequenceOfHAsciiString)
73         returns Boolean  is virtual;
74     ---Purpose : Loads a new list to replace the older one, in once !
75     --           By default (can be redefined) checks the length of the list
76     --           and the value of each item according to the def
77     --           Items are all recorded as Modified
78     --           
79     --           If no def has been given at creation time, no check is done
80     --           Returns True when done, False if checks have failed ... a
81     --           specialisation may also lock it by returning always False ...
82
83     SetValue (me : mutable; num : Integer; val : HAsciiString)
84         returns Boolean  is virtual;
85     ---Purpose : Sets a new value for the item <num> (in edited list)
86     --           <val> may be a Null Handle, then the value will be cleared but
87     --           not removed
88     --           Returns True when done. False if <num> is out of range or if
89     --           <val> does not satisfy the definition
90
91     AddValue (me : mutable; val : HAsciiString; atnum : Integer = 0)
92         returns Boolean  is virtual;
93     ---Purpose : Adds a new item. By default appends (at the end of the list)
94     --           Can insert before a given rank <num>, if positive
95     --           Returns True when done. False if MaxLength may be overpassed
96     --           or if <val> does not satisfy the definition
97
98     Remove (me : mutable; num : Integer = 0; howmany : Integer = 1)
99         returns Boolean  is virtual;
100     ---Purpose : Removes items from the list
101     --           By default removes one item. Else, count given by <howmany>
102     --           Remove from rank <num> included. By default, from the end
103     --           Returns True when done, False (and does not work) if case of
104     --           out of range of if <howmany> is greater than current length
105
106         --  Results
107
108     OriginalValues (me) returns HSequenceOfHAsciiString;
109     ---Purpose : Returns the value from which the edition started
110
111     EditedValues (me) returns HSequenceOfHAsciiString;
112     ---Purpose : Returns the result of the edition
113
114
115
116     NbValues (me; edited : Boolean = Standard_True) returns Integer;
117     ---Purpose : Returns count of values, edited (D) or original
118
119     Value (me; num : Integer; edited : Boolean = Standard_True)
120         returns HAsciiString;
121     ---Purpose : Returns a value given its rank. Edited (D) or Original
122     --           A Null String means the value is cleared but not removed
123
124     IsChanged (me; num : Integer) returns Boolean;
125     ---Purpose : Tells if a value (in edited list) has been changed, i.e.
126     --           either modified-value, or added
127
128     IsModified (me; num : Integer) returns Boolean;
129     ---Purpose : Tells if a value (in edited list) has been modified-value
130     --           (not added)
131
132     IsAdded (me; num : Integer) returns Boolean;
133     ---Purpose : Tells if a value (in edited list) has been added (new one)
134
135
136     IsTouched (me) returns Boolean;
137     ---Purpose : Tells if at least one edition (SetValue-AddValue-Remove) has
138     --           been recorded
139
140 fields
141
142     themax  : Integer;
143     thedef  : TypedValue;
144     thetouc : Integer;  -- global IsTouched
145     theorig : HSequenceOfHAsciiString;
146     theedit : HSequenceOfHAsciiString;
147     thestat : HSequenceOfInteger;
148     themodl : InterfaceModel;
149
150 end ListEditor;