0029807: [Regression to 7.0.0] Impossible to cut cone from prism
[occt.git] / tools / VInspector / VInspector_ToolBar.hxx
1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement. 
15
16 #ifndef VInspector_ToolBar_H
17 #define VInspector_ToolBar_H
18
19 #include <Standard.hxx>
20 #include <Standard_Macro.hxx>
21 #include <inspector/VInspector_ToolActionType.hxx>
22
23 #include <Standard_WarningsDisable.hxx>
24 #include <QMap>
25 #include <QObject>
26 #include <Standard_WarningsRestore.hxx>
27
28 class QWidget;
29 class QPushButton;
30
31 //! \class VInspector_ToolBar
32 //! Container of View tool bar actions
33 class VInspector_ToolBar : public QObject
34 {
35   Q_OBJECT
36
37 public:
38
39   //! Constructor
40   Standard_EXPORT VInspector_ToolBar (QWidget* theParent);
41
42   //! Destructor
43   virtual ~VInspector_ToolBar() Standard_OVERRIDE {}
44
45   //! Returns main control
46   QWidget* GetControl() const { return myMainWindow; }
47
48   //! Returns tool button by action index
49   //! \param theActionId index of action
50   Standard_EXPORT QPushButton* GetToolButton (const VInspector_ToolActionType& theActionId) const;
51
52 signals:
53
54   //! Signal about action click
55   //! \param theActionId an action index
56   void actionClicked (int theActionId);
57
58 private slots:
59
60   //! Provides switch for action. Emits signal about action click
61   void onActionClicked();
62
63 private:
64
65   QWidget* myMainWindow; //!< the main control
66   QMap<VInspector_ToolActionType, QPushButton*> myActionsMap; //!< container of type into button
67 };
68
69 #endif