X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_IWidgetCreator.h;h=85219c27cb044e9132d2a9a6b1d75f9ac20796e0;hb=f64cb187ce9ab2190d8eff7c9be7dcfffc4242a0;hp=58ec86295ede58754705b97acda26ce3e1c904ed;hpb=7392ac7dc1e6ecb157e8101c31bb205b2339f686;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_IWidgetCreator.h b/src/ModuleBase/ModuleBase_IWidgetCreator.h old mode 100755 new mode 100644 index 58ec86295..85219c27c --- a/src/ModuleBase/ModuleBase_IWidgetCreator.h +++ b/src/ModuleBase/ModuleBase_IWidgetCreator.h @@ -1,15 +1,38 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef ModuleBase_IWidgetCreator_H #define ModuleBase_IWidgetCreator_H #include "ModuleBase.h" +#include "ModelAPI_Feature.h" + #include #include #include class ModuleBase_ModelWidget; +class ModuleBase_PageBase; +class ModuleBase_IWorkshop; + +class Config_WidgetAPI; class QWidget; @@ -26,15 +49,49 @@ public: /// Virtual destructor ~ModuleBase_IWidgetCreator(); - /// Returns a list of possible widget types, which this creator can process - /// \param theTypes - virtual const std::set& widgetTypes() = 0; + /// Returns a container of possible page types, which this creator can process + /// The default implementation is empty + /// \param theTypes a list of type names + virtual void panelTypes(std::set& theTypes) {} + + /// Returns a container of possible page types, which this creator can process + /// The default implementation is empty + /// \param theTypes a list of type names + virtual void pageTypes(std::set& theTypes) {} + + /// Returns a container of possible widget types, which this creator can process + /// \param theTypes a list of type names + virtual void widgetTypes(std::set& theTypes) {} + + /// Create panel control by its type. + /// The default implementation is empty + /// \param theType a panel type + /// \param theParent a parent widget + /// \param theFeature a feature modified in the panel + /// \return created widget or null + virtual QWidget* createPanelByType(const std::string& theType, + QWidget* theParent, + const FeaturePtr& theFeature); + + /// Create page by its type + /// The default implementation is empty + /// \param theType a type + /// \param theParent a parent widget + /// \param theWidgetApi a low-level API for reading xml definitions of widgets + virtual ModuleBase_PageBase* createPageByType(const std::string& theType, + QWidget* theParent, + Config_WidgetAPI* theWidgetApi); - /// Create widget by its type - /// \param theType a type - /// \param theParent a parent widget + /// Create widget by its type + /// The default implementation is empty + /// \param theType a type + /// \param theParent a parent widget + /// \param theWidgetApi a low-level API for reading xml definitions of widgets + /// \param theWorkshop a workshop class instance virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, - QWidget* theParent = NULL) = 0; + QWidget* theParent, + Config_WidgetAPI* theWidgetApi, + ModuleBase_IWorkshop* theWorkshop); }; typedef std::shared_ptr WidgetCreatorPtr;