Skip to content

Commit 1deeffe

Browse files
committed
Merge branch 'api-status-bar-activity-draft' of github.com:MicrosoftEdge/WebView2Feedback into api-status-bar-activity-draft
Made changes to reflect feedback on PR
2 parents 8407150 + 04a4c68 commit 1deeffe

1 file changed

Lines changed: 51 additions & 12 deletions

File tree

specs/StatusBarActivity.md

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ Developers will be able to:
2727
CHECK_FAILURE(m_webView->add_StatusBarShowing(
2828
Callback<ICoreWebView2StatusBarShowingEventHandler>(
2929
[this](ICoreWebView2* sender, ICoreWebView2StatusBarShowingEventArgs* args) -> HRESULT {
30-
std::string message;
31-
CHECK_FAILURE(args->get_message(&message));
30+
31+
LPWSTR value;
32+
CHECK_FAILURE(args->get_value(&value));
3233
33-
// Handle status bar text in message
34+
// Handle status bar text in value
3435
3536
return S_OK;
3637
}
@@ -50,15 +51,15 @@ CHECK_FAILURE(m_webView->add_StatusBarHiding(
5051
).Get(),
5152
&m_statusBarHiding));
5253
```
53-
## C#/ .Net/ WinRT Registering a listener for status bar showing
54+
## .NET / WinRT Registering a listener for status bar showing
5455
```
5556
webView.CoreWebView2.StatusBarShowing += (object sender, CoreWebView2StatusBarShowingEventArgs arg) =>
5657
{
57-
string message = args.message;
58-
// Handle status bar text in message
58+
string value = args.value;
59+
// Handle status bar text in value
5960
};
6061
```
61-
## C#/ .Net/ WinRT Registering a listener for status bar hiding
62+
## .Net/ WinRT Registering a listener for status bar hiding
6263
```
6364
webView.CoreWebView2.StatusBarHiding += (object sender) =>
6465
{
@@ -70,10 +71,17 @@ See [API Details](#api-details) Section below for API reference
7071
# API Details
7172
## Win32 C++
7273
```
74+
/*
75+
Interface for the statusbar showing event args
76+
The value property contains the status bar text
77+
*/
78+
[uuid(56acdbb8-ceac-11eb-b8bc-0242ac130003), object, pointer_default(unique)]
7379
interface ICoreWebView2StatusBarShowingEventArgs : IUnknown {
74-
[propget] HRESULT Message([out, retval] LPWSTR* value);
80+
[propget] HRESULT Value([out, retval] LPWSTR* value);
7581
}
76-
82+
83+
// Interface for the status bar showing event handler
84+
[uuid(85c8b75a-ceac-11eb-b8bc-0242ac130003), object, pointer_default(unique)]
7785
interface ICoreWebView2StatusBarShowingEventHandler : IUnknown {
7886
/// Called to provide the implementer with the event args for the
7987
/// corresponding event.
@@ -82,31 +90,62 @@ interface ICoreWebView2StatusBarShowingEventHandler : IUnknown {
8290
[in] ICoreWebView2StatusBarShowingEventArgs* args);
8391
}
8492
93+
// Interface for the status bar hiding event handler
94+
[uuid(96880fd2-ceac-11eb-b8bc-0242ac130003), object, pointer_default(unique)]
8595
interface ICoreWebView2StatusBarHidingEventHandler : IUnknown {
8696
/// Called to provide the implementer with the event args for the
8797
/// corresponding event.
8898
HRESULT Invoke(
8999
[in] ICoreWebView2* sender);
90100
}
101+
102+
[uuid(b2c01782-ceaf-11eb-b8bc-0242ac130003), object, pointer_default(unique)]
103+
interface ICoreWebView2_5 : ICoreWebView2_4 {
104+
/// Add an event handler for the `StatusBarShowing` event.
105+
/// `StatusBarShowing` runs when the WebView is showing a message in the
106+
/// status bar
107+
HRESULT add_StatusBarShowing(
108+
[in] ICoreWebView2StatusBarShowingEventHandler* eventHandler,
109+
[out] EventRegistrationToken* token);
110+
111+
/// Add an event handler for the `StatusBarHiding` event.
112+
/// `StatusBarHiding` runs when the WebView is hiding the status bar
113+
HRESULT add_StatusBarHiding(
114+
[in] ICoreWebView2StatusBarHidingEventHandler* eventHandler,
115+
[out] EventRegistrationToken* token);
116+
117+
/// Removing the event handler for `StatusBarShowing` event
118+
HRESULT remove_StatusBarShowing(
119+
[in] EventRegistrationToken token);
120+
121+
/// Removing the event handler for `StatusBarHiding` event
122+
HRESULT remove_StatusBarHiding(
123+
[in] EventRegistrationToken token);
124+
125+
}
91126
```
92127
## .Net/ WinRT
93128
```
94129
namespace Microsoft.Web.WebView2.Core {
130+
/*
131+
Interface for the statusbar showing event args
132+
The value property contains the status bar text
133+
*/
95134
runtimeclass CoreWebView2StatusBarShowingEventArgs {
96-
string message {get;};
135+
string value {get;};
97136
}
98137
138+
// Interface for the status bar showing event handler
99139
runtimeclass CoreWebView2 {
100140
event Windows.Foundation.TypedEventHandler<CoreWebView2, CoreWebView2StatusBarShowingEventArgs> StatusBarShowingEvent;
101141
}
102142
143+
// Interface for the status bar hiding event handler
103144
runtimeclass CoreWebView2 {
104145
event Windows.Foundation.TypedEventHandler<CoreWebView2> StatusBarHidingEvent;
105146
}
106147
}
107148
```
108-
109-
110149
# Appendix
111150
<!-- TEMPLATE
112151
Anything else that you want to write down for posterity, but

0 commit comments

Comments
 (0)