1 #ifndef SUIT_VIEWMODEL_H
2 #define SUIT_VIEWMODEL_H
5 #include "SUIT_Desktop.h"
6 #include "SUIT_ViewWindow.h"
7 #include "SUIT_ViewManager.h"
13 * This object manages the definition and behaviour of a View Window. \n
14 * In case of definition of this object in an external lib that lib must \n
15 * have an exported function "createViewModel" which returns newly created \n
16 * instance of SUIT_ViewModel.
20 #pragma warning( disable:4251 )
23 class SUIT_EXPORT SUIT_ViewModel : public QObject
27 enum HotOperation { PAN, ZOOM, ROTATE, FIT_AREA };
29 typedef QMap<HotOperation, Qt::ButtonState> StatesMap;
30 typedef QMap<HotOperation, Qt::ButtonState> ButtonsMap;
33 virtual ~SUIT_ViewModel();
35 virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
37 virtual void setViewManager(SUIT_ViewManager* theViewManager) { myViewManager = theViewManager; }
38 SUIT_ViewManager* getViewManager() const { return myViewManager; }
40 virtual QString getType() const { return "SUIT_ViewModel"; }
42 virtual void contextMenuPopup(QPopupMenu*) {}
44 static void setHotButton(HotOperation theOper, Qt::ButtonState theState,
45 Qt::ButtonState theButton);
46 static void getHotButton(HotOperation theOper, Qt::ButtonState& theState,
47 Qt::ButtonState& theButton);
50 SUIT_ViewManager* myViewManager;
53 static StatesMap myStateMap;
54 static ButtonsMap myButtonMap;
58 #pragma warning( default:4251 )
63 typedef SUIT_ViewModel* (*VIEWMODEL_CREATE_FUNC)();
66 #define VIEWMODEL_CREATE_NAME "createViewModel"