C# Класс Kimono.KFind

Наследование: Qyoto.QObject, IDisposable
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
CreateProxy ( ) : void
DialogsParent ( ) : QWidget
KFind ( Type dummy ) : System
ParentWidget ( ) : QWidget

Приватные методы

Метод Описание
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

Описание методов

CloseFindNextDialog() публичный Метод

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
Результат void

CreateProxy() защищенный Метод

protected CreateProxy ( ) : void
Результат void

DialogsParent() защищенный Метод

protected DialogsParent ( ) : QWidget
Результат Qyoto.QWidget

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Find() публичный Метод

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
Результат KFind.Result

Find() публичный статический Метод

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
Результат int

Find() публичный статический Метод

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
Результат int

FindNextDialog() публичный Метод

public FindNextDialog ( ) : Kimono.KDialog
Результат Kimono.KDialog

FindNextDialog() публичный Метод

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
Результат Kimono.KDialog

Index() публичный Метод

public Index ( ) : int
Результат int

KFind() защищенный Метод

protected KFind ( Type dummy ) : System
dummy System.Type
Результат System

KFind() публичный Метод

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
Результат System

KFind() публичный Метод

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
Результат System

NeedData() публичный Метод

public NeedData ( ) : bool
Результат bool

NumMatches() публичный Метод

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
Результат int

ParentWidget() защищенный Метод

protected ParentWidget ( ) : QWidget
Результат Qyoto.QWidget

Pattern() публичный Метод

public Pattern ( ) : string
Результат string

SetData() публичный Метод

public SetData ( int id, string data ) : void
id int
data string
Результат void

SetData() публичный Метод

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
Результат void

SetData() публичный Метод

public SetData ( string data ) : void
data string
Результат void

SetData() публичный Метод

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
Результат void

SetPattern() публичный Метод

Change the pattern we're looking for
public SetPattern ( string pattern ) : void
pattern string
Результат void

options() публичный Метод

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
Результат long