OSDN Git Service

Merge with stable
[winmerge-jp/winmerge-jp.git] / Src / PatchDlg.h
1 /////////////////////////////////////////////////////////////////////////////
2 //    License (GPLv2+):
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.
7 //
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.
12 //
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 /////////////////////////////////////////////////////////////////////////////
17 /** 
18  * @file  PatchDlg.h
19  *
20  * @brief Declaration file for patch creation dialog
21  */
22 // ID line follows -- this is updated by SVN
23 // $Id: PatchDlg.h 6783 2009-05-25 06:47:22Z kimmov $
24
25 #if !defined(AFX_PATCHDLG_H__AB3CE671_1328_11D7_B088_005004D9D386__INCLUDED_)
26 #define AFX_PATCHDLG_H__AB3CE671_1328_11D7_B088_005004D9D386__INCLUDED_
27
28 #include "resource.h"
29 #include "SuperComboBox.h"
30 #include "UnicodeString.h"
31
32 struct PATCHFILES;
33
34 /////////////////////////////////////////////////////////////////////////////
35 // PatchDlg dialog
36
37 /** 
38  * @brief Dialog class for Generate Patch -dialog.
39  * This dialog allows user to select files from which to create a patch,
40  * patch file's filename and several options related to patch.
41  */
42 class CPatchDlg : public CDialog
43 {
44 // Construction
45 public:
46         CPatchDlg(CWnd* pParent = NULL);   // standard constructor
47
48         // Functions to add and get selected files (as PATCHFILEs)
49         void AddItem(const PATCHFILES& pf);
50         size_t GetItemCount();
51         const PATCHFILES& GetItemAt(int position);
52         void ClearItems();
53
54 // Dialog Data
55         //{{AFX_DATA(CPatchDlg)
56         enum { IDD = IDD_GENERATE_PATCH };
57         CComboBox m_comboStyle;
58         CSuperComboBox m_comboContext;
59         bool m_caseSensitive;
60         CSuperComboBox m_ctlFile1;
61         CSuperComboBox m_ctlFile2;
62         CSuperComboBox m_ctlResult;
63         String  m_file1;
64         String  m_file2;
65         String  m_fileResult;
66         bool m_ignoreBlanks;
67         bool m_ignoreEOLDifference;
68         int m_whitespaceCompare;
69         bool m_appendFile;
70         bool m_openToEditor;
71         bool m_includeCmdLine;
72         //}}AFX_DATA
73
74         enum output_style m_outputStyle; /**< Patch style (context, unified etc.) */
75         int m_contextLines; /**< How many context lines are added. */
76
77 // Overrides
78         // ClassWizard generated virtual function overrides
79         //{{AFX_VIRTUAL(CPatchDlg)
80         protected:
81         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
82         //}}AFX_VIRTUAL
83
84 // Implementation
85 protected:
86
87         std::vector<PATCHFILES> m_fileList; /**< Source files to create patch from */
88
89         void ChangeFile(const String &sFile, bool bLeft);
90         void UpdateSettings();
91         void LoadSettings();
92         void SaveSettings();
93         void Swap();
94
95         // Generated message map functions
96         //{{AFX_MSG(CPatchDlg)
97         virtual void OnOK();
98         virtual BOOL OnInitDialog();
99         afx_msg void OnDiffBrowseFile1();
100         afx_msg void OnDiffBrowseFile2();
101         afx_msg void OnDiffBrowseResult();
102         afx_msg void OnSelchangeFile1Combo();
103         afx_msg void OnSelchangeFile2Combo();
104         afx_msg void OnSelchangeResultCombo();
105         afx_msg void OnSelchangeDiffStyle();
106         afx_msg void OnDiffSwapFiles();
107         afx_msg void OnDefaultSettings();
108         //}}AFX_MSG
109         DECLARE_MESSAGE_MAP()
110 };
111
112 //{{AFX_INSERT_LOCATION}}
113 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
114
115 #endif // !defined(AFX_PATCHDLG_H__AB3CE671_1328_11D7_B088_005004D9D386__INCLUDED_)