OSDN Git Service

Update TranslationsStatus.*
[winmerge-jp/winmerge-jp.git] / Src / heksedit.h
1 /*\r
2 Frhed - Free hex editor\r
3 Copyright (C) 2000 Raihan Kibria\r
4 \r
5 This program is free software; you can redistribute it and/or modify it under\r
6 the terms of the GNU General Public License, version 2, as published by\r
7 the Free Software Foundation.\r
8 \r
9 This program is distributed in the hope that it will be useful,\r
10 but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
11 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
12 for more details.\r
13 \r
14 You should have received a copy of the GNU General Public License\r
15 along with this program; see the file COPYING.  If not, write to the Free\r
16 Software Foundation, 59 Temple Place - Suite 330, Boston, MA\r
17 02111-1307, USA.\r
18 \r
19 Last change: 2017-06-18 by Jochen Neubeck\r
20 */\r
21 /** \r
22  * @file  heksedit.h\r
23  *\r
24  * @brief Interface definition for the hekseditor window.\r
25  *\r
26  */\r
27 #ifndef _HEKSEDIT_H_\r
28 #define _HEKSEDIT_H_\r
29 \r
30 #ifndef HEKSEDIT_INTERFACE_VERSION\r
31 #define HEKSEDIT_INTERFACE_VERSION 2\r
32 #define const(x) x\r
33 #endif\r
34 \r
35 /**\r
36  * @brief Interface for the Hexeditor window.\r
37  * @note This file is published to hosting applications. Do not add global declarations.\r
38  */\r
39 class IHexEditorWindow\r
40 {\r
41 public:\r
42         /**\r
43          * @brief Byte endians.\r
44          */\r
45         enum BYTE_ENDIAN\r
46         {\r
47                 ENDIAN_LITTLE, /**< Little endian used e.g. in Intel processors. */\r
48                 ENDIAN_BIG /**< Big endian used e.g. in Motorola processors. */\r
49         };\r
50 \r
51         struct Colors\r
52         {\r
53                 COLORREF iTextColorValue, iBkColorValue, iSepColorValue;\r
54                 COLORREF iSelBkColorValue, iSelTextColorValue;\r
55                 COLORREF iBmkColor;\r
56                 COLORREF iDiffBkColorValue, iDiffTextColorValue, iSelDiffBkColorValue, iSelDiffTextColorValue;\r
57         };\r
58 \r
59         /** @brief Frhed settings. */\r
60         struct Settings\r
61         {\r
62                 int iBytesPerLine; /**< How many bytes in one line in hex view. */\r
63                 int iAutomaticBPL; /**< Add max amount of bytes that fit to view. */\r
64                 BYTE_ENDIAN iBinaryMode; /**< Binary mode, little/big endian. */\r
65                 int bReadOnly; /**< Is editor in read-only mode? */\r
66                 int bSaveIni; /**< Save INI file when required. */\r
67                 int iFontSize;\r
68                 int iCharacterSet; /**< Use OEM or ANSI character set? */\r
69                 int iMinOffsetLen; /**< Minimum numbers used in offset. */\r
70                 int iMaxOffsetLen; /**< Maximum numbers used in offset. */\r
71                 int bAutoOffsetLen; /**< Determine offset length automatically. */\r
72                 int bCenterCaret;\r
73                 int iFontZoom;\r
74         };\r
75 \r
76         struct Status\r
77         {\r
78                 int iFileChanged;\r
79                 int const(iEnteringMode);\r
80                 int const(iCurByte);\r
81                 int const(iCurNibble);\r
82                 int const(iVscrollMax);\r
83                 int const(iVscrollPos);\r
84                 int const(iHscrollMax);\r
85                 int const(iHscrollPos);\r
86                 int const(bSelected);\r
87                 int const(iStartOfSelection);\r
88                 int const(iEndOfSelection);\r
89         };\r
90 \r
91         struct SharedUndoRecords;\r
92 \r
93         virtual unsigned STDMETHODCALLTYPE get_interface_version() = 0;\r
94         virtual unsigned char *STDMETHODCALLTYPE get_buffer(int) = 0;\r
95         virtual int STDMETHODCALLTYPE get_length() = 0;\r
96         virtual void STDMETHODCALLTYPE set_sibling(IHexEditorWindow *) = 0;\r
97         virtual Colors *STDMETHODCALLTYPE get_colors() = 0;\r
98         virtual Settings *STDMETHODCALLTYPE get_settings() = 0;\r
99         virtual Status *STDMETHODCALLTYPE get_status() = 0;\r
100         virtual void STDMETHODCALLTYPE resize_window() = 0;\r
101         virtual void STDMETHODCALLTYPE repaint(int from, int to) = 0;\r
102         virtual void STDMETHODCALLTYPE adjust_hscrollbar() = 0;\r
103         virtual void STDMETHODCALLTYPE adjust_vscrollbar() = 0;\r
104         virtual int STDMETHODCALLTYPE translate_accelerator(MSG *) = 0;\r
105         virtual void STDMETHODCALLTYPE CMD_find() = 0;\r
106         virtual void STDMETHODCALLTYPE CMD_findprev() = 0;\r
107         virtual void STDMETHODCALLTYPE CMD_findnext() = 0;\r
108         virtual void STDMETHODCALLTYPE CMD_replace() = 0;\r
109         virtual void STDMETHODCALLTYPE CMD_edit_cut() = 0;\r
110         virtual void STDMETHODCALLTYPE CMD_edit_copy() = 0;\r
111         virtual void STDMETHODCALLTYPE CMD_edit_paste() = 0;\r
112         virtual void STDMETHODCALLTYPE CMD_edit_clear() = 0;\r
113         virtual BOOL STDMETHODCALLTYPE select_next_diff(BOOL bFromStart) = 0;\r
114         virtual BOOL STDMETHODCALLTYPE select_prev_diff(BOOL bFromEnd) = 0;\r
115         virtual BOOL STDMETHODCALLTYPE load_lang(LANGID langid, LPCWSTR langdir = NULL) = 0;\r
116         virtual void STDMETHODCALLTYPE CMD_zoom(int) = 0;\r
117         virtual void STDMETHODCALLTYPE CMD_select_all() = 0;\r
118 #if HEKSEDIT_INTERFACE_VERSION < 2\r
119 private:\r
120 #endif\r
121         virtual void STDMETHODCALLTYPE copy_sel_from(IHexEditorWindow *) = 0;\r
122         virtual void STDMETHODCALLTYPE copy_all_from(IHexEditorWindow *) = 0;\r
123         virtual void STDMETHODCALLTYPE CMD_edit_undo() = 0;\r
124         virtual void STDMETHODCALLTYPE CMD_edit_redo() = 0;\r
125         virtual BOOL STDMETHODCALLTYPE can_undo() const = 0;\r
126         virtual BOOL STDMETHODCALLTYPE can_redo() const = 0;\r
127         virtual void STDMETHODCALLTYPE set_savepoint() = 0;\r
128         virtual void STDMETHODCALLTYPE clear_undorecords() = 0;\r
129         virtual SharedUndoRecords *STDMETHODCALLTYPE share_undorecords(SharedUndoRecords *) = 0;\r
130         virtual void STDMETHODCALLTYPE set_sibling2(IHexEditorWindow *, IHexEditorWindow *) = 0;\r
131         virtual void STDMETHODCALLTYPE CMD_view_settings() = 0;\r
132         virtual void STDMETHODCALLTYPE CMD_binarymode() = 0;\r
133         virtual void STDMETHODCALLTYPE CMD_character_set() = 0;\r
134         virtual void STDMETHODCALLTYPE read_ini_data(TCHAR *key = 0) = 0;\r
135 };\r
136 \r
137 #undef const\r
138 \r
139 #endif // _HEKSEDIT_H_\r