C# Class Kimono.KFind

Inheritance: Qyoto.QObject, IDisposable
ファイルを表示 Open project: 0xd34df00d/Qross

Public Methods

Method Description
CloseFindNextDialog ( ) : void Close the "find next?" dialog. The application should do this when the last match was hit. If the application deletes the KFind, then "find previous" won't be possible anymore. IMPORTANT: you should also call this if you are using a non-modal find dialog, to tell KFind not to pop up its own dialog.
Dispose ( ) : void
Find ( ) : KFind.Result Walk the text fragment (e.g. text-processor line, kspread cell) looking for matches. For each match, emits the highlight() signal and displays the find-again dialog proceeding.
Find ( string text, Qyoto.QRegExp pattern, int index, long options, int &matchedlength ) : int
Find ( string text, string pattern, int index, long options, int &matchedlength ) : int Search the given string, and returns whether a match was found. If one is, the length of the string matched is also returned. A performance optimised version of the function is provided for use with regular expressions. name="text" The string to search. name="pattern" The pattern to look for. name="index" The starting index into the string. name="options" The options to use. name="matchedlength" The length of the string that was matched
FindNextDialog ( ) : Kimono.KDialog
FindNextDialog ( bool create ) : Kimono.KDialog Return (or create) the dialog that shows the "find next?" prompt. Usually you don't need to call this. One case where it can be useful, is when the user selects the "Find" menu item while a find operation is under way. In that case, the program may want to call setActiveWindow() on that dialog.
Index ( ) : int
KFind ( string pattern, long options, QWidget parent ) : System Only use this constructor if you don't use KFindDialog, or if you use it as a modal dialog.
KFind ( string pattern, long options, QWidget parent, QWidget findDialog ) : System This is the recommended constructor if you also use KFindDialog (non-modal). You should pass the pointer to it here, so that when a message box appears it has the right parent. Don't worry about deletion, KFind will notice if the find dialog is closed.
NeedData ( ) : bool
NumMatches ( ) : int Return the number of matches found (i.e. the number of times the highlight signal was emitted). If 0, can be used in a dialog box to tell the user "no match was found". The final dialog does so already, unless you used setDisplayFinalDialog(false).
Pattern ( ) : string
SetData ( int id, string data ) : void
SetData ( int id, string data, int startPos ) : void Call this when needData returns true, before calling find(). The use of ID's is especially useful if you're using the FindIncremental option. name="id" the id of the text fragment name="data" the text fragment (line) name="startPos" if set, the index at which the search should start. This is only necessary for the very first call to setData usually, for the 'find in selection' feature. A value of -1 (the default value) means "process all the data", i.e. either 0 or data.length()-1 depending on FindBackwards.
SetData ( string data ) : void
SetData ( string data, int startPos ) : void Call this when needData returns true, before calling find(). name="data" the text fragment (line) name="startPos" if set, the index at which the search should start. This is only necessary for the very first call to setData usually, for the 'find in selection' feature. A value of -1 (the default value) means "process all the data", i.e. either 0 or data.length()-1 depending on FindBackwards.
SetPattern ( string pattern ) : void Change the pattern we're looking for
options ( ) : long Return the current options. Warning: this is usually the same value as the one passed to the constructor, but options might change _during_ the replace operation: e.g. the "All" button resets the PromptOnReplace flag.

Protected Methods

Method Description
CreateProxy ( ) : void
DialogsParent ( ) : QWidget
KFind ( Type dummy ) : System
ParentWidget ( ) : QWidget

Private Methods

Method Description
DisplayFinalDialog ( ) : void
KFind ( ) : System
ResetCounts ( ) : void
SetOptions ( long options ) : void
ShouldRestart ( ) : bool
ShouldRestart ( bool forceAsking ) : bool
ShouldRestart ( bool forceAsking, bool showNumMatches ) : bool
ValidateMatch ( string text, int index, int matchedlength ) : bool

Method Details

CloseFindNextDialog() public method

Close the "find next?" dialog. The application should do this when the last match was hit. If the application deletes the KFind, then "find previous" won't be possible anymore. IMPORTANT: you should also call this if you are using a non-modal find dialog, to tell KFind not to pop up its own dialog.
public CloseFindNextDialog ( ) : void
return void

