1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef CAM_APPLICATION_H
23 #define CAM_APPLICATION_H
27 #include <STD_Application.h>
34 #pragma warning( disable:4251 )
37 class CAM_EXPORT CAM_Application : public STD_Application
42 typedef QList<CAM_Module*> ModuleList;
45 CAM_Application( const bool = true );
46 virtual ~CAM_Application();
50 CAM_Module* activeModule() const;
51 CAM_Module* module( const QString& ) const;
53 ModuleList modules() const;
54 void modules( ModuleList& ) const;
55 void modules( QStringList&, const bool loaded = true ) const;
57 virtual void addModule( CAM_Module* );
59 virtual void loadModules();
60 virtual CAM_Module* loadModule( const QString&, const bool = true );
62 virtual bool activateModule( const QString& );
64 virtual void contextMenuPopup( const QString&, QMenu*, QString& );
66 QString moduleName( const QString& ) const;
67 QString moduleTitle( const QString& ) const;
68 QString moduleIcon( const QString& ) const;
70 virtual void createEmptyStudy();
73 virtual SUIT_Study* createNewStudy();
74 virtual void updateCommandsStatus();
76 virtual void moduleAdded( CAM_Module* );
77 virtual void beforeCloseDoc( SUIT_Study* );
78 virtual bool activateModule( CAM_Module* = 0 );
80 virtual void setActiveStudy( SUIT_Study* );
82 QString moduleLibrary( const QString&, const bool = true ) const;
85 void readModuleList();
88 typedef struct { QString name, title, internal, icon; } ModuleInfo;
89 typedef QList<ModuleInfo> ModuleInfoList;
92 CAM_Module* myModule; //!< active module
93 ModuleList myModules; //!< loaded modules list
94 ModuleInfoList myInfoList; //!< modules info list
95 bool myAutoLoad; //!< auto loading flag
99 #pragma warning( default:4251 )