1 /* $Id: search.h,v 1.19 2003/05/09 17:43:47 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 keepDialogs
,
15 void DoReplaceMultiFileDlog(WindowInfo
*window
);
16 void UpdateReplaceActionButtons(WindowInfo
* window
);
17 void DoFindDlog(WindowInfo
*window
, int direction
, int keepDialogs
, Time time
);
18 int SearchAndSelect(WindowInfo
*window
, int direction
, const char *searchString
,
19 int searchType
, int searchWrap
);
20 int SearchAndSelectSame(WindowInfo
*window
, int direction
, int searchWrap
);
21 int SearchAndSelectIncremental(WindowInfo
*window
, int direction
,
22 const char *searchString
, int searchType
, int searchWrap
, int continued
);
23 void SearchForSelected(WindowInfo
*window
, int direction
, int searchWrap
,
24 int searchType
, Time time
);
25 int SearchAndReplace(WindowInfo
*window
, int direction
, const char *searchString
,
26 const char *replaceString
, int searchType
, int searchWrap
);
27 int ReplaceAndSearch(WindowInfo
*window
, int direction
, const char *searchString
,
28 const char *replaceString
, int searchType
, int searchWrap
);
29 int ReplaceFindSame(WindowInfo
*window
, int direction
, int searchWrap
);
30 int ReplaceSame(WindowInfo
*window
, int direction
, int searchWrap
);
31 int ReplaceAll(WindowInfo
*window
, const char *searchString
, const char *replaceString
,
33 int ReplaceInSelection(WindowInfo
*window
, const char *searchString
,
34 const char *replaceString
, int searchType
);
35 int SearchWindow(WindowInfo
*window
, int direction
, const char *searchString
,
36 int searchType
, int searchWrap
, int beginPos
, int *startPos
, int *endPos
,
37 int *extentBW
, int* extentFW
);
38 int SearchString(const char *string
, const char *searchString
, int direction
,
39 int searchType
, int wrap
, int beginPos
, int *startPos
, int *endPos
,
40 int *searchExtentBW
, int*searchExtentFW
, const char *delimiters
);
41 char *ReplaceAllInString(char *inString
, const char *searchString
,
42 const char *replaceString
, int searchType
, int *copyStart
,
43 int *copyEnd
, int *replacementLength
, const char *delimiters
);
44 void BeginISearch(WindowInfo
*window
, int direction
);
45 void EndISearch(WindowInfo
*window
);
46 void SetISearchTextCallbacks(WindowInfo
*window
);
47 void FlashMatching(WindowInfo
*window
, Widget textW
);
48 void SelectToMatchingCharacter(WindowInfo
*window
);
49 void GotoMatchingCharacter(WindowInfo
*window
);
50 void RemoveFromMultiReplaceDialog(WindowInfo
*window
);
53 ** Schwarzenberg: added SEARCH_LITERAL_WORD .. SEARCH_REGEX_NOCASE
55 ** The order of the integers in this enumeration must be exactly
56 ** the same as the order of the coressponding strings of the
57 ** array SearchMethodStrings defined in preferences.c (!!)
61 SEARCH_LITERAL
, SEARCH_CASE_SENSE
, SEARCH_REGEX
,
62 SEARCH_LITERAL_WORD
, SEARCH_CASE_SENSE_WORD
, SEARCH_REGEX_NOCASE
,
63 N_SEARCH_TYPES
/* must be last in enum SearchType */ };
66 /* Scope on which the replace operations apply */
67 enum ReplaceScope
{ REPL_SCOPE_WIN
, REPL_SCOPE_SEL
, REPL_SCOPE_MULTI
};
69 /* Default scope if selection exists when replace dialog pops up.
70 "Smart" means "In Selection" if the selection spans more than
71 one line; "In Window" otherwise. */
72 enum ReplaceAllDefaultScope
{ REPL_DEF_SCOPE_WINDOW
,
73 REPL_DEF_SCOPE_SELECTION
,
74 REPL_DEF_SCOPE_SMART
};
78 ** Returns a pointer to the string describing the search type for search
79 ** action routine parameters (see menu.c for processing of action routines)
80 ** If searchType is invalid defaultRV is returned.
82 const char *SearchTypeArg(int searchType
, const char * defaultRV
);
85 ** Parses a search type description string. If the string contains a valid
86 ** search type description, returns TRUE and writes the corresponding
87 ** SearchType in searchType. Returns FALSE and leaves searchType untouched
90 int StringToSearchType(const char * string
, int *searchType
);
93 ** History of search actions.
97 #endif /* NEDIT_SEARCH_H_INCLUDED */