CreateProxy() protected method

protected CreateProxy ( ) : void
return void

DialogsParent() protected method

protected DialogsParent ( ) : QWidget
return Qyoto.QWidget

Dispose() public method

public Dispose ( ) : void
return void

Find() public method

Walk the text fragment (e.g. text-processor line, kspread cell) looking for matches. For each match, emits the highlight() signal and displays the find-again dialog proceeding.
public Find ( ) : KFind.Result
return KFind.Result

Find() public static method

public static Find ( string text, Qyoto.QRegExp pattern, int index, long options, int &matchedlength ) : int
text string
pattern Qyoto.QRegExp
index int
options long
matchedlength int
return int

Find() public static method

Search the given string, and returns whether a match was found. If one is, the length of the string matched is also returned. A performance optimised version of the function is provided for use with regular expressions. name="text" The string to search. name="pattern" The pattern to look for. name="index" The starting index into the string. name="options" The options to use. name="matchedlength" The length of the string that was matched
public static Find ( string text, string pattern, int index, long options, int &matchedlength ) : int
text string
pattern string
index int
options long
matchedlength int
return int

FindNextDialog() public method

public FindNextDialog ( ) : Kimono.KDialog
return Kimono.KDialog

FindNextDialog() public method

Return (or create) the dialog that shows the "find next?" prompt. Usually you don't need to call this. One case where it can be useful, is when the user selects the "Find" menu item while a find operation is under way. In that case, the program may want to call setActiveWindow() on that dialog.
public FindNextDialog ( bool create ) : Kimono.KDialog
create bool
return Kimono.KDialog

Index() public method

public Index ( ) : int
return int

KFind() protected method

protected KFind ( Type dummy ) : System
dummy System.Type
return System

KFind() public method

Only use this constructor if you don't use KFindDialog, or if you use it as a modal dialog.
public KFind ( string pattern, long options, QWidget parent ) : System
pattern string
options long
parent Qyoto.QWidget
return System

KFind() public method

This is the recommended constructor if you also use KFindDialog (non-modal). You should pass the pointer to it here, so that when a message box appears it has the right parent. Don't worry about deletion, KFind will notice if the find dialog is closed.
public KFind ( string pattern, long options, QWidget parent, QWidget findDialog ) : System
pattern string
options long
parent Qyoto.QWidget
findDialog Qyoto.QWidget
return System

NeedData() public method

public NeedData ( ) : bool
return bool

NumMatches() public method

Return the number of matches found (i.e. the number of times the highlight signal was emitted). If 0, can be used in a dialog box to tell the user "no match was found". The final dialog does so already, unless you used setDisplayFinalDialog(false).
public NumMatches ( ) : int
return int

ParentWidget() protected method

protected ParentWidget ( ) : QWidget
return Qyoto.QWidget

Pattern() public method

public Pattern ( ) : string
return string

SetData() public method

public SetData ( int id, string data ) : void
id int
data string
return void

SetData() public method

Call this when needData returns true, before calling find(). The use of ID's is especially useful if you're using the FindIncremental option. name="id" the id of the text fragment name="data" the text fragment (line) name="startPos" if set, the index at which the search should start. This is only necessary for the very first call to setData usually, for the 'find in selection' feature. A value of -1 (the default value) means "process all the data", i.e. either 0 or data.length()-1 depending on FindBackwards.
public SetData ( int id, string data, int startPos ) : void
id int
data string
startPos int
return void

SetData() public method

public SetData ( string data ) : void
data string
return void

SetData() public method

Call this when needData returns true, before calling find(). name="data" the text fragment (line) name="startPos" if set, the index at which the search should start. This is only necessary for the very first call to setData usually, for the 'find in selection' feature. A value of -1 (the default value) means "process all the data", i.e. either 0 or data.length()-1 depending on FindBackwards.
public SetData ( string data, int startPos ) : void
data string
startPos int
return void

SetPattern() public method

Change the pattern we're looking for
public SetPattern ( string pattern ) : void
pattern string
return void

options() public method

Return the current options. Warning: this is usually the same value as the one passed to the constructor, but options might change _during_ the replace operation: e.g. the "All" button resets the PromptOnReplace flag.
public options ( ) : long
return long