00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 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 #ifndef MITK_BASEPROPERTYOBSERVER_H_INCLUDED 00019 #define MITK_BASEPROPERTYOBSERVER_H_INCLUDED 00020 00021 #include <itkEventObject.h> 00022 #include "MitkExtExports.h" 00023 #include "mitkCommon.h" 00024 00025 namespace mitk { 00026 00038 class BaseProperty; 00039 00040 class MitkExt_EXPORT PropertyObserver 00041 { 00042 public: 00043 00044 PropertyObserver(); 00045 virtual ~PropertyObserver(); 00046 00047 virtual void PropertyChanged() = 0; 00048 virtual void PropertyRemoved() = 0; 00049 00050 protected: 00051 00052 void BeginModifyProperty(); 00053 void EndModifyProperty(); 00054 00055 unsigned long m_ModifiedTag; 00056 unsigned long m_DeleteTag; 00057 00058 bool m_SelfCall; 00059 }; 00060 00061 class MitkExt_EXPORT PropertyView : public PropertyObserver 00062 { 00063 public: 00064 00065 PropertyView( const mitk::BaseProperty* ); 00066 virtual ~PropertyView(); 00067 00068 void OnModified(const itk::EventObject& e); 00069 void OnDelete(const itk::EventObject& e); 00070 00071 protected: 00072 00073 const mitk::BaseProperty* m_Property; 00074 }; 00075 00076 class MitkExt_EXPORT PropertyEditor : public PropertyObserver 00077 { 00078 public: 00079 00080 PropertyEditor( mitk::BaseProperty* ); 00081 virtual ~PropertyEditor(); 00082 00083 void OnModified(const itk::EventObject& e); 00084 void OnDelete(const itk::EventObject& e); 00085 00086 protected: 00087 00088 mitk::BaseProperty* m_Property; 00089 }; 00090 00091 } 00092 00093 #endif 00094 00095