755e370acf7f79e6d052e9835f6d9ff7fc4a2dd9
[reactos.git] / reactos / subsys / system / notepad / main.h
1 /*
2 * Notepad (notepad.h)
3 *
4 * Copyright 1997,98 Marcel Baur <mbaur@g26.ethz.ch>
5 * Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22 #define SIZEOF(a) sizeof(a)/sizeof((a)[0])
23
24 #include "notepad_res.h"
25
26 #define MAX_STRING_LEN 255
27
28 #define ENCODING_ANSI 0
29 #define ENCODING_UNICODE 1
30 #define ENCODING_UNICODE_BE 2
31 #define ENCODING_UTF8 3
32
33 #define EOLN_CRLF 0
34 #define EOLN_LF 1
35 #define EOLN_CR 2
36
37 typedef struct
38 {
39 HANDLE hInstance;
40 HWND hMainWnd;
41 HWND hFindReplaceDlg;
42 HWND hEdit;
43 HFONT hFont; /* Font used by the edit control */
44 LOGFONT lfFont;
45 BOOL bWrapLongLines;
46 WCHAR szFindText[MAX_PATH];
47 WCHAR szFileName[MAX_PATH];
48 WCHAR szFileTitle[MAX_PATH];
49 WCHAR szFilter[2 * MAX_STRING_LEN + 100];
50 WCHAR szMarginTop[MAX_PATH];
51 WCHAR szMarginBottom[MAX_PATH];
52 WCHAR szMarginLeft[MAX_PATH];
53 WCHAR szMarginRight[MAX_PATH];
54 WCHAR szHeader[MAX_PATH];
55 WCHAR szFooter[MAX_PATH];
56 int iEncoding;
57 int iEoln;
58
59 FINDREPLACE find;
60 } NOTEPAD_GLOBALS;
61
62 extern NOTEPAD_GLOBALS Globals;
63
64 VOID SetFileName(LPCWSTR szFileName);
65
66 /* from text.c */
67 BOOL ReadText(HANDLE hFile, LPWSTR *ppszText, DWORD *pdwTextLen, int *piEncoding, int *piEoln);
68 BOOL WriteText(HANDLE hFile, LPCWSTR pszText, DWORD dwTextLen, int iEncoding, int iEoln);
69
70