ReactOS 0.4.15-dev-7788-g1ad9096
notepad.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Notepad
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Providing a Windows-compatible simple text editor for ReactOS
5 * COPYRIGHT: Copyright 1997,98 Marcel Baur <mbaur@g26.ethz.ch>
6 * Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
7 * Copyright 2002 Andriy Palamarchuk
8 * Copyright 2000 Mike McCormack <Mike_McCormack@looksmart.com.au>
9 * Copyright 2020-2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
10 */
11
12#pragma once
13
14#ifndef STRSAFE_NO_DEPRECATE
15 #define STRSAFE_NO_DEPRECATE
16#endif
17
18#include <windef.h>
19#include <winbase.h>
20#include <winuser.h>
21#include <winnls.h>
22#include <wingdi.h>
23#include <shellapi.h>
24#include <commdlg.h>
25#include <tchar.h>
26#include <stdlib.h>
27#include <malloc.h>
28
29#include "dialog.h"
30#include "notepad_res.h"
31
32#define EDIT_STYLE_WRAP (WS_CHILD | WS_VSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL)
33#define EDIT_STYLE (EDIT_STYLE_WRAP | WS_HSCROLL | ES_AUTOHSCROLL)
34#define EDIT_CLASS _T("EDIT")
35
36#define MAX_STRING_LEN 255
37
38/* Values are indexes of the items in the Encoding combobox. */
39typedef enum
40{
48
49#define ENCODING_DEFAULT ENCODING_UTF8 // ENCODING_ANSI
50
51typedef enum
52{
53 EOLN_CRLF = 0, /* "\r\n" */
54 EOLN_LF = 1, /* "\n" */
55 EOLN_CR = 2 /* "\r" */
56} EOLN; /* End of line (NewLine) type */
57
58typedef struct
59{
65 HFONT hFont; /* Font used by the edit control */
72 TCHAR szFindText[MAX_PATH];
73 TCHAR szReplaceText[MAX_PATH];
74 TCHAR szFileName[MAX_PATH];
75 TCHAR szFileTitle[MAX_PATH];
77 RECT lMargins; /* The margin values in 100th millimeters */
78 TCHAR szHeader[MAX_PATH];
79 TCHAR szFooter[MAX_PATH];
80 TCHAR szStatusBarLineCol[MAX_PATH];
81
84
90
92
93BOOL ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, EOLN *piEoln);
94BOOL WriteText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, ENCODING encFile, EOLN iEoln);
95
98
99BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert);
101VOID SetFileName(LPCTSTR szFileName);
VOID NOTEPAD_EnableSearchMenu()
Definition: main.c:20
#define MAX_PATH
Definition: compat.h:34
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
ENCODING
Definition: more.c:492
LPTSTR szFilter
Definition: mplay32.c:30
_In_ HANDLE hFile
Definition: mswsock.h:90
void NOTEPAD_SaveSettingsToRegistry(void)
Definition: settings.c:227
BOOL ReadText(HANDLE hFile, HLOCAL *phLocal, ENCODING *pencFile, EOLN *piEoln)
Definition: text.c:153
void NOTEPAD_LoadSettingsFromRegistry(void)
Definition: settings.c:105
ENCODING
Definition: notepad.h:40
@ ENCODING_AUTO
Definition: notepad.h:41
@ ENCODING_UTF16BE
Definition: notepad.h:44
@ ENCODING_UTF8BOM
Definition: notepad.h:46
@ ENCODING_UTF8
Definition: notepad.h:45
@ ENCODING_UTF16LE
Definition: notepad.h:43
@ ENCODING_ANSI
Definition: notepad.h:42
BOOL WriteText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, ENCODING encFile, EOLN iEoln)
Definition: text.c:395
VOID SetFileName(LPCTSTR szFileName)
Definition: main.c:34
EOLN
Definition: notepad.h:52
@ EOLN_LF
Definition: notepad.h:54
@ EOLN_CR
Definition: notepad.h:55
@ EOLN_CRLF
Definition: notepad.h:53
BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert)
Definition: main.c:132
NOTEPAD_GLOBALS Globals
Definition: clipbrd.c:13
HGLOBAL hDevNames
Definition: notepad.h:68
BOOL bWrapLongLines
Definition: notepad.h:70
BOOL bWasModified
Definition: notepad.h:88
HWND hFindReplaceDlg
Definition: notepad.h:62
HWND hStatusBar
Definition: notepad.h:64
BOOL bShowStatusBar
Definition: notepad.h:71
ENCODING encFile
Definition: notepad.h:82
WNDPROC EditProc
Definition: notepad.h:86
LOGFONT lfFont
Definition: notepad.h:69
HGLOBAL hDevMode
Definition: notepad.h:67
FINDREPLACE find
Definition: notepad.h:85
HMENU hMenu
Definition: notepad.h:66
HINSTANCE hInstance
Definition: notepad.h:60
RECT lMargins
Definition: notepad.h:77
HFONT hFont
Definition: notepad.h:65
HWND hMainWnd
Definition: notepad.h:61
RECT main_rect
Definition: notepad.h:87
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
char TCHAR
Definition: xmlstorage.h:189
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185