Version: 9.16.0
StandardApp_Module.hxx
Go to the documentation of this file.
1// Copyright (C) 2011-2026 CEA, EDF, OPEN CASCADE
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19// Author : Guillaume Boulant (EDF)
20
21#ifndef _STANDARDAPP_MODULE_HXX_
22#define _STANDARDAPP_MODULE_HXX_
23
24#include <SUIT_ResourceMgr.h>
25#include <SalomeApp_Module.h>
26
27#include <SALOMEconfig.h>
28#include CORBA_SERVER_HEADER(SALOME_Component)
29
30#include <QString>
31
32#include "SalomeGuiHelpers.hxx"
33
34#define UNSPECIFIED_INT -1
35
64{
65 Q_OBJECT
66
67public:
68
69 // ================================================================
70 // This part defines the standard interface of the SalomeApp_Module
71 // ================================================================
72
75 QString engineIOR() const;
76 virtual void windows( QMap<int, int>& theMap ) const;
77
78public slots:
81
82 // ================================================================
83 // This part defines the specific interface of this class
84 // ================================================================
85
86public:
87 /* Creates an action with standard default values */
88 int createStandardAction(const QString& label,
89 QObject * slotobject,
90 const char* slotmember,
91 const QString& iconName=QString(),
92 const QString& tooltip=QString(),
93 const int identifier=ACTIONID_UNDEFINED);
94
95 void addActionInToolbar(int actionId);
96 void addActionInMenubar(int actionId, int menuId=UNSPECIFIED_INT);
97 void addActionInPopupMenu(int actionId,const QString& menus="",const QString& rule="client='ObjectBrowser'");
98
99protected:
100 /* Implement this to create additionnal widget (e.g. docked widget) */
101 virtual void createModuleWidgets();
102 /* Implement this to define the actions for this gui */
103 virtual void createModuleActions();
104
105 /* Use this to create a root entry in the study for this module */
106 void createStudyComponent();
107 /* Implement this to say if study component entry should be created
108 at activation step */
109 virtual bool createStudyComponentAtActivation();
110
111 /* The engine is the SALOME component associated to the study */
112 virtual Engines::EngineComponent_ptr getEngine() const = 0;
113 // Note that the function getEngine() is virtual pure and must be
114 // implemented in the specific inherited classes. Note also that the
115 // const flag is required because getEngine is used by functions
116 // with const flags (see for ex: engineIOR()).
117 virtual QString studyIconName();
118
119 QIcon createIcon(const QString& iconName);
120 int newActionId();
121
123 DOCKLAYOUT_BOTTOM_HLARGE, // Bottom is Horizontal Large
124 DOCKLAYOUT_LEFT_VLARGE, // Left is Vertical Large
125 };
126 virtual void setDockLayout(DockLayoutType layoutType);
127 virtual void unsetDockLayout();
128
132
135
136private:
138 Qt::DockWidgetArea _areaAtBottomLeftCorner;
139 Qt::DockWidgetArea _areaAtBottomRightCorner;
140
141 // =========================================================
142 // This part defines slots for test purposes
143 // =========================================================
144
145protected slots:
146 void OnTest();
147};
148
149#endif
#define SALOMEGUIHELPERS_EXPORT
Definition: SalomeGuiHelpers.hxx:33
#define UNSPECIFIED_INT
Definition: StandardApp_Module.hxx:34
Introduces an application class which provides modular architecture.
Definition: CAM_Application.h:39
virtual void initialize(CAM_Application *)
Definition: LightApp_Module.cxx:128
virtual bool activateModule(SUIT_Study *)
Definition: LightApp_Module.cxx:221
virtual bool deactivateModule(SUIT_Study *)
Definition: LightApp_Module.cxx:263
virtual void windows(QMap< int, int > &) const
Definition: LightApp_Module.cxx:138
For more information see QT documentation.
Definition: SUIT_ResourceMgr.h:31
Definition: SUIT_Study.h:41
Base class for all salome modules.
Definition: SalomeApp_Module.h:45
virtual QString engineIOR() const =0
Definition: StandardApp_Module.hxx:64
DockLayoutType
Definition: StandardApp_Module.hxx:122
@ DOCKLAYOUT_LEFT_VLARGE
Definition: StandardApp_Module.hxx:124
@ DOCKLAYOUT_BOTTOM_HLARGE
Definition: StandardApp_Module.hxx:123
Qt::DockWidgetArea _areaAtBottomRightCorner
Definition: StandardApp_Module.hxx:139
int _actionId_internalCount
Definition: StandardApp_Module.hxx:137
SUIT_ResourceMgr * _resourceMgr
Definition: StandardApp_Module.hxx:129
Qt::DockWidgetArea _areaAtBottomLeftCorner
Definition: StandardApp_Module.hxx:138
static int ACTIONID_UNDEFINED
Definition: StandardApp_Module.hxx:134
virtual Engines::EngineComponent_ptr getEngine() const =0
int _defaultMenuId
Definition: StandardApp_Module.hxx:130
static int ACTIONID_DEFAULT_INIT_VALUE
Definition: StandardApp_Module.hxx:133
int _defaultToolbarId
Definition: StandardApp_Module.hxx:131