482504: Bad CapsLock grab on certain keyboard configurations
[nedit.git] / source / search.h
blob131f365db748655de98f21149edf21a65e15c8fd
1 /* $Id: search.h,v 1.14 2001/11/13 11:10:24 amai Exp $ */
4 enum SearchDirection {SEARCH_FORWARD, SEARCH_BACKWARD};
6 void DoFindReplaceDlog(WindowInfo *window, int direction, int searchType,
7 int keepDialogs, Time time);
8 void DoReplaceMultiFileDlog(WindowInfo *window);
9 void UpdateReplaceActionButtons(WindowInfo* window);
10 void DoFindDlog(WindowInfo *window, int direction, int searchType,
11 int keepDialogs, Time time);
12 int SearchAndSelect(WindowInfo *window, int direction, const char *searchString,
13 int searchType, int searchWrap);
14 int SearchAndSelectSame(WindowInfo *window, int direction, int searchWrap);
15 int SearchAndSelectIncremental(WindowInfo *window, int direction,
16 const char *searchString, int searchType, int searchWrap, int continued);
17 void SearchForSelected(WindowInfo *window, int direction, int searchWrap,
18 int searchType, Time time);
19 int SearchAndReplace(WindowInfo *window, int direction, const char *searchString,
20 const char *replaceString, int searchType, int searchWrap);
21 int ReplaceAndSearch(WindowInfo *window, int direction, const char *searchString,
22 const char *replaceString, int searchType, int searchWrap);
23 int ReplaceFindSame(WindowInfo *window, int direction, int searchWrap);
24 int ReplaceSame(WindowInfo *window, int direction, int searchWrap);
25 int ReplaceAll(WindowInfo *window, const char *searchString, const char *replaceString,
26 int searchType);
27 int ReplaceInSelection(WindowInfo *window, const char *searchString,
28 const char *replaceString, int searchType);
29 int SearchWindow(WindowInfo *window, int direction, const char *searchString,
30 int searchType, int searchWrap, int beginPos, int *startPos, int *endPos, int *extent);
31 int SearchString(const char *string, const char *searchString, int direction,
32 int searchType, int wrap, int beginPos, int *startPos, int *endPos,
33 int *searchExtent, const char *delimiters);
34 char *ReplaceAllInString(char *inString, const char *searchString,
35 const char *replaceString, int searchType, int *copyStart,
36 int *copyEnd, int *replacementLength, const char *delimiters);
37 void BeginISearch(WindowInfo *window, int direction);
38 void EndISearch(WindowInfo *window);
39 void SetISearchTextCallbacks(WindowInfo *window);
40 void FlashMatching(WindowInfo *window, Widget textW);
41 void SelectToMatchingCharacter(WindowInfo *window);
42 void GotoMatchingCharacter(WindowInfo *window);
43 void RemoveFromMultiReplaceDialog(WindowInfo *window);
46 ** Schwarzenberg: added SEARCH_LITERAL_WORD .. SEARCH_REGEX_NOCASE
48 ** The order of the integers in this enumeration must be exactly
49 ** the same as the order of the coressponding strings of the
50 ** array SearchMethodStrings defined in preferences.c (!!)
53 enum SearchType {
54 SEARCH_LITERAL, SEARCH_CASE_SENSE, SEARCH_REGEX,
55 SEARCH_LITERAL_WORD, SEARCH_CASE_SENSE_WORD, SEARCH_REGEX_NOCASE };
57 ** Definitions for the search method strings, used as arguments for
58 ** macro search subroutines and search action routines
60 #define SEARCH_LITERAL_STRING "literal"
61 #define SEARCH_CASE_SENSE_STRING "case"
62 #define SEARCH_LITERAL_WORD_STRING "word"
63 #define SEARCH_CASE_SENSE_WORD_STRING "caseWord"
64 #define SEARCH_REGEX_STRING "regex"
65 #define SEARCH_REGEX_NOCASE_STRING "regexNoCase"
67 #ifdef REPLACE_SCOPE
68 /* Scope on which the replace operations apply */
69 enum ReplaceScope { REPL_SCOPE_WIN, REPL_SCOPE_SEL, REPL_SCOPE_MULTI };
71 /* Default scope if selection exists when replace dialog pops up.
72 "Smart" means "In Selection" if the selection spans more than
73 one line; "In Window" otherwise. */
74 enum ReplaceAllDefaultScope { REPL_DEF_SCOPE_WINDOW,
75 REPL_DEF_SCOPE_SELECTION,
76 REPL_DEF_SCOPE_SMART };
77 #endif
80 ** Returns a pointer to the string describing the search type for search
81 ** action routine parameters (see menu.c for processing of action routines)
82 ** If searchType is invalid defaultRV is returned.
84 const char *SearchTypeArg(int searchType, const char * defaultRV);
86 /*
87 ** Parses a search type description string. If the string contains a valid
88 ** search type description, returns TRUE and writes the corresponding
89 ** SearchType in searchType. Returns FALSE and leaves searchType untouched
90 ** otherwise.
92 int StringToSearchType(const char * string, int *searchType);