vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / media / plugins / ape_reader / MAClib / MACProgressHelper.h
blobbd3421d74919c267c79897d67001172acb4c772a
1 #ifndef APE_MACPROGRESSHELPER_H
2 #define APE_MACPROGRESSHELPER_H
4 #define KILL_FLAG_CONTINUE 0
5 #define KILL_FLAG_PAUSE -1
6 #define KILL_FLAG_STOP 1
8 #include "NoWindows.h"
9 #include "MACLib.h"
11 //typedef void ( * APE_PROGRESS_CALLBACK) (int);
13 class CMACProgressHelper
15 public:
17 CMACProgressHelper(int nTotalSteps, int *pPercentageDone, APE_PROGRESS_CALLBACK ProgressCallback, int *pKillFlag);
18 virtual ~CMACProgressHelper();
20 void UpdateProgress(int nCurrentStep = -1, BOOL bForceUpdate = FALSE);
21 void UpdateProgressComplete() { UpdateProgress(m_nTotalSteps, TRUE); }
23 int ProcessKillFlag(BOOL bSleep = TRUE);
25 private:
27 BOOL m_bUseCallback;
28 APE_PROGRESS_CALLBACK m_CallbackFunction;
30 int *m_pPercentageDone;
32 int m_nTotalSteps;
33 int m_nCurrentStep;
34 int m_nLastCallbackFiredPercentageDone;
36 int *m_pKillFlag;
39 #endif // #ifndef APE_MACPROGRESSHELPER_H