1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef CAM_APPLICATION_H
20 #define CAM_APPLICATION_H
22 #include "STD_Application.h"
24 #include "CAM_Module.h"
31 #pragma warning( disable:4251 )
35 \class CAM_Application
36 Defines application configuration and behaviour for application with modules.
37 Every module has own data model, necessary windows and viewers, etc.
38 Application provides all necessary functionality for module management
39 (loading of modules/activation/deactivation, etc)
41 class CAM_EXPORT CAM_Application : public STD_Application
46 typedef QPtrList<CAM_Module> ModuleList;
47 typedef QPtrListIterator<CAM_Module> ModuleListIterator;
50 CAM_Application( const bool = true );
51 virtual ~CAM_Application();
55 CAM_Module* activeModule() const;
56 CAM_Module* module( const QString& ) const;
58 /** @name Modules lists.*/
60 ModuleListIterator modules() const;
61 void modules( ModuleList& ) const;
62 void modules( QStringList&, const bool loaded = true ) const;
65 virtual void addModule( CAM_Module* );
67 virtual void loadModules();
68 virtual CAM_Module* loadModule( const QString& );
70 virtual bool activateModule( const QString& );
72 virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
74 QString moduleName( const QString& ) const;
75 QString moduleTitle( const QString& ) const;
77 virtual void createEmptyStudy();
80 virtual SUIT_Study* createNewStudy();
81 virtual void updateCommandsStatus();
83 virtual void moduleAdded( CAM_Module* );
84 virtual void beforeCloseDoc( SUIT_Study* );
85 virtual bool activateModule( CAM_Module* = 0 );
87 virtual void setActiveStudy( SUIT_Study* );
89 QString moduleLibrary( const QString&, const bool = true ) const;
92 void readModuleList();
95 typedef struct { QString name, title, internal; } ModuleInfo;
96 typedef QValueList<ModuleInfo> ModuleInfoList;
100 ModuleList myModules;
101 ModuleInfoList myInfoList;
106 #pragma warning( default:4251 )