X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_IModule.h;h=6404849276d5534225e3a22a4b5572708913cf2e;hb=9d08fda0173567e0b8f1232a9dabb330fdeffe0f;hp=6a4401f765e27efa2f7c1b83576ce313564595f9;hpb=142e6a7451245b1c39e5d0afbabb5dc4f678520e;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_IModule.h b/src/ModuleBase/ModuleBase_IModule.h index 6a4401f76..640484927 100644 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h @@ -1,40 +1,52 @@ -#ifndef ModuleBase_IModule_H -#define ModuleBase_IModule_H - -#include -#include - -class QAction; -class XGUI_Workshop; - -/** -* Interface to a module -*/ -class ModuleBase_IModule: public QObject -{ -public: - /// Reads description of features from XML file - virtual void createFeatures() = 0; - - /// Called on creation of menu item in desktop - virtual void featureCreated(QAction*) = 0; - - /// Creates an operation and send it to loop - /// \param theCmdId the operation name - virtual void launchOperation(const QString& theCmdId) = 0; - - /// Called when it is necessary to update a command state (enable or disable it) - virtual bool isFeatureEnabled(const QString& theCmdId) const = 0; - - virtual ~ModuleBase_IModule() {}; -}; - -//! This function must return a new module instance. -extern "C" -{ -typedef ModuleBase_IModule* (*CREATE_FUNC)(XGUI_Workshop*); -} - -#define CREATE_MODULE "createModule" - -#endif //ModuleBase_IModule +#ifndef ModuleBase_IModule_H +#define ModuleBase_IModule_H + +#include +#include + +class QAction; +class XGUI_Workshop; +class Config_WidgetAPI; +class ModuleBase_ModelWidget; + +/** + * Interface to a module + */ +class ModuleBase_IModule : public QObject +{ + public: + /// Reads description of features from XML file + virtual void createFeatures() = 0; + + /// Called on creation of menu item in desktop + virtual void featureCreated(QAction*) = 0; + + /// Creates an operation and send it to loop + /// \param theCmdId the operation name + virtual void launchOperation(const QString& theCmdId) = 0; + + /// Called when it is necessary to update a command state (enable or disable it) + //virtual bool isFeatureEnabled(const QString& theCmdId) const = 0; + + /// Creates custom widgets for property panel + virtual QWidget* createWidgetByType(const std::string& theType, QWidget* theParent, + Config_WidgetAPI* theWidgetApi, + QList& theModelWidgets) + { + return 0; + } + + virtual ~ModuleBase_IModule() + { + } + ; +}; + +//! This function must return a new module instance. +extern "C" { +typedef ModuleBase_IModule* (*CREATE_FUNC)(XGUI_Workshop*); +} + +#define CREATE_MODULE "createModule" + +#endif //ModuleBase_IModule \ No newline at end of file