C# Class Kimono.KFind

Inheritance: Qyoto.QObject, IDisposable
Afficher le fichier Open project: 0xd34df00d/Qross

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
CreateProxy ( ) : void
DialogsParent ( ) : QWidget
KFind ( Type dummy ) : System
ParentWidget ( ) : QWidget

Private Methods

Méthode 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 méthode

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
Résultat void

CreateProxy() protected méthode

protected CreateProxy ( ) : void
Résultat void

DialogsParent() protected méthode

protected DialogsParent ( ) : QWidget
Résultat Qyoto.QWidget

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Find() public méthode

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
Résultat KFind.Result

Find() public static méthode

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
Résultat int

Find() public static méthode

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
Résultat int

FindNextDialog() public méthode

public FindNextDialog ( ) : Kimono.KDialog
Résultat Kimono.KDialog

FindNextDialog() public méthode

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
Résultat Kimono.KDialog

Index() public méthode

public Index ( ) : int
Résultat int

KFind() protected méthode

protected KFind ( Type dummy ) : System
dummy System.Type
Résultat System

KFind() public méthode

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
Résultat System

KFind() public méthode

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
Résultat System

NeedData() public méthode

public NeedData ( ) : bool
Résultat bool

NumMatches() public méthode

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
Résultat int

ParentWidget() protected méthode

protected ParentWidget ( ) : QWidget
Résultat Qyoto.QWidget

Pattern() public méthode

public Pattern ( ) : string
Résultat string

SetData() public méthode

public SetData ( int id, string data ) : void
id int
data string
Résultat void

SetData() public méthode

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
Résultat void

SetData() public méthode

public SetData ( string data ) : void
data string
Résultat void

SetData() public méthode

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
Résultat void

SetPattern() public méthode

Change the pattern we're looking for
public SetPattern ( string pattern ) : void
pattern string
Résultat void

options() public méthode

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
Résultat long