Skip to content

Commit 1675000

Browse files
authored
Update FindOnPage.md with experimental find options/
Updated MIDL3 Documentation with API promotion to experimental changes and renames
1 parent d1299fc commit 1675000

File tree

1 file changed

+64
-62
lines changed

1 file changed

+64
-62
lines changed

FindOnPage.md

+64-62
Original file line numberDiff line numberDiff line change
@@ -489,106 +489,108 @@ namespace Microsoft.Web.WebView2.Core
489489
CoreWebView2FindOptions CreateFindOptions();
490490
};
491491

492-
runtimeclass CoreWebView2FindOptions : [default]ICoreWebView2FindOptions {}
492+
runtimeclass CoreWebView2FindOptions : [default]ICoreWebView2FindOptions {}
493493

494-
/// Interface defining the Find options.
495-
/// This interface provides the necessary methods and properties to configure a Find operation.
496-
[com_interface("staging=ICoreWebView2FindOptions")]
494+
/// Interface defining the find options.
495+
/// This interface provides the necessary methods and properties to configure a find session.
496+
[com_interface("experimental=ICoreWebView2ExperimentalFindOptions")]
497497
[ms_owner("core", "[email protected]")]
498-
[availability("staging")]
499-
interface ICoreWebView2FindOptions
498+
[availability("experimental")]
499+
interface ICoreWebView2FindOptions
500500
{
501-
/// Gets or sets the Find term used for the Find operation. Returns the Find term.
501+
/// Gets or sets the word or phrase to be searched in the current page.
502+
/// You can set `FindTerm` to any text you want to find on the page.
503+
/// This will take effect the next time you call the `StartAsync()` method.
502504
String FindTerm { get; set; };
503505

504-
/// Determines if the Find operation is case sensitive. Returns TRUE if the Find is case sensitive, FALSE otherwise.
505-
/// The locale used to determine case sensitivity is the document's language specified by the HTML lang attribute. If unspecified then the WebView2's UI locale
506-
/// typically provides a default handling approach, while the document's language settings (e.g., specified using the HTML lang attribute) can override these defaults to apply locale-specific rules. This dual consideration
506+
/// Determines if the find session is case sensitive. Returns TRUE if the find is case sensitive, FALSE otherwise.
507+
/// When toggling case sensitivity, the behavior can vary by locale, which may be influenced by both the browser's UI locale and the document's language settings. The browser's UI locale
508+
/// typically provides a default handling approach, while the document's language settings (e.g., specified using the HTML lang attribute) can override these defaults to apply locale-specific rules. This dual consideration
507509
/// ensures that text is processed in a manner consistent with user expectations and the linguistic context of the content.
508510
Boolean IsCaseSensitive { get; set; };
509511

510-
/// Similar to case sensitivity, word matching also can vary by locale, which may be influenced by both the browser's UI locale and the document's language settings. The browser's UI locale
511-
/// typically provides a default handling approach, while the document's language settings (e.g., specified using the HTML lang attribute) can override these defaults to apply locale-specific rules. This dual consideration
512+
/// Similar to case sensitivity, word matching also can vary by locale, which may be influenced by both the browser's UI locale and the document's language settings. The browser's UI locale
513+
/// typically provides a default handling approach, while the document's language settings (e.g., specified using the HTML lang attribute) can override these defaults to apply locale-specific rules. This dual consideration
512514
/// ensures that text is processed in a manner consistent with user expectations and the linguistic context of the content.
513-
/// ShouldMatchWord determines if only whole words should be matched during the Find operation. Returns TRUE if only whole words should be matched, FALSE otherwise.
515+
/// ShouldMatchWord determines if only whole words should be matched during the find session. Returns TRUE if only whole words should be matched, FALSE otherwise.
514516
Boolean ShouldMatchWord { get; set; };
515-
516-
/// Gets or sets the state of whether all matches are highlighted.
517+
518+
/// Gets or sets the state of whether all matches are highlighted.
517519
/// Returns TRUE if all matches are highlighted, FALSE otherwise.
518-
/// Note: Changes to this property take effect only when StartFind is called.
519-
/// Preferences for the session cannot be updated unless another call to the StartFind function on the server-side is made.
520+
/// Note: Changes to this property take effect only when StartAsync, FindNext, or FindPrevious is called.
521+
/// Preferences for the session cannot be updated unless another call to the StartAsync function on the server-side is made.
520522
/// Therefore, changes will not take effect until one of these functions is called.
521523
Boolean ShouldHighlightAllMatches { get; set; };
522-
523-
/// Sets this property to hide the default Find UI.
524-
/// You can use this to hide the default UI so that you can show your own custom UI or programmatically interact with the Find API while showing no Find UI.
524+
525+
/// Sets this property to hide the default Find UI.
526+
/// You can use this to hide the default UI so that you can show your own custom UI or programmatically interact with the Find API while showing no Find UI.
525527
/// Returns TRUE if hiding the default Find UI and FALSE if using showing the default Find UI.
526-
/// Note: Changes to this property take effect only when StartFind, FindNext, or FindPrevious is called.
527-
/// Preferences for the session cannot be updated unless another call to the StartFind function on the server-side is made.
528+
/// Note: Changes to this property take effect only when StartAsync, FindNext, or FindPrevious is called.
529+
/// Preferences for the session cannot be updated unless another call to the StartAsync function on the server-side is made.
528530
/// Therefore, changes will not take effect until one of these functions is called.
529531
Boolean SuppressDefaultFindDialog { get; set; };
530532
};
531-
533+
532534
runtimeclass CoreWebView2Find : [default]ICoreWebView2Find {}
533535

