1 // File: SalomeApp_Module.h
2 // Created: 10/25/2004 11:33:06 AM
3 // Author: Sergey LITONIN
4 // Copyright (C) CEA 2004
6 #ifndef SALOMEAPP_MODULE_H
7 #define SALOMEAPP_MODULE_H
11 #include <LightApp_Module.h>
16 class SUIT_DataObject;
18 class SalomeApp_Application;
20 class SalomeApp_Operation;
21 class SalomeApp_SwitchOp;
24 * \brief Base class for all salome modules
26 class SALOMEAPP_EXPORT SalomeApp_Module : public LightApp_Module
31 SalomeApp_Module( const QString& );
32 virtual ~SalomeApp_Module();
34 /*! engineIOR() should be a pure virtual method, to avoid logical errors!\n
35 * Implementation in derived classes can return the following values:\n
36 * module`s engine IOR - means that this is a standard SALOME module with a CORBA engine
37 * \li "" (empty string) - means that this is a light module, default engine should be used for interaction with SALOMEDS persistence
38 * \li "-1" - means that this is a light module, SALOMEDS persistence is not used at all\n
40 virtual QString engineIOR() const = 0;
42 /*! Convenient shortcuts*/
44 SalomeApp_Application* getApp() const;
46 virtual void update( const int );
47 // Update viewer or/and object browser etc. in accordance with update flags
48 // ( see SalomeApp_UpdateFlags enumeration ). Derived modules can redefine this method
49 // for their own purposes
52 virtual bool activateModule( SUIT_Study* );
53 virtual bool deactivateModule( SUIT_Study* );
56 virtual void onOperationStopped( SUIT_Operation* );
57 virtual void onOperationDestroyed();
60 virtual CAM_DataModel* createDataModel();
62 virtual void updateControls();
64 /*! Module stores operations in map. This method starts operation by id.
65 * If operation isn't in map, then it will be created by createOperation method
66 * and will be inserted to map
68 void startOperation( const int );
70 /*! Create operation by its id. You must not call this method, it will be called automatically
71 * by startOperation. Please redefine this method in current module
73 virtual SalomeApp_Operation* createOperation( const int ) const;
76 typedef QMap<int,SalomeApp_Operation*> MapOfOperation;
79 MapOfOperation myOperations;
80 SalomeApp_SwitchOp* mySwitchOp;