Provide (experimental) clang-format file
[TortoiseGit.git] / src / TortoiseProc / GitProgressDlg.h
blob59189afe3cd8cfa09f2bc72b035fa08a8c997d08
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2017 - TortoiseGit
4 // Copyright (C) 2003-2008 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
22 #include "StandAloneDlg.h"
23 #include "GitProgressList.h"
24 #include "MenuButton.h"
26 /**
27 * \ingroup TortoiseProc
28 * Handles different git commands and shows the notify messages
29 * in a listbox. Since several git commands have similar notify
30 * messages they are grouped together in this single class.
32 class CGitProgressDlg : public CResizableStandAloneDialog
34 public:
36 DECLARE_DYNAMIC(CGitProgressDlg)
38 public:
40 CGitProgressDlg(CWnd* pParent = nullptr);
41 virtual ~CGitProgressDlg();
44 void SetCommand(ProgressCommand* cmd) { m_ProgList.SetCommand(cmd); }
45 void SetOptions(DWORD opts) {m_ProgList.SetOptions(opts);}
47 /**
48 * If the number of items for which the operation is done on is known
49 * beforehand, that number can be set here. It is then used to show a more
50 * accurate progress bar during the operation.
52 void SetItemCount(long count) {if(count) m_ProgList.SetItemCountTotal(count);}
54 bool DidErrorsOccur() {return m_ProgList.m_bErrorsOccurred;}
56 enum { IDD = IDD_SVNPROGRESS };
59 protected:
61 virtual BOOL OnInitDialog() override;
62 virtual void OnCancel() override;
63 virtual BOOL PreTranslateMessage(MSG* pMsg) override;
64 virtual void DoDataExchange(CDataExchange* pDX) override;
66 afx_msg void OnBnClickedLogbutton();
67 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
68 afx_msg void OnClose();
69 afx_msg void OnEnSetfocusInfotext();
70 afx_msg LRESULT OnCtlColorStatic(WPARAM wParam, LPARAM lParam);
71 afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
72 afx_msg LRESULT OnTaskbarBtnCreated(WPARAM wParam, LPARAM lParam);
73 LRESULT OnCmdEnd(WPARAM wParam, LPARAM lParam);
74 LRESULT OnCmdStart(WPARAM wParam, LPARAM lParam);
76 DECLARE_MESSAGE_MAP()
78 private:
79 virtual void OnOK() override;
81 CAnimateCtrl m_Animate;
82 CProgressCtrl m_ProgCtrl;
83 CGitProgressList m_ProgList;
84 CEdit m_InfoCtrl;
85 CStatic m_ProgLableCtrl;
86 CMenuButton m_cMenuButton;
87 PostCmdList m_PostCmdList;
89 CBrush m_background_brush;
90 DWORD m_AutoClose;
92 typedef struct {
93 int id;
94 int cnt;
95 int wmid;
96 } ACCELLERATOR;
97 std::map<TCHAR, ACCELLERATOR> m_accellerators;
98 HACCEL m_hAccel;
99 virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam) override;