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 00019 #ifndef MITKPROGRESSBAR_H 00020 #define MITKPROGRESSBAR_H 00021 #include <itkObject.h> 00022 #include "mitkCommon.h" 00023 00024 00025 namespace mitk 00026 { 00027 00028 class ProgressBarImplementation; 00029 00030 //##Documentation 00031 //## @brief Sending a message to the applications ProgressBar 00032 //## 00033 //## Holds a GUI dependent ProgressBarImplementation and sends the progress further. 00034 //## All mitk-classes use this class to display progress on GUI-ProgressBar. 00035 //## The mainapplication has to set the internal held ProgressBarImplementation with SetImplementationInstance(..). 00036 //## @ingroup Interaction 00037 class MITK_CORE_EXPORT ProgressBar : public itk::Object 00038 { 00039 00040 public: 00041 itkTypeMacro(ProgressBar, itk::Object); 00042 00043 //##Documentation 00044 //## @brief static method to get the GUI dependent ProgressBar-instance 00045 //## so the methods for steps to do and progress can be called 00046 //## No reference counting, cause of decentral static use! 00047 static ProgressBar* GetInstance(); 00048 00049 //##Documentation 00050 //## @brief Supply a GUI- dependent ProgressBar. Has to be set by the application 00051 //## to connect the application dependent subclass of mitkProgressBar 00052 static void SetImplementationInstance(ProgressBarImplementation* implementation); 00053 00054 //##Documentation 00055 //## @brief Adds steps to totalSteps. 00056 void AddStepsToDo(unsigned int steps); 00057 00058 //##Documentation 00059 //## @brief Sets the current amount of progress to current progress + steps. 00060 //## @param: steps the number of steps done since last Progress(int steps) call. 00061 void Progress(unsigned int steps = 1); 00062 00063 //##Documentation 00064 //## @brief Sets whether the current progress value is displayed. 00065 void SetPercentageVisible (bool visible); 00066 00067 protected: 00068 00069 ProgressBar(); 00070 00071 virtual ~ProgressBar(); 00072 00073 static ProgressBarImplementation* m_Implementation; 00074 00075 static ProgressBar* m_Instance; 00076 }; 00077 00078 }// end namespace mitk 00079 00080 #endif /* define MITKPROGRESSBAR_H */ 00081