1 // Created on: 1998-02-23
2 // Created by: Christian CAILLET
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Interface_TypedValue_HeaderFile
18 #define _Interface_TypedValue_HeaderFile
20 #include <Standard.hxx>
22 #include <MoniTool_TypedValue.hxx>
23 #include <Interface_ParamType.hxx>
24 #include <MoniTool_ValueType.hxx>
25 class TCollection_HAsciiString;
28 class Interface_TypedValue;
29 DEFINE_STANDARD_HANDLE(Interface_TypedValue, MoniTool_TypedValue)
31 //! Now strictly equivalent to TypedValue from MoniTool,
32 //! except for ParamType which remains for compatibility reasons
34 //! This class allows to dynamically manage .. typed values, i.e.
35 //! values which have an alphanumeric expression, but with
36 //! controls. Such as "must be an Integer" or "Enumerative Text"
39 //! Hence, a TypedValue brings a specification (type + constraints
40 //! if any) and a value. Its basic form is a string, it can be
41 //! specified as integer or real or enumerative string, then
43 //! Its string content, which is a Handle(HAsciiString) can be
44 //! shared by other data structures, hence gives a direct on line
45 //! access to its value.
46 class Interface_TypedValue : public MoniTool_TypedValue
52 //! Creates a TypedValue, with a name
54 //! type gives the type of the parameter, default is free text
55 //! Also available : Integer, Real, Enum, Entity (i.e. Object)
56 //! More precise specifications, titles, can be given to the
57 //! TypedValue once created
59 //! init gives an initial value. If it is not given, the
60 //! TypedValue begins as "not set", its value is empty
61 Standard_EXPORT Interface_TypedValue(const Standard_CString name, const Interface_ParamType type = Interface_ParamText, const Standard_CString init = "");
64 //! I.E. calls ValueType then makes correspondence between
65 //! ParamType from Interface (which remains for compatibility
66 //! reasons) and ValueType from MoniTool
67 Standard_EXPORT Interface_ParamType Type() const;
69 //! Correspondence ParamType from Interface to ValueType from MoniTool
70 Standard_EXPORT static MoniTool_ValueType ParamTypeToValueType (const Interface_ParamType typ);
72 //! Correspondence ParamType from Interface to ValueType from MoniTool
73 Standard_EXPORT static Interface_ParamType ValueTypeToParamType (const MoniTool_ValueType typ);
78 DEFINE_STANDARD_RTTIEXT(Interface_TypedValue,MoniTool_TypedValue)
88 TCollection_AsciiString thename;
89 TCollection_AsciiString thedef;
90 TCollection_AsciiString thelabel;
91 Handle(Standard_Type) theotyp;
92 TCollection_AsciiString theunidef;
93 Handle(TColStd_HArray1OfAsciiString) theenums;
94 NCollection_DataMap<TCollection_AsciiString, Standard_Integer> theeadds;
95 TCollection_AsciiString thesatisn;
96 Handle(TCollection_HAsciiString) thehval;
97 Handle(Standard_Transient) theoval;
108 #endif // _Interface_TypedValue_HeaderFile