00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef VRS_PROGRESSBAR_H
00019 #define VRS_PROGRESSBAR_H
00020
00021 #include <vrs/sharedobj.h>
00022 #include <vector>
00023
00024 namespace VRS {
00025
00026 class Progress;
00027
00034 class VRS_CORE_API ProgressBar :
00035 public VRS::SharedObj
00036 {
00037 public:
00038 static void push(ProgressBar* progressBar);
00048 static ProgressBar* top();
00053 static void pop();
00059 private:
00060 virtual void show() = 0;
00065 virtual void hide() = 0;
00070 virtual bool progress(const std::vector<Progress*>& progresses) = 0;
00078 virtual double updateFrequency() const { return 2.0; }
00085 virtual double showDelay() const { return 2.0; }
00093
00094 virtual void finish(const std::vector<Progress*>& progresses) { };
00095
00096 protected:
00097 friend class Progress;
00098
00099
00100 static void showBar();
00101 static bool updateBar(
00102 const std::vector<Progress*>& progresses,
00103 bool forceUpdate,
00104 bool forceShow
00105 );
00106 static void hideBar();
00107
00110 static void finishBar(const std::vector<Progress*>& progresses);
00111 };
00112
00113 }
00114
00115 #endif // VRS_PROGRESSBAR_H