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