src/CAF/CAF_Application.h

Go to the documentation of this file.
00001 // Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
00002 // 
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either 
00006 // version 2.1 of the License.
00007 // 
00008 // This library is distributed in the hope that it will be useful 
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public  
00014 // License along with this library; if not, write to the Free Software 
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 #ifndef CAF_APPLICATION_H
00020 #define CAF_APPLICATION_H
00021 
00022 #include "CAF.h"
00023 
00024 #include "STD_Application.h"
00025 
00026 #include <qmap.h>
00027 #include <qptrlist.h>
00028 
00029 #include <TDocStd_Application.hxx>
00030 
00031 class QtxAction;
00032 class CAF_Study;
00033 
00034 #if defined WIN32
00035 #pragma warning ( disable: 4251 )
00036 #endif
00037 
00044 class CAF_EXPORT CAF_Application : public STD_Application
00045 {
00046   Q_OBJECT
00047 
00048 public:
00049   CAF_Application();
00050   CAF_Application( const Handle(TDocStd_Application)& );
00051   virtual ~CAF_Application();
00052 
00053   virtual QString             applicationName() const;
00054 
00055   Handle(TDocStd_Application) stdApp() const;
00056 
00057   virtual QString             getFileFilter() const;
00058 
00059 public slots:  
00060   virtual void                onHelpAbout();
00061 
00062 protected slots:
00063   virtual bool                onUndo( int );
00064   virtual bool                onRedo( int );
00065   
00066 protected:
00067   enum {  EditUndoId = STD_Application::UserID, EditRedoId, UserID };
00068 
00069 protected:
00070   virtual void                createActions();
00071   virtual void                updateCommandsStatus();
00072 
00073   virtual SUIT_Study*         createNewStudy();
00074 
00075   bool                                   undo( CAF_Study* doc );
00076   bool                                   redo( CAF_Study* doc );
00077 
00078   virtual void                setStdApp( const Handle(TDocStd_Application)& );
00079 
00080 private:
00081   Handle(TDocStd_Application) myStdApp;
00082 };
00083 
00084 #if defined WIN32
00085 #pragma warning ( default: 4251 )
00086 #endif
00087 
00088 #endif