OSDN Git Service

Improve plugin system (#797)
[winmerge-jp/winmerge-jp.git] / Src / HexMergeView.h
1 /////////////////////////////////////////////////////////////////////////////
2 //    WinMerge:  an interactive diff/merge utility
3 //    Copyright (C) 1997  Dean P. Grimm
4 //    SPDX-License-Identifier: GPL-2.0-or-later
5 /////////////////////////////////////////////////////////////////////////////
6 /** 
7  * @file  HexMergeView.h
8  *
9  * @brief Declaration of CHexMergeView class
10  */
11 #pragma once
12
13 #include "DiffFileInfo.h"
14 #include "IMergeDoc.h"
15
16 class CHexMergeDoc;
17 class IHexEditorWindow;
18
19 /**
20  * @brief Document class for bytewise merging two files presented as hexdumps
21  */
22 class CHexMergeView : public CView
23 {
24 // Attributes
25 protected:
26         IHexEditorWindow *m_pif;
27 public:
28         int m_nThisPane;
29         DiffFileInfo m_fileInfo;
30 protected: // create from serialization only
31         CHexMergeView();
32         DECLARE_DYNCREATE(CHexMergeView)
33         std::vector<int> m_unpackerSubcodes;
34 public:
35         HRESULT LoadFile(LPCTSTR);
36         HRESULT SaveFile(LPCTSTR, bool packing = true);
37         IHexEditorWindow *GetInterface() const { return m_pif; }
38         BYTE *GetBuffer(int);
39         int GetLength();
40         bool GetModified();
41         void SetSavePoint();
42         void ClearUndoRecords();
43         bool GetReadOnly();
44         void SetReadOnly(bool);
45         void ResizeWindow();
46         IMergeDoc::FileChange IsFileChangedOnDisk(LPCTSTR);
47         void ZoomText(int amount);
48         static void CopySel(const CHexMergeView *src, CHexMergeView *dst);
49         static void CopyAll(const CHexMergeView *src, CHexMergeView *dst);
50         static bool IsLoadable();
51         // Overrides
52 protected:
53         virtual void OnDraw(CDC*);
54         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
55         virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
56         virtual BOOL PreTranslateMessage(MSG *);
57         // ClassWizard generated virtual function overrides
58         //{{AFX_VIRTUAL(CHexMergeView)
59         public:
60         //}}AFX_VIRTUAL
61
62 // Operations
63
64 // Implementation data
65
66 // Generated message map functions
67 protected:
68         //{{AFX_MSG(CHexMergeView)
69         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
70         afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar);
71         afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar);
72     afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
73         afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
74         afx_msg void OnEditFind();
75         afx_msg void OnEditReplace();
76         afx_msg void OnEditRepeat();
77         afx_msg void OnEditUndo();
78         afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
79         afx_msg void OnEditRedo();
80         afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
81         afx_msg void OnEditCut();
82         afx_msg void OnEditCopy();
83         afx_msg void OnEditPaste();
84         afx_msg void OnEditClear();
85         afx_msg void OnEditSelectAll();
86         afx_msg void OnFirstdiff();
87         afx_msg void OnLastdiff();
88         afx_msg void OnNextdiff();
89         afx_msg void OnPrevdiff();
90         afx_msg void OnHelp();
91         //}}AFX_MSG
92         DECLARE_MESSAGE_MAP()
93 };