OSDN Git Service

Add WinMergePluginBase.h (2)
[winmerge-jp/winmerge-jp.git] / Src / MergeStatusBar.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  MergeStatusBar.h
8  *
9  * @brief Interface of the CMergeStatusBar class.
10  *
11  */
12 #pragma once
13
14 #include "MergeEditStatus.h"
15 #include "OptionsDiffColors.h"
16 #include "UnicodeString.h"
17
18 class CMergeStatusBar : public CStatusBar
19 {
20 public : 
21         CMergeStatusBar();
22         ~CMergeStatusBar();
23
24         BOOL Create(CWnd* pParentWnd);
25         void Resize(int widths[]);
26         void SetPaneCount(int nPanes) { m_nPanes = nPanes; }
27         void UpdateResources();
28         IMergeEditStatus* GetIMergeEditStatus(int nPane) { return &m_status[nPane]; }
29         void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
30
31 protected:
32         DECLARE_MESSAGE_MAP();
33
34 private:
35         // this dialog uses custom edit boxes
36         int m_nPanes;
37         COLORSETTINGS m_cachedColors;
38         bool m_bDiff[4];
39         unsigned m_dispFlags[4];
40
41 protected:
42         // Object that displays status line info for one side of a merge view
43         class MergeStatus : public IMergeEditStatus
44         {
45         public:
46                 // ctr
47                 MergeStatus();
48                 // Implement MergeEditStatus
49                 void SetLineInfo(LPCTSTR szLine, int nColumn, int nColumns,
50                         int nChar, int nChars, int nSelectedLines, int nSelectedChars, LPCTSTR szEol, int nCodepage, bool bHasBom) override;
51                 void UpdateResources();
52         protected:
53                 void Update();
54         public:
55                 CMergeStatusBar* m_pWndStatusBar;
56                 int m_base; /**< 0 for left, 1 for right */
57         private:
58                 String m_sLine;
59                 int m_nColumn; /**< Current column, tab-expanded */
60                 int m_nColumns; /**< Amount of columns, tab-expanded */
61                 int m_nChar; /**< Current char */
62                 int m_nChars; /**< Amount of chars in line */
63                 int m_nCodepage;
64                 int m_nSelectedLines;
65                 int m_nSelectedChars;
66                 bool m_bHasBom;
67                 String m_sEol;
68                 String m_sEolDisplay;
69                 String m_sCodepageName;
70         };
71         friend class MergeStatus; // MergeStatus accesses status bar
72         MergeStatus m_status[3];
73 };