Skip to content

Commit 172c6ec

Browse files
author
Samuel Qian
committed
Update
1 parent 7b511b8 commit 172c6ec

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

specs/HiddenPdfToolbarItems.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ void SettingsComponent::ToggleHidePdfToolbarButtons()
1919
wil::com_ptr<ICoreWebView2Settings> coreWebView2Settings;
2020
CHECK_FAILURE(webView->get_Settings(&coreWebView2Settings));
2121

22-
COREWEBVIEW2_PDF_TOOLBAR_ITEM hiddenPdfToolbarItems;
22+
COREWEBVIEW2_PDF_TOOLBAR_ITEMS hiddenPdfToolbarItems;
2323
CHECK_FAILURE(coreWebView2Settings->get_HiddenPdfToolbarItems(&hiddenPdfToolbarItems));
2424

25-
if (hiddenPdfToolbarItems == COREWEBVIEW2_PDF_TOOLBAR_ITEM::COREWEBVIEW2_PDF_TOOLBAR_ITEM_NONE)
25+
if (hiddenPdfToolbarItems == COREWEBVIEW2_PDF_TOOLBAR_ITEMS::COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE)
2626
{
2727
CHECK_FAILURE(coreWebView2Settings->put_HiddenPdfToolbarItems(
28-
COREWEBVIEW2_PDF_TOOLBAR_ITEM::COREWEBVIEW2_PDF_TOOLBAR_ITEM_PRINT |
29-
COREWEBVIEW2_PDF_TOOLBAR_ITEM::COREWEBVIEW2_PDF_TOOLBAR_ITEM_SAVE));
28+
COREWEBVIEW2_PDF_TOOLBAR_ITEMS::COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PRINT |
29+
COREWEBVIEW2_PDF_TOOLBAR_ITEMS::COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE));
3030
}
3131
else
3232
{
3333
CHECK_FAILURE(coreWebView2Settings->put_HiddenPdfToolbarItems(
34-
COREWEBVIEW2_PDF_TOOLBAR_ITEM::COREWEBVIEW2_PDF_TOOLBAR_ITEM_NONE));
34+
COREWEBVIEW2_PDF_TOOLBAR_ITEMS::COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE));
3535
}
3636
}
3737
```
@@ -42,13 +42,13 @@ private WebView2 _webView;
4242
void ToggleHidePdfToolbarButtons(object target, ExecutedRoutedEventArgs e)
4343
{
4444
var coreWebView2Settings = _webView.CoreWebView2.Settings;
45-
if(coreWebView2Settings.HiddenPdfToolbarItems.HasFlag(CoreWebView2PdfToolbarItem.Save | CoreWebView2PdfToolbarItem.Print))
45+
if(coreWebView2Settings.HiddenPdfToolbarItems.HasFlag(CoreWebView2PdfToolbarItems.Save | CoreWebView2PdfToolbarItems.Print))
4646
{
47-
WebViewSettings.HiddenPdfToolbarItems = CoreWebView2PdfToolbarItem.None;
47+
WebViewSettings.HiddenPdfToolbarItems = CoreWebView2PdfToolbarItems.None;
4848
}
4949
else
5050
{
51-
WebViewSettings.HiddenPdfToolbarItems = CoreWebView2PdfToolbarItem.Save;
51+
WebViewSettings.HiddenPdfToolbarItems = CoreWebView2PdfToolbarItems.Save;
5252
}
5353
}
5454
```
@@ -61,38 +61,38 @@ See [API Details](#api-details) section below for API reference.
6161
```c#
6262
/// Specifies the PDF toolbar item types used for the `ICoreWebView2StagingSettings::put_HiddenPdfToolbarItems` method.
6363
[v1_enum]
64-
typedef enum COREWEBVIEW2_PDF_TOOLBAR_ITEM {
64+
typedef enum COREWEBVIEW2_PDF_TOOLBAR_ITEMS {
6565

6666
/// No item
6767
68-
COREWEBVIEW2_PDF_TOOLBAR_ITEM_NONE = 0x0,
68+
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE = 0x0,
6969

7070
/// The save button
7171
72-
COREWEBVIEW2_PDF_TOOLBAR_ITEM_SAVE = 0x0001,
72+
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE = 0x0001,
7373

7474
/// The print button
7575
76-
COREWEBVIEW2_PDF_TOOLBAR_ITEM_PRINT = 0x0002,
76+
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_PRINT = 0x0002,
7777

7878
/// The save as button
7979
80-
COREWEBVIEW2_PDF_TOOLBAR_ITEM_SAVE_AS = 0x0004,
80+
COREWEBVIEW2_PDF_TOOLBAR_ITEMS_SAVE_AS = 0x0004,
8181

8282

83-
} COREWEBVIEW2_PDF_TOOLBAR_ITEM;
84-
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(COREWEBVIEW2_PDF_TOOLBAR_ITEM);")
83+
} COREWEBVIEW2_PDF_TOOLBAR_ITEMS;
84+
cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(COREWEBVIEW2_PDF_TOOLBAR_ITEMS);")
8585

8686
[uuid(183e7052-1d03-43a0-ab99-98e043b66b39), object, pointer_default(unique)]
8787
interface ICoreWebView2Settings6 : ICoreWebView2Settings5 {
88-
/// `HiddenPdfToolbarItems` is used to customize the PDF toolbar items. By default, it is COREWEBVIEW2_PDF_TOOLBAR_ITEM_NONE and so it displays all of the items.
88+
/// `HiddenPdfToolbarItems` is used to customize the PDF toolbar items. By default, it is COREWEBVIEW2_PDF_TOOLBAR_ITEMS_NONE and so it displays all of the items.
8989
/// Changes to this property apply to all CoreWebView2s in the same environment and using the same profile.
9090
/// Changes to this setting apply only after the next navigation.
9191
/// \snippet SettingsComponent.cpp ToggleHidePdfToolbarItems
9292
93-
[propget] HRESULT HiddenPdfToolbarItems([out, retval] COREWEBVIEW2_PDF_TOOLBAR_ITEM* hidden_pdf_toolbar_items);
93+
[propget] HRESULT HiddenPdfToolbarItems([out, retval] COREWEBVIEW2_PDF_TOOLBAR_ITEMS* hidden_pdf_toolbar_items);
9494

95-
[propput] HRESULT HiddenPdfToolbarItems([in] COREWEBVIEW2_PDF_TOOLBAR_ITEM hidden_pdf_toolbar_items);
95+
[propput] HRESULT HiddenPdfToolbarItems([in] COREWEBVIEW2_PDF_TOOLBAR_ITEMS hidden_pdf_toolbar_items);
9696
}
9797

9898
```
@@ -107,7 +107,7 @@ namespace Microsoft.Web.WebView2.Core
107107
// Summary:
108108
// Specifies the PDF toolbar item types used for the <see cref="CoreWebView2Settings.HiddenPdfToolbarItems"/>
109109
[Flags]
110-
public enum CoreWebView2PdfToolbarItem
110+
public enum CoreWebView2PdfToolbarItems
111111
{
112112
//
113113
// Summary:
@@ -140,8 +140,8 @@ namespace Microsoft.Web.WebView2.Core
140140
// Used to customize the PDF toolbar items.
141141
//
142142
// Remarks:
143-
// By default, it equal to `CoreWebView2PdfToolbarItem.None` which means displays all of the items.
144-
public CoreWebView2PdfToolbarItem HiddenPdfToolbarItems { get; set; }
143+
// By default, it equal to `CoreWebView2PdfToolbarItems.None` which means displays all of the items.
144+
public CoreWebView2PdfToolbarItems HiddenPdfToolbarItems { get; set; }
145145
}
146146
}
147147
```

0 commit comments

Comments
 (0)