File: MACProgressHelper.h

package info (click to toggle)
libjmac-java 1.74-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,780 kB
  • sloc: java: 9,279; cpp: 4,375; xml: 369; makefile: 31; sh: 12
file content (37 lines) | stat: -rw-r--r-- 1,086 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef APE_MACPROGRESSHELPER_H
#define APE_MACPROGRESSHELPER_H

#define KILL_FLAG_CONTINUE          0
#define KILL_FLAG_PAUSE             -1
#define KILL_FLAG_STOP              1

typedef void (__stdcall * APE_PROGRESS_CALLBACK) (int);

class CMACProgressHelper  
{
public:
    
    CMACProgressHelper(int nTotalSteps, int *pPercentageDone, APE_PROGRESS_CALLBACK ProgressCallback, int *pKillFlag);
    virtual ~CMACProgressHelper();

    void UpdateProgress(int nCurrentStep = -1, BOOL bForceUpdate = FALSE);
    void UpdateProgressComplete() { UpdateProgress(m_nTotalSteps, TRUE); }

    int ProcessKillFlag(BOOL bSleep = TRUE);
    
private:

    BOOL                    m_bUseCallback;
    APE_PROGRESS_CALLBACK    m_CallbackFunction;
    
    int                        *m_pPercentageDone;

    int                        m_nTotalSteps;
    int                        m_nCurrentStep;
    int                        m_nLastCallbackFiredPercentageDone;

    int                        *m_pKillFlag;
};

#endif // #ifndef APE_MACPROGRESSHELPER_H