A UNO dispatch command that sets search parameters for text documents
Topics
About: UNO (Universal Network Objects)
About: LibreOffice
About: Apache OpenOffice
About: Writer
The table of contents of this article
Starting Context
- The reader has knowledge of what 'UNO dispatch command' is and how to call one (if the URL and the arguments of the command are clear).
Target Context
- The reader will know the specifications of the UNO dispatch command.
Orientation
There are some articles that explain how to execute any UNO dispatch commands and get the whole available information from the execution, in Java, in C++, in C#, in Python, and in LibreOffice or Apache OpenOffice Basic.
There are the list for the application foundations, the list for Writer, and the list for Calc of the UNO dispatch commands listed so far in this series.
Main Body
1: The Specifications
URL: .uno:SearchOff
Description: This command sets search parameters for text documents. In fact, this command is meant to be called when the search-replace dialog is being closed, storing the parameters on the dialog.
Arguments (the types are UNO datum types):
Name | Type | Value |
---|---|---|
SearchItem.StyleFamily | short | Seems not be used |
SearchItem.CellType | short | Seems not be used |
SearchItem.RowDirection | boolean | Seems not be used |
SearchItem.AllTables | boolean | Seems not be used |
SearchItem.SearchFiltered | boolean | Seems not be used |
SearchItem.Backward | boolean | Whether the search is performed backward: true -> performed backward, false -> performed forward |
SearchItem.Pattern | boolean | Whether the search is a paragraph styles search or not: true -> a paragraph styles search, false -> a strings search |
SearchItem.Content | boolean | Seems not be used |
SearchItem.AsianOptions | boolean | Whether the search is performed for 'sounds-like' strings in Japanese or not: true -> performed for 'sounds-like' strings, false -> not performed for 'sounds-like' strings |
SearchItem.AlgorithmType | short | The strings search algorithm: 0 -> plain text search, 1 -> regular expression search, 2 -> similarity search |
SearchItem.SearchFlags | long | The sum of these flags: 16 -> search for only words that wholly match the search expression, 2048 -> search only the selected words, 4096 -> seems not be used, 65536 -> for similarity search (Weighted Levenshtein Distance search), relax the similarity criteria ("the search is also successful if the combined pool for insertions and deletions is below a doubled calculated limit and replacements are treated differently; additionally, swapped characters are counted as one replacement" according to the reference document, whatever that means); refer to this for more information, especially about '65536'. |
SearchItem.SearchString | string | The search expression (plain string, regular expression, or paragraph style name) |
SearchItem.ReplaceString | string | The replace expression (replacing string or replacing paragraph style name) |
SearchItem.Locale | com.sun.star.lang.Locale | The locale used in case insensitive search (refer to this) |
SearchItem.ChangedChars | long | The allowed number of changed characters for being judged to be similar |
SearchItem.DeletedChars | long | The allowed number of deleted characters for being judged to be similar |
SearchItem.InsertedChars | long | The allowed number of inserted characters for being judged to be similar |
SearchItem.TransliterateFlags | long | The sum of language-specific flags: 256 -> ignore the cases, 1024 -> ignore the character widths, 1073741824 -> ignore diacritics, etc. (too many to be cited here: refer to this and this for more). |
SearchItem.Command | short | The execution type: 0 -> find the next occurrence, 1 -> find all the occurrences, 2 -> replace the current occurrence and find the next occurrence, 3 -> replace all the occurrences |
SearchItem.SearchStartPointX | long | The find-next-occurence search starting position X coordinate in twips (the value '0' together with 'SearchItem.SearchStartPointY' '0' means that no starting position is specified, meaning that the search is performed from the current cursor) |
SearchItem.SearchStartPointY | long | The find-next-occurence search starting position Y coordinate in twips (the value '0' together with 'SearchItem.SearchStartPointX' '0' means that no starting position is specified, meaning that the search is performed from the current cursor) |
SearchItem.SearchFormatted | boolean | Seems not be used |
SearchItem.AlgorithmType2 | short | Seems not be used |
The related information (the value of com.sun.star.frame.FeatureStateEvent.State) (the types are UNO datum types):
Type | Value |
---|---|
N/A | void |
The result information (the value of com.sun.star.frame.DispatchResultEvent.Result) (the type is a UNO datum type):
Type | Value |
---|---|
N/A | void |
<The previous article in this series | The table of contents of this series | The next article in this series>