00001 /******************************************************************************* 00002 00003 Copyright (C) 2007 by Brendon Costa 00004 00005 This library is free software; you can redistribute it and/or modify 00006 it under the terms of the "LGPL Like" License defined in the file COPYING 00007 that should have been distributed along with this source. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 You should have received a copy of the "LGPL Like" License 00014 along with this library; see the file COPYING. if not, it can be 00015 obtained from the EDoc++ website: 00016 http://edoc.sourceforge.net/license.html 00017 00018 *******************************************************************************/ 00019 #ifndef EDOC_PROGRESSIFACE_H 00020 #define EDOC_PROGRESSIFACE_H 00021 00022 #include "EDoc/stdint.h" 00023 00024 namespace EDoc 00025 { 00026 //=========================================================================== 00027 /** \brief Interface used for giving progress indication on a task. 00028 */ 00029 template <typename T> 00030 class ProgressIFace 00031 { 00032 public: 00033 00034 //------------------------------------------------------------------------ 00035 /** \brief Destructor. 00036 */ 00037 virtual ~ProgressIFace() {} 00038 00039 //------------------------------------------------------------------------ 00040 /** \brief Called to start the progress indication. 00041 * 00042 * \param total indicates the total number of times that the 00043 * Progress() function will be called to reach 100% progress. 00044 */ 00045 virtual void Start(size_t total) = 0; 00046 00047 //------------------------------------------------------------------------ 00048 /** \brief Called each time some progress is made that is to be 00049 * shown to the user. 00050 * 00051 * Note: This must be called exactly total number of times, where 00052 * total is the value passed to the Start() function. 00053 */ 00054 virtual void Progress(T* data) = 0; 00055 00056 //------------------------------------------------------------------------ 00057 }; 00058 //=========================================================================== 00059 class Function; 00060 typedef ProgressIFace<Function> FunctionProgressIFace; 00061 typedef FunctionProgressIFace* FunctionProgressIFacePtr; 00062 } 00063 00064 #endif // EDOC_PROGRESSIFACE_H