1 /////////////////////////////////////////////////////////////////////////////
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful, but
9 // WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 /////////////////////////////////////////////////////////////////////////////
20 * @brief Declaration file for patch creation dialog
25 #include "TrDialogs.h"
26 #include "SuperComboBox.h"
27 #include "UnicodeString.h"
31 /////////////////////////////////////////////////////////////////////////////
35 * @brief Dialog class for Generate Patch -dialog.
36 * This dialog allows user to select files from which to create a patch,
37 * patch file's filename and several options related to patch.
39 class CPatchDlg : public CTrDialog
43 explicit CPatchDlg(CWnd* pParent = nullptr); // standard constructor
45 // Functions to add and get selected files (as PATCHFILEs)
46 void AddItem(const PATCHFILES& pf);
47 size_t GetItemCount();
48 const PATCHFILES& GetItemAt(size_t position);
52 //{{AFX_DATA(CPatchDlg)
53 enum { IDD = IDD_GENERATE_PATCH };
54 CComboBox m_comboStyle;
55 CSuperComboBox m_comboContext;
57 CSuperComboBox m_ctlFile1;
58 CSuperComboBox m_ctlFile2;
59 CSuperComboBox m_ctlResult;
64 bool m_ignoreEOLDifference;
65 int m_whitespaceCompare;
68 bool m_includeCmdLine;
71 enum output_style m_outputStyle; /**< Patch style (context, unified etc.) */
72 int m_contextLines; /**< How many context lines are added. */
73 enum DiffAlgorithm m_diffAlgorithm;
74 bool m_indentHeuristic;
77 // ClassWizard generated virtual function overrides
78 //{{AFX_VIRTUAL(CPatchDlg)
80 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
86 std::vector<PATCHFILES> m_fileList; /**< Source files to create patch from */
88 void UpdateSettings();
93 // Generated message map functions
94 //{{AFX_MSG(CPatchDlg)
95 virtual void OnOK() override;
96 virtual BOOL OnInitDialog() override;
97 afx_msg void OnDiffBrowseFile1();
98 afx_msg void OnDiffBrowseFile2();
99 afx_msg void OnDiffBrowseResult();
100 afx_msg void OnSelchangeDiffStyle();
101 afx_msg void OnDiffSwapFiles();
102 afx_msg void OnDefaultSettings();
104 DECLARE_MESSAGE_MAP()