534-
/// Interface providing methods and properties for finding and navigating through text in the WebView2.
535-
/// This interface allows for finding text, navigation between matches, and customization of the Find UI.
536-
[com_interface("staging=ICoreWebView2StagingFind")]
536+
/// Interface providing methods and properties for finding and navigating through text in the web view.
537+
/// This interface allows for finding text, navigation between matches, and customization of the find UI.
538+
[com_interface("experimental=ICoreWebView2ExperimentalFind")]
537539
[ms_owner("core", "[email protected]")]
538-
[availability("staging")]
539-
interface ICoreWebView2Find
540+
[availability("experimental")]
541+
interface ICoreWebView2Find
540542
{
541-
[completed_handler("")]
542-
/// Initiates a Find session using the specified options asynchronously.
543-
/// Displays the Find bar and starts the Find operation. If a Find session was already ongoing, it will be stopped and replaced with this new instance.
544-
/// If called with an empty string, the Find bar is displayed but no finding occurs. Changing the Find options object after initiation won't affect the ongoing Find session.
545-
/// To change the ongoing Find session, StartAsync must be called again with a new or modified Find options object.
546-
/// StartAsync supports, HTML, PDF, and TXT document queries. In general this api is designed for text based Find sessions.
547-
//// If you start a Find session programmatically on another file format that doesnt have text fields, the Find session will show the find UI but not find any matches.
548-
/// StartAsync Completion: The asynchronous action completes when the UI has been displayed with the Find term in the UI bar, and the matches have populated on the counter on the Find bar.
549-
/// There may be a slight latency between the UI display and the matches populating in the counter.
550-
/// The MatchCountChanged and ActiveMatchIndexChanged events are only raised after StartAsync has completed, otherwise they will have their default values (-1 for ActiveMatchIndex and 0 for TotalMatchCount).
551-
/// However, calling StartFind again during an ongoing Find operation does not resume from the point
552-
/// of the current active match. For example, given the text "1 1 A 1 1" and initiating a Find session for "A",
553-
/// then starting another Find session for "1", it will start searching from the beginning of the document,
554-
/// regardless of the previous active match. This behavior indicates that changing the Find query initiates a
555-
/// completely new Find session, rather than continuing from the previous match index. This distinction is essential
556-
/// to understand when utilizing the StartFind method for navigating through text matches.
543+
/// Initiates a find using the specified find options asynchronously.
544+
/// Displays the Find bar and starts the find session. If a find session was already ongoing, it will be stopped and replaced with this new instance.
545+
/// If called with an empty string, the Find bar is displayed but no finding occurs. Changing the FindOptions object after initiation won't affect the ongoing find session.
546+
/// To change the ongoing find session, StartAsync must be called again with a new or modified FindOptions object.
547+
/// StartAsync supports HTML and TXT document queries. In general, this API is designed for text-based find sessions.
548+
/// If you start a find session programmatically on another file format that doesn't have text fields, the find session will try to execute but will fail to find any matches. (It will silently fail)
549+
/// Note: The asynchronous action completes when the UI has been displayed with the find term in the UI bar, and the matches have populated on the counter on the find bar.
550+
/// There may be a slight latency between the UI display and the matches populating in the counter.
551+
/// The MatchCountChanged and ActiveMatchIndexChanged events are only raised after StartAsync has completed; otherwise, they will have their default values (-1 for active match index and 0 for match count).
552+
/// To start a new find session (beginning the search from the first match), call `Stop` before invoking `StartAsync`.
553+
/// If `StartAsync` is called consecutively with the same options and without calling `Stop`, the find session
554+
/// will continue from the current position in the existing session.
555+
/// Calling `StartAsync` without altering its parameters will behave either as `FindNext` or `FindPrevious`, depending on the most recent search action performed.
556+
/// StartAsync will default to forward if neither have been called.
557+
/// However, calling Start again during an ongoing find session does not resume from the point
558+
/// of the current active match. For example, given the text "1 1 A 1 1" and initiating a find session for "A",
559+
/// then starting another find session for "1", it will start searching from the beginning of the document,
560+
/// regardless of the previous active match. This behavior indicates that changing the find query initiates a
561+
/// completely new find session, rather than continuing from the previous match index.
557562
Windows.Foundation.IAsyncAction StartAsync(CoreWebView2FindOptions options);
558563

559-
560564
/// Navigates to the next match in the document.
561-
/// If there are no matches to Find, FindNext will wrap around to the first match.
562-
/// If called when there is no Find session active, FindNext will silently fail.
565+
/// If there are no matches to find, FindNext will wrap around to the first match's index.
566+
/// If called when there is no find session active, FindPrevious will silently fail.
563567
void FindNext();
564-
568+
565569
/// Navigates to the previous match in the document.
566-
/// If there are no matches to Find, FindPrevious will wrap around to the last match.
567-
/// If called when there is no Find session active, FindPrevious will silently fail.
570+
/// If there are no matches to find, FindPrevious will wrap around to the last match's index.
571+
/// If called when there is no find session active, FindPrevious will silently fail.
568572
void FindPrevious();
569573

570-
571-
/// Stops the current 'Find' operation and hides the Find bar.
574+
/// Stops the current 'Find' session and hides the Find bar.
572575
/// If called with no Find session active, it will silently do nothing.
573-
void StopFind();
576+
void Stop();
574577

575-
/// Retrieves the index of the currently active match in the Find session. Returns the index of the currently active match, or -1 if there is no active match.
578+
/// Retrieves the index of the currently active match in the find session. Returns the index of the currently active match, or -1 if there is no active match.
579+
/// The index starts at 1 for the first match.
576580
Int32 ActiveMatchIndex { get; };
577581

578-
/// Gets the total count of matches found in the current document based on the last Find sessions criteria. Returns the total count of matches.
582+
/// Gets the total count of matches found in the current document based on the last find sessions criteria. Returns the total count of matches.
579583
Int32 MatchCount { get; };
580-
581-
/// Registers an event handler for the MatchCountChanged event.
582-
/// This event is raised when the total count of matches in the document changes due to a new Find operation or changes in the document.
584+
585+
/// Registers an event handler for the MatchCountChanged event.
586+
/// This event is raised when the total count of matches in the document changes due to a new find session or changes in the document.
583587
/// The parameter is the event handler to be added. Returns a token representing the added event handler. This token can be used to unregister the event handler.
584-
[event_handler("", "", "")]
585588
event Windows.Foundation.TypedEventHandler<CoreWebView2Find, Object> MatchCountChanged;
586589

587590
/// Registers an event handler for the ActiveMatchIndexChanged event. This event is raised when the index of the currently active match changes.
588-
/// This can happen when the user navigates to a different match or when the active match is changed programmatically.
589-
/// The parameter is the event handler to be added. Returns a token representing the added event handler.
591+
/// This can happen when the user navigates to a different match or when the active match is changed programmatically.
592+
/// The parameter is the event handler to be added. Returns a token representing the added event handler.
590593
/// This token can be used to unregister the event handler.
591-
[event_handler("", "", "")]
592594
event Windows.Foundation.TypedEventHandler<CoreWebView2Find, Object> ActiveMatchIndexChanged;
593595
};
594596

0 commit comments

Comments
 (0)