00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2010-01-16 19:57:43 +0100 (Sa, 16 Jan 2010) $ 00006 Version: $Revision: 21070 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef QmitkFunctionalityCoordinator_h 00020 #define QmitkFunctionalityCoordinator_h 00021 00022 #include <berryIPartListener.h> 00023 #include <berryIWindowListener.h> 00024 #include <berryIWorkbenchWindow.h> 00025 #include <set> 00026 #include "mitkQtCommonDll.h" 00027 class QmitkFunctionality; 00028 00032 class MITK_QT_COMMON QmitkFunctionalityCoordinator : virtual public berry::IPartListener, virtual public berry::IWindowListener 00033 { 00034 public: 00035 berryObjectMacro(QmitkFunctionalityCoordinator); 00036 berryNewMacro(QmitkFunctionalityCoordinator); 00037 00041 QmitkFunctionalityCoordinator(); 00045 virtual ~QmitkFunctionalityCoordinator(); 00049 void SetWindow(berry::IWorkbenchWindow::Pointer window); 00050 //#IPartListener methods (these methods internally call Activated() or other similar methods) 00054 berry::IPartListener::Events::Types GetPartEventTypes() const; 00058 virtual void PartActivated (berry::IWorkbenchPartReference::Pointer partRef); 00062 virtual void PartDeactivated(berry::IWorkbenchPartReference::Pointer /*partRef*/); 00066 virtual void PartOpened(berry::IWorkbenchPartReference::Pointer partRef); 00070 virtual void PartClosed (berry::IWorkbenchPartReference::Pointer partRef); 00074 virtual void PartHidden (berry::IWorkbenchPartReference::Pointer partRef); 00078 virtual void PartVisible (berry::IWorkbenchPartReference::Pointer partRef); 00079 00083 virtual void WindowClosed(berry::IWorkbenchWindow::Pointer window); 00084 00088 virtual void WindowOpened(berry::IWorkbenchWindow::Pointer /*window*/); 00089 protected: 00093 void ActivateStandaloneFunctionality(QmitkFunctionality* functionality); 00097 void DeactivateStandaloneFunctionality(QmitkFunctionality* functionality); 00101 berry::IWorkbenchWindow::WeakPtr m_Window; 00105 QmitkFunctionality* m_StandaloneFuntionality; 00109 std::set<QmitkFunctionality*> m_Functionalities; 00113 std::set<QmitkFunctionality*> m_VisibleStandaloneFunctionalities; 00114 }; 00115 00116 #endif // QmitkFunctionalityCoordinator_h