42cf5bc1 |
1 | // Created on: 1998-07-30 |
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 | #ifndef _IFSelect_ParamEditor_HeaderFile |
18 | #define _IFSelect_ParamEditor_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <TCollection_AsciiString.hxx> |
24 | #include <IFSelect_Editor.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <Standard_CString.hxx> |
27 | #include <Standard_Boolean.hxx> |
28 | #include <TColStd_HSequenceOfHAsciiString.hxx> |
29 | class Interface_TypedValue; |
30 | class TCollection_AsciiString; |
31 | class IFSelect_EditForm; |
32 | class TCollection_HAsciiString; |
33 | class Standard_Transient; |
34 | class Interface_InterfaceModel; |
35 | |
36 | |
37 | class IFSelect_ParamEditor; |
38 | DEFINE_STANDARD_HANDLE(IFSelect_ParamEditor, IFSelect_Editor) |
39 | |
40 | //! A ParamEditor gives access for edition to a list of TypedValue |
41 | //! (i.e. of Static too) |
42 | //! Its definition is made of the TypedValue to edit themselves, |
43 | //! and can add some constants, which can then be displayed but |
44 | //! not changed (for instance, system name, processor version ...) |
45 | //! |
46 | //! I.E. it gives a way of editing or at least displaying |
47 | //! parameters as global |
48 | class IFSelect_ParamEditor : public IFSelect_Editor |
49 | { |
50 | |
51 | public: |
52 | |
53 | |
54 | //! Creates a ParamEditor, empty, with a maximum count of params |
55 | //! (default is 100) |
56 | //! And a label, by default it will be "Param Editor" |
57 | Standard_EXPORT IFSelect_ParamEditor(const Standard_Integer nbmax = 100, const Standard_CString label = ""); |
58 | |
59 | //! Adds a TypedValue |
60 | //! By default, its short name equates its complete name, it can |
61 | //! be explicited |
62 | Standard_EXPORT void AddValue (const Handle(Interface_TypedValue)& val, const Standard_CString shortname = ""); |
63 | |
64 | //! Adds a Constant Text, it will be Read Only |
65 | //! By default, its long name equates its shortname |
66 | Standard_EXPORT void AddConstantText (const Standard_CString val, const Standard_CString shortname, const Standard_CString completename = ""); |
67 | |
79104795 |
68 | Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; |
42cf5bc1 |
69 | |
79104795 |
70 | Standard_EXPORT Standard_Boolean Recognize (const Handle(IFSelect_EditForm)& form) const Standard_OVERRIDE; |
42cf5bc1 |
71 | |
79104795 |
72 | Standard_EXPORT Handle(TCollection_HAsciiString) StringValue (const Handle(IFSelect_EditForm)& form, const Standard_Integer num) const Standard_OVERRIDE; |
42cf5bc1 |
73 | |
79104795 |
74 | Standard_EXPORT Standard_Boolean Load (const Handle(IFSelect_EditForm)& form, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; |
42cf5bc1 |
75 | |
79104795 |
76 | Standard_EXPORT Standard_Boolean Apply (const Handle(IFSelect_EditForm)& form, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; |
42cf5bc1 |
77 | |
78 | //! Returns a ParamEditor to work on the Static Parameters of |
79 | //! which names are listed in <list> |
80 | //! Null Handle if <list> is null or empty |
81 | Standard_EXPORT static Handle(IFSelect_ParamEditor) StaticEditor (const Handle(TColStd_HSequenceOfHAsciiString)& list, const Standard_CString label = ""); |
82 | |
83 | |
84 | |
85 | |
92efcf78 |
86 | DEFINE_STANDARD_RTTIEXT(IFSelect_ParamEditor,IFSelect_Editor) |
42cf5bc1 |
87 | |
88 | protected: |
89 | |
90 | |
91 | |
92 | |
93 | private: |
94 | |
95 | |
96 | TCollection_AsciiString thelabel; |
97 | |
98 | |
99 | }; |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | |
106 | |
107 | #endif // _IFSelect_ParamEditor_HeaderFile |