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