1 /* $Id: search.h,v 1.17 2002/07/15 14:11:18 edg Exp $ */
3 #ifndef NEDIT_SEARCH_H_INCLUDED
4 #define NEDIT_SEARCH_H_INCLUDED
8 #include <X11/Intrinsic.h>
11 enum SearchDirection
{SEARCH_FORWARD
, SEARCH_BACKWARD
};
13 void DoFindReplaceDlog(WindowInfo
*window
, int direction
, int searchType
,
14 int keepDialogs
, Time time
);
15 void DoReplaceMultiFileDlog(WindowInfo
*window
);
16 void UpdateReplaceActionButtons(WindowInfo
* window
);
17 void DoFindDlog(WindowInfo
*window
, int direction
, int searchType
,
18 int keepDialogs
, Time time
);
19 int SearchAndSelect(WindowInfo
*window
, int direction
, const char *searchString
,
20 int searchType
, int searchWrap
);
21 int SearchAndSelectSame(WindowInfo
*window
, int direction
, int searchWrap
);
22 int SearchAndSelectIncremental(WindowInfo
*window
, int direction
,
23 const char *searchString
, int searchType
, int searchWrap
, int continued
);
24 void SearchForSelected(WindowInfo
*window
, int direction
, int searchWrap
,
25 int searchType
, Time time
);
26 int SearchAndReplace(WindowInfo
*window
, int direction
, const char *searchString
,
27 const char *replaceString
, int searchType
, int searchWrap
);
28 int ReplaceAndSearch(WindowInfo
*window
, int direction
, const char *searchString
,
29 const char *replaceString
, int searchType
, int searchWrap
);
30 int ReplaceFindSame(WindowInfo
*window
, int direction
, int searchWrap
);
31 int ReplaceSame(WindowInfo
*window
, int direction
, int searchWrap
);
32 int ReplaceAll(WindowInfo
*window
, const char *searchString
, const char *replaceString
,
34 int ReplaceInSelection(WindowInfo
*window
, const char *searchString
,
35 const char *replaceString
, int searchType
);
36 int SearchWindow(WindowInfo
*window
, int direction
, const char *searchString
,
37 int searchType
, int searchWrap
, int beginPos
, int *startPos
, int *endPos
,
38 int *extentBW
, int* extentFW
);
39 int SearchString(const char *string
, const char *searchString
, int direction
,
40 int searchType
, int wrap
, int beginPos
, int *startPos
, int *endPos
,
41 int *searchExtentBW
, int*searchExtentFW
, const char *delimiters
);
42 char *ReplaceAllInString(char *inString
, const char *searchString
,
43 const char *replaceString
, int searchType
, int *copyStart
,
44 int *copyEnd
, int *replacementLength
, const char *delimiters
);
45 void BeginISearch(WindowInfo
*window
, int direction
);
46 void EndISearch(WindowInfo
*window
);
47 void SetISearchTextCallbacks(WindowInfo
*window
);
48 void FlashMatching(WindowInfo
*window
, Widget textW
);
49 void SelectToMatchingCharacter(WindowInfo
*window
);
50 void GotoMatchingCharacter(WindowInfo
*window
);
51 void RemoveFromMultiReplaceDialog(WindowInfo
*window
);
54 ** Schwarzenberg: added SEARCH_LITERAL_WORD .. SEARCH_REGEX_NOCASE
56 ** The order of the integers in this enumeration must be exactly
57 ** the same as the order of the coressponding strings of the
58 ** array SearchMethodStrings defined in preferences.c (!!)
62 SEARCH_LITERAL
, SEARCH_CASE_SENSE
, SEARCH_REGEX
,
63 SEARCH_LITERAL_WORD
, SEARCH_CASE_SENSE_WORD
, SEARCH_REGEX_NOCASE
};
65 ** Definitions for the search method strings, used as arguments for
66 ** macro search subroutines and search action routines
68 #define SEARCH_LITERAL_STRING "literal"
69 #define SEARCH_CASE_SENSE_STRING "case"
70 #define SEARCH_LITERAL_WORD_STRING "word"
71 #define SEARCH_CASE_SENSE_WORD_STRING "caseWord"
72 #define SEARCH_REGEX_STRING "regex"
73 #define SEARCH_REGEX_NOCASE_STRING "regexNoCase"
76 /* Scope on which the replace operations apply */
77 enum ReplaceScope
{ REPL_SCOPE_WIN
, REPL_SCOPE_SEL
, REPL_SCOPE_MULTI
};
79 /* Default scope if selection exists when replace dialog pops up.
80 "Smart" means "In Selection" if the selection spans more than
81 one line; "In Window" otherwise. */
82 enum ReplaceAllDefaultScope
{ REPL_DEF_SCOPE_WINDOW
,
83 REPL_DEF_SCOPE_SELECTION
,
84 REPL_DEF_SCOPE_SMART
};
88 ** Returns a pointer to the string describing the search type for search
89 ** action routine parameters (see menu.c for processing of action routines)
90 ** If searchType is invalid defaultRV is returned.
92 const char *SearchTypeArg(int searchType
, const char * defaultRV
);
95 ** Parses a search type description string. If the string contains a valid
96 ** search type description, returns TRUE and writes the corresponding
97 ** SearchType in searchType. Returns FALSE and leaves searchType untouched
100 int StringToSearchType(const char * string
, int *searchType
);
103 ** History of search actions.
107 #endif /* NEDIT_SEARCH_H_INCLUDED */