Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 199 lines (164 sloc) 5.531 kb
eba3580 @djs Initial commit - Notepad2 4.1.24
authored
1 /******************************************************************************
2 *
3 *
4 * Notepad2
5 *
6 * Edit.h
7 * Text File Editing Helper Stuff
8 *
9 * See Readme.txt for more information about this source code.
10 * Please send me your comments to this work.
11 *
12 * See License.txt for details about distribution and modification.
13 *
14 * (c) Florian Balmer 1996-2010
15 * florian.balmer@gmail.com
16 * http://www.flos-freeware.ch
17 *
18 *
19 ******************************************************************************/
20
21
22
23 // extern "C" declarations of Scintilla functions
24 BOOL Scintilla_RegisterClasses(HINSTANCE);
25 BOOL Scintilla_ReleaseResources();
26
27
28 typedef struct _editfindreplace
29 {
30 char szFind[512];
31 char szReplace[512];
32 char szFindUTF8[3*512];
33 char szReplaceUTF8[3*512];
34 UINT fuFlags;
35 BOOL bTransformBS;
36 BOOL bObsolete /* was bFindUp */;
37 BOOL bFindClose;
38 BOOL bReplaceClose;
39 BOOL bNoFindWrap;
40 HWND hwnd;
41 //HANDLE hMRUFind;
42 //HANDLE hMRUReplace;
43
44 } EDITFINDREPLACE, *LPEDITFINDREPLACE, *LPCEDITFINDREPLACE;
45
46
47 #define IDMSG_SWITCHTOFIND 204
48 #define IDMSG_SWITCHTOREPLACE 205
49
50
51 #define SORT_ASCENDING 0
52 #define SORT_DESCENDING 1
53 #define SORT_UNIQ 2
54 #define SORT_LOGICAL 4
55
56
57 HWND EditCreate(HWND);
58 void EditSetNewText(HWND,char*,DWORD);
59 BOOL EditConvertText(HWND,UINT,UINT,BOOL);
60 BOOL EditSetNewEncoding(HWND,int,int,BOOL,BOOL);
61 char* EditGetClipboardText(HWND);
62 BOOL EditCopyAppend(HWND);
63 int EditDetectEOLMode(HWND,char*,DWORD);
64 BOOL EditLoadFile(HWND,LPCWSTR,BOOL,int*,int*,BOOL*,BOOL*);
65 BOOL EditSaveFile(HWND,LPCWSTR,int,BOOL*,BOOL);
66
67 void EditMakeUppercase(HWND);
68 void EditMakeLowercase(HWND);
69 void EditInvertCase(HWND);
70 void EditTitleCase(HWND);
71 void EditSentenceCase(HWND);
72
73 void EditURLEncode(HWND);
74 void EditURLDecode(HWND);
75 void EditEscapeCChars(HWND);
76 void EditUnescapeCChars(HWND);
77 void EditModifyNumber(HWND,BOOL);
78
79 void EditTabsToSpaces(HWND,int,BOOL);
80 void EditSpacesToTabs(HWND,int,BOOL);
81
82 void EditMoveUp(HWND);
83 void EditMoveDown(HWND);
84 void EditModifyLines(HWND,LPCWSTR,LPCWSTR);
85 void EditEncloseSelection(HWND,LPCWSTR,LPCWSTR);
86 void EditToggleLineComments(HWND,LPCWSTR,BOOL);
87 void EditPadWithSpaces(HWND);
88 void EditStripFirstCharacter(HWND);
89 void EditStripLastCharacter(HWND);
90 void EditStripTrailingBlanks(HWND,BOOL);
91 void EditCompressSpaces(HWND);
92 void EditRemoveBlankLines(HWND);
93 void EditWrapToColumn(HWND,int);
94 void EditJoinLinesEx(HWND);
95 void EditSortLines(HWND,int);
96
97 void EditJumpTo(HWND,int,int);
98 void EditSelectEx(HWND,int,int);
99 void EditGetExcerpt(HWND,LPWSTR,DWORD);
100
101 HWND EditFindReplaceDlg(HWND,LPCEDITFINDREPLACE,BOOL);
102 BOOL EditFindNext(HWND,LPCEDITFINDREPLACE,BOOL);
103 BOOL EditFindPrev(HWND,LPCEDITFINDREPLACE,BOOL);
104 BOOL EditReplace(HWND,LPCEDITFINDREPLACE);
105 BOOL EditReplaceAll(HWND,LPCEDITFINDREPLACE,BOOL);
106 BOOL EditReplaceAllInSelection(HWND,LPCEDITFINDREPLACE,BOOL);
107 BOOL EditLinenumDlg(HWND);
108 BOOL EditModifyLinesDlg(HWND,LPWSTR,LPWSTR);
109 BOOL EditEncloseSelectionDlg(HWND,LPWSTR,LPWSTR);
110 BOOL EditInsertTagDlg(HWND,LPWSTR,LPWSTR);
111 BOOL EditSortDlg(HWND,int*);
112 BOOL EditPrint(HWND,LPCWSTR,LPCWSTR);
113 void EditPrintSetup(HWND);
114 void EditPrintInit();
115
116 #define NCP_DEFAULT 1
117 #define NCP_UTF8 2
118 #define NCP_UTF8_SIGN 4
119 #define NCP_UNICODE 8
120 #define NCP_UNICODE_REVERSE 16
121 #define NCP_UNICODE_BOM 32
122 #define NCP_8BIT 64
123 #define NCP_INTERNAL (NCP_DEFAULT|NCP_UTF8|NCP_UTF8_SIGN|NCP_UNICODE|NCP_UNICODE_REVERSE|NCP_UNICODE_BOM)
124 #define NCP_RECODE 128
125 #define CPI_NONE -1
126 #define CPI_DEFAULT 0
127 #define CPI_OEM 1
128 #define CPI_UNICODEBOM 2
129 #define CPI_UNICODEBEBOM 3
130 #define CPI_UNICODE 4
131 #define CPI_UNICODEBE 5
132 #define CPI_UTF8 6
133 #define CPI_UTF8SIGN 7
134 #define CPI_UTF7 8
135
136 #define IDS_ENCODINGNAME0 61000
137 #define IDS_EOLMODENAME0 62000
138
139 typedef struct _np2encoding {
140 UINT uFlags;
141 UINT uCodePage;
142 char* pszParseNames;
143 int idsName;
144 WCHAR wchLabel[32];
145 } NP2ENCODING;
146
147 void Encoding_InitDefaults();
148 int Encoding_MapIniSetting(BOOL,int);
149 void Encoding_GetLabel(int);
150 int Encoding_MatchW(LPCWSTR);
151 int Encoding_MatchA(char*);
152 BOOL Encoding_IsValid(int);
153 void Encoding_AddToListView(HWND,int,BOOL);
154 BOOL Encoding_GetFromListView(HWND,int *);
155 void Encoding_AddToComboboxEx(HWND,int,BOOL);
156 BOOL Encoding_GetFromComboboxEx(HWND,int *);
157
158 BOOL IsUnicode(const char*,int,LPBOOL,LPBOOL);
159 BOOL IsUTF8(const char*,int);
160 BOOL IsUTF7(const char*,int);
161
162
163 //void SciInitThemes(HWND);
164 //LRESULT CALLBACK SciThemedWndProc(HWND,UINT,WPARAM,LPARAM);
165
166
167 #define FV_TABWIDTH 1
168 #define FV_INDENTWIDTH 2
169 #define FV_TABSASSPACES 4
170 #define FV_LONGLINESLIMIT 8
171 #define FV_ENCODING 16
172 #define FV_MODE 32
173
174 typedef struct _filevars {
175
176 int mask;
177 int iTabWidth;
178 int iIndentWidth;
179 BOOL bTabsAsSpaces;
180 int iLongLinesLimit;
181 char tchEncoding[32];
182 int iEncoding;
183 char tchMode[32];
184
185 } FILEVARS, *LPFILEVARS;
186
187 BOOL FileVars_Init(char*,DWORD,LPFILEVARS);
188 BOOL FileVars_Apply(HWND,LPFILEVARS);
189 BOOL FileVars_ParseInt(char*,char*,int*);
190 BOOL FileVars_ParseStr(char*,char*,char*,int);
191 BOOL FileVars_IsUTF8(LPFILEVARS);
192 BOOL FileVars_IsNonUTF8(LPFILEVARS);
193 BOOL FileVars_IsValidEncoding(LPFILEVARS);
194 int FileVars_GetEncoding(LPFILEVARS);
195
196
197
198 /// End of Edit.h \\\
Something went wrong with that request. Please try again.