00001 /***************************************************************** 00002 * 00003 * This file is part of the FLIRTLib project 00004 * 00005 * FLIRTLib Copyright (c) 2010 Gian Diego Tipaldi and Kai O. Arras 00006 * 00007 * This software is licensed under the "Creative Commons 00008 * License (Attribution-NonCommercial-ShareAlike 3.0)" 00009 * and is copyrighted by Gian Diego Tipaldi and Kai O. Arras 00010 * 00011 * Further information on this license can be found at: 00012 * http://creativecommons.org/licenses/by-nc-sa/3.0/ 00013 * 00014 * FLIRTLib is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied 00016 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00017 * PURPOSE. 00018 * 00019 *****************************************************************/ 00020 00021 00022 00023 #ifndef PEAKFINDERPRESENTER_H_ 00024 #define PEAKFINDERPRESENTER_H_ 00025 00026 #include <utils/PeakFinder.h> 00027 #include <QtGui/QWidget> 00028 #include <QtCore/QObject> 00029 #include <gui/ParameterWidget.h> 00030 00031 class PeakFinderPresenter: public QObject{ 00032 public: 00033 PeakFinderPresenter(PeakFinder* peakFinder, ParameterWidget* peakParameter): 00034 m_peakFinder(peakFinder), 00035 m_peakFinderParameter(peakParameter) 00036 { } 00037 00038 inline void activate() 00039 {if(m_peakFinderParameter) m_peakFinderParameter->activate();} 00040 inline void deactivate() 00041 {if(m_peakFinderParameter) m_peakFinderParameter->deactivate();} 00042 00043 virtual void setPeakFinder(PeakFinder* peakFinder) = 0; 00044 00045 virtual void setPeakFinderParameter(ParameterWidget* peakParameter) = 0; 00046 00047 00048 inline const PeakFinder* getPeakFinder() const 00049 {return m_peakFinder;} 00050 inline const ParameterWidget* getPeakFinderParameter() const 00051 {return m_peakFinderParameter;} 00052 00053 inline PeakFinder* getPeakFinder() 00054 {return m_peakFinder;} 00055 inline ParameterWidget* getPeakFinderParameter() 00056 {return m_peakFinderParameter;} 00057 00058 protected: 00059 PeakFinder* m_peakFinder; 00060 ParameterWidget* m_peakFinderParameter; 00061 }; 00062 00063 #endif