1 #ifndef SUIT_VIEWMANAGER_H
2 #define SUIT_VIEWMANAGER_H
5 #include "SUIT_ViewWindow.h"
6 #include "SUIT_PopupClient.h"
9 #include <qptrvector.h>
18 #pragma warning( disable:4251 )
21 class SUIT_EXPORT SUIT_ViewManager : public QObject, public SUIT_PopupClient
25 SUIT_ViewManager( SUIT_Study*,
27 SUIT_ViewModel* = 0 );
28 virtual ~SUIT_ViewManager();
30 virtual QString popupClientType() const { return getType(); }
31 virtual void contextMenuPopup( QPopupMenu* );
33 void setViewModel(SUIT_ViewModel* theViewModel);
34 SUIT_ViewModel* getViewModel() { return myViewModel; }
36 SUIT_Study* study() const;
38 QString getType() const;
39 SUIT_ViewWindow* getActiveView() { return myActiveView; }
41 int getViewsCount() { return myViews.count(); }
42 QPtrVector<SUIT_ViewWindow> getViews() { return myViews; }
44 QString getTitle() const { return myTitle;}
45 void setTitle(QString theTitle) { myTitle = theTitle; }
47 SUIT_ViewWindow* createViewWindow();
49 virtual void setShown( const bool );
56 void lastViewClosed(SUIT_ViewManager*);
57 void deleteView(SUIT_ViewWindow*);
58 void viewCreated(SUIT_ViewWindow*);
59 void mousePress(SUIT_ViewWindow*, QMouseEvent*);
60 void mouseRelease(SUIT_ViewWindow*, QMouseEvent*);
61 void mouseDoubleClick(SUIT_ViewWindow*, QMouseEvent*);
62 void mouseMove(SUIT_ViewWindow*, QMouseEvent*);
63 void wheel(SUIT_ViewWindow*, QWheelEvent*);
64 void keyPress(SUIT_ViewWindow*, QKeyEvent*);
65 void keyRelease(SUIT_ViewWindow*, QKeyEvent*);
66 void activated(SUIT_ViewManager*);
69 void onWindowActivated(SUIT_ViewWindow*);
70 void onDeleteView(SUIT_ViewWindow* theView);
71 void onMousePressed(SUIT_ViewWindow* theView, QMouseEvent* theEvent);
75 void onContextMenuRequested( QContextMenuEvent* e );
78 /*! Inserts the View into internal Views Vector.\n
79 * Returns true if view has been added successfully
81 virtual bool insertView(SUIT_ViewWindow* theView);
83 /*! Removes the View from internal Views Vector.*/
84 virtual void removeView(SUIT_ViewWindow* theView);
86 /*! Used to set unique name for the view.*/
87 virtual void setViewName(SUIT_ViewWindow* theView);
90 SUIT_Desktop* myDesktop;
91 SUIT_ViewModel* myViewModel;
92 QPtrVector<SUIT_ViewWindow> myViews;
93 SUIT_ViewWindow* myActiveView;
100 #pragma warning( default:4251 )