Salome HOME
updated copyright message
[modules/shaper.git] / src / ModuleBase / ModuleBase_ToolBox.h
index 1c2c1ef7d37df2cf6cc859207c2311589ccfe076..c41fd5a260fdc26a0605b3eb43224d74a9f99bd6 100644 (file)
@@ -1,8 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        ModuleBase_ToolBox.h
-// Created:     10 August 2015
-// Author:      Alexandre SOLOVYOV
+// Copyright (C) 2014-2023  CEA, EDF
+//
+// 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_ToolBox_H
 #define ModuleBase_ToolBox_H
@@ -14,6 +27,7 @@ class QButtonGroup;
 class QFrame;
 class QHBoxLayout;
 class QStackedWidget;
+class ModuleBase_ModelWidget;
 
 /**
  * \class ModuleBase_ToolBox
@@ -27,14 +41,16 @@ class MODULEBASE_EXPORT ModuleBase_ToolBox : public QFrame
 public:
   /// Constructor
   /// \param theParent a parent widget
-  ModuleBase_ToolBox( QWidget* theParent );
+  /// \param theUseFrameStyleBox a flag if the tool box should have box covered
+  /// buttons and current page
+  ModuleBase_ToolBox(QWidget* theParent, const bool theUseFrameStyleBox = false);
   virtual ~ModuleBase_ToolBox();
 
   ///  Add a new item to the tool box
   /// \param thePage a widget of the new item
   /// \param theName a name of the item
   /// \param theIcon an icon of the item
-  void addItem( QWidget* thePage, const QString& theName, const QPixmap& theIcon );
+  void addItem(QWidget* thePage, const QString& theName, const QPixmap& theIcon);
 
   /// \return number of items
   int count() const;
@@ -44,15 +60,21 @@ public:
 
   /// Set current item
   /// \param theIdx an index
-  void setCurrentIndex( const int theIdx);
+  void setCurrentIndex(const int theIdx);
+
+  /// Found in the controls of the model widget parent in Stacked Widget
+  /// returns whether this controls are in the current widget of the stacked widgets
+  /// \param theWidget a model widget
+  /// \return boolean result
+  static bool isOffToolBoxParent(ModuleBase_ModelWidget* theWidget);
 
 signals:
   /// A signal which is emited on current item changed
-  void currentChanged( int );
+  void currentChanged(int);
 
 private slots:
   /// A slot called on button press
-  void onButton( int );
+  void onButton(int);
 
 private:
   QButtonGroup*   myButtonsGroup;