OSDN Git Service

Update TranslationsStatus.*
[winmerge-jp/winmerge-jp.git] / Src / DirCompProgressBar.h
1 /** 
2  * @file  DirCompProgressBar.h
3  *
4  * @brief Declaration file for Directory compare statusdialog class
5  */
6 #pragma once
7
8 #include "TrDialogs.h"
9 #include "CompareStats.h"
10
11 class ITaskBarList3;
12
13 /////////////////////////////////////////////////////////////////////////////
14 // DirCompProgressBar dialog
15
16 /**
17  * @brief Class for directory compare statusdialog.
18  * 
19  * Implements non-modal dialog directory compares. We create this
20  * modeless dialog when we start the compare and destroy it after
21  * compare is ready. Dialog itself shows counts of total found items
22  * and items compared so far. And nice progressbar for user to have some
23  * idea how compare is going.
24  *
25  * Status updates are fired by periodic timer events. We have shared
26  * datastructure with compare code. Compare code updates status information
27  * to datastructure during compare. When timer event fires, dialog reads
28  * that datastructure and updates the GUI.
29  * 
30  * @todo Now we update total count of items with same timer than we update
31  * compared items count. Maybe we should use different timer and bigger
32  * interval for total count updates?
33  */
34 class DirCompProgressBar : public CTrDialogBar
35 {
36 // Construction
37 public:
38         DirCompProgressBar();   // standard constructor
39         ~DirCompProgressBar();
40         BOOL Create(CWnd* pParentWnd);
41         void SetCompareStat(CompareStats * pCompareStats);
42         void StartUpdating();
43         void EndUpdating();
44         void SetPaused(bool paused);
45
46 // Dialog Data
47         //{{AFX_DATA(DirCompProgressBar)
48         enum { IDD = IDD_DIRCOMP_PROGRESS };
49         //}}AFX_DATA
50
51 // Implementation
52 protected:
53         void ClearStat();
54         void SetProgressState(int comparedItems, int totalItems);
55
56         // Generated message map functions
57         //{{AFX_MSG(DirCompProgressBar)
58         afx_msg void OnTimer(UINT_PTR nIDEvent);
59         //}}AFX_MSG
60         DECLARE_MESSAGE_MAP()
61
62 private:
63         CompareStats *m_pCompareStats; /**< Pointer to comparestats */
64         CompareStats::CMP_STATE m_prevState; /**< Previous state for compare (to track changes) */
65         bool m_bCompareReady; /**< Compare ready, waiting for closing? */
66 #ifdef __ITaskbarList3_INTERFACE_DEFINED__
67         ITaskbarList3 *m_pTaskbarList;
68 #endif
69 };
70
71 /**
72  * @brief Set pointer to compare stats.
73  * @param [in] pCompareStats Pointer to stats.
74  */
75 inline void DirCompProgressBar::SetCompareStat(CompareStats * pCompareStats)
76 {
77         m_pCompareStats = pCompareStats;
78 }
79