OSDN Git Service

Shell Extension for Windows 11 or later (5)
[winmerge-jp/winmerge-jp.git] / Src / SaveClosingDlg.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /**
3  * @file  SaveClosingDlg.h
4  *
5  * @brief Declaration file for SaveClosingDlg dialog
6  */
7 #pragma once
8
9 #include "TrDialogs.h"
10 #include "CMoveConstraint.h"
11 #include "UnicodeString.h"
12
13 /////////////////////////////////////////////////////////////////////////////
14 // SaveClosingDlg dialog
15
16 /**
17  * @brief Dialog asking if user wants to save modified left and/or right
18  * files.
19  *
20  * The dialog has separate frames for both files and unneeded frame and
21  * controls inside it are disabled. Asked file(s) are selected using
22  * DoAskFor() function.
23  */
24 class SaveClosingDlg : public CTrDialog
25 {
26         DECLARE_DYNAMIC(SaveClosingDlg)
27
28 public:
29
30         /** @brief Choices for modified files: save/discard changes. */
31         enum SAVECLOSING_CHOICE
32         {
33                 SAVECLOSING_SAVE = 0, /**< Save changes */
34                 SAVECLOSING_DISCARD,  /**< Discard changes */
35         };
36
37         explicit SaveClosingDlg(CWnd* pParent = nullptr);   // standard constructor
38         void DoAskFor(bool bLeft = false, bool bMiddle = false, bool bRight = false);
39
40 // Dialog Data
41         //{{AFX_DATA(SaveClosingDlg)
42         enum { IDD = IDD_SAVECLOSING };
43         String m_sLeftFile; /**< Path to left-file to save. */
44         String m_sMiddleFile; /**< Path to middle-file to save. */
45         String m_sRightFile; /**< Path to right-side file to save. */
46         int m_leftSave; /**< User's choice for left-side save. */
47         int m_middleSave; /**< User's choice for middle-side save. */
48         int m_rightSave; /**< User's choice for righ-side save. */
49         bool m_bDisableCancel; /**< Should we disable Cancel-button? */
50         //}}AFX_DATA
51
52 protected:
53         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
54
55         // Generated message map functions
56         //{{AFX_MSG(SaveClosingDlg)
57         afx_msg BOOL OnInitDialog() override;
58         afx_msg void OnDiscardAll();
59         //}}AFX_MSG
60         DECLARE_MESSAGE_MAP()
61
62 // Implementation data
63 private:
64         prdlg::CMoveConstraint m_constraint; /**< Resizes dialog controls when dialog resized */
65         bool m_bAskForLeft; /**< Is left file modified? */
66         bool m_bAskForMiddle; /**< Is middle file modified? */
67         bool m_bAskForRight; /**< Is right file modified? */
68 };