Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:53

0001 // Created on: 1996-03-05
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1996-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IFSelect_Act_HeaderFile
0018 #define _IFSelect_Act_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <IFSelect_ActFunc.hxx>
0023 #include <IFSelect_Activator.hxx>
0024 #include <IFSelect_ReturnStatus.hxx>
0025 #include <Standard_Integer.hxx>
0026 class IFSelect_SessionPilot;
0027 
0028 
0029 class IFSelect_Act;
0030 DEFINE_STANDARD_HANDLE(IFSelect_Act, IFSelect_Activator)
0031 
0032 //! Act gives a simple way to define and add functions to be ran
0033 //! from a SessionPilot, as follows :
0034 //!
0035 //! Define a function as
0036 //! static IFSelect_RetStatus myfunc
0037 //! (const Standard_CString name,
0038 //! const Handle(IFSelect_SessionPilot)& pilot)
0039 //! { ... }
0040 //! When ran, it receives the exact name (string) of the called
0041 //! function, and the SessionPilot which brings other infos
0042 //!
0043 //! Add it by
0044 //! IFSelect_Act::AddFunc (name,help,myfunc);
0045 //! for a normal function, or
0046 //! IFSelect_Act::AddFSet (name,help,myfunc);
0047 //! for a function which is intended to create a control item
0048 //! name and help are given as CString
0049 //!
0050 //! Then, it is available for run
0051 class IFSelect_Act : public IFSelect_Activator
0052 {
0053 
0054 public:
0055 
0056   
0057   //! Creates an Act with a name, help and a function
0058   //! mode (Add or AddSet) is given when recording
0059   Standard_EXPORT IFSelect_Act(const Standard_CString name, const Standard_CString help, const IFSelect_ActFunc func);
0060   
0061   //! Execution of Command Line. remark that <number> is senseless
0062   //! because each Act brings one and only one function
0063   Standard_EXPORT IFSelect_ReturnStatus Do (const Standard_Integer number, const Handle(IFSelect_SessionPilot)& pilot) Standard_OVERRIDE;
0064   
0065   //! Short Help for commands : returns the help given to create
0066   Standard_EXPORT Standard_CString Help (const Standard_Integer number) const Standard_OVERRIDE;
0067   
0068   //! Changes the default group name for the following Acts
0069   //! group empty means to come back to default from Activator
0070   //! Also a file name can be precised (to query by getsource)
0071   Standard_EXPORT static void SetGroup (const Standard_CString group, const Standard_CString file = "");
0072   
0073   //! Adds a function with its name and help : creates an Act then
0074   //! records it as normal function
0075   Standard_EXPORT static void AddFunc (const Standard_CString name, const Standard_CString help, const IFSelect_ActFunc func);
0076   
0077   //! Adds a function with its name and help : creates an Act then
0078   //! records it as function for XSET (i.e. to create control item)
0079   Standard_EXPORT static void AddFSet (const Standard_CString name, const Standard_CString help, const IFSelect_ActFunc func);
0080 
0081 
0082 
0083 
0084   DEFINE_STANDARD_RTTIEXT(IFSelect_Act,IFSelect_Activator)
0085 
0086 protected:
0087 
0088 
0089 
0090 
0091 private:
0092 
0093 
0094   TCollection_AsciiString thename;
0095   TCollection_AsciiString thehelp;
0096   IFSelect_ActFunc thefunc;
0097 
0098 
0099 };
0100 
0101 
0102 
0103 
0104 
0105 
0106 
0107 #endif // _IFSelect_Act_HeaderFile