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/
19 #ifndef SUIT_VIEWMANAGER_H
20 #define SUIT_VIEWMANAGER_H
23 #include "SUIT_ViewWindow.h"
24 #include "SUIT_PopupClient.h"
27 #include <qptrvector.h>
36 #pragma warning( disable:4251 )
39 class SUIT_EXPORT SUIT_ViewManager : public QObject, public SUIT_PopupClient
43 SUIT_ViewManager( SUIT_Study*,
45 SUIT_ViewModel* = 0 );
46 virtual ~SUIT_ViewManager();
48 virtual QString popupClientType() const { return getType(); }
49 virtual void contextMenuPopup( QPopupMenu* );
51 void setViewModel(SUIT_ViewModel* theViewModel);
52 SUIT_ViewModel* getViewModel() { return myViewModel; }
54 SUIT_Study* study() const;
56 QString getType() const;
57 SUIT_ViewWindow* getActiveView() { return myActiveView; }
59 int getViewsCount() { return myViews.count(); }
60 QPtrVector<SUIT_ViewWindow> getViews() { return myViews; }
62 QString getTitle() const { return myTitle;}
63 void setTitle(QString theTitle) { myTitle = theTitle; }
65 SUIT_ViewWindow* createViewWindow();
67 virtual void setShown( const bool );
74 void lastViewClosed(SUIT_ViewManager*);
75 void deleteView(SUIT_ViewWindow*);
76 void viewCreated(SUIT_ViewWindow*);
77 void mousePress(SUIT_ViewWindow*, QMouseEvent*);
78 void mouseRelease(SUIT_ViewWindow*, QMouseEvent*);
79 void mouseDoubleClick(SUIT_ViewWindow*, QMouseEvent*);
80 void mouseMove(SUIT_ViewWindow*, QMouseEvent*);
81 void wheel(SUIT_ViewWindow*, QWheelEvent*);
82 void keyPress(SUIT_ViewWindow*, QKeyEvent*);
83 void keyRelease(SUIT_ViewWindow*, QKeyEvent*);
84 void activated(SUIT_ViewManager*);
87 void onWindowActivated(SUIT_ViewWindow*);
88 void onDeleteView(SUIT_ViewWindow* theView);
89 void onMousePressed(SUIT_ViewWindow* theView, QMouseEvent* theEvent);
93 void onContextMenuRequested( QContextMenuEvent* e );
96 /*! Inserts the View into internal Views Vector.\n
97 * Returns true if view has been added successfully
99 virtual bool insertView(SUIT_ViewWindow* theView);
101 /*! Removes the View from internal Views Vector.*/
102 virtual void removeView(SUIT_ViewWindow* theView);
104 /*! Used to set unique name for the view.*/
105 virtual void setViewName(SUIT_ViewWindow* theView);
108 SUIT_Desktop* myDesktop;
109 SUIT_ViewModel* myViewModel;
110 QPtrVector<SUIT_ViewWindow> myViews;
111 SUIT_ViewWindow* myActiveView;
118 #pragma warning( default:4251 )