forked from MicrosoftEdge/WebView2Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Toolbar.h
45 lines (37 loc) · 1.01 KB
/
Toolbar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) Microsoft Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include "stdafx.h"
#include <vector>
class AppWindow;
class Toolbar
{
public:
enum Item
{
Item_BackButton,
Item_ForwardButton,
Item_ReloadButton,
Item_CancelButton,
Item_AddressBar,
Item_GoButton,
Item_LAST,
};
Toolbar();
~Toolbar();
void Initialize(AppWindow* appWindow);
void SetItemEnabled(Item item, bool enabled);
void DisableAllItems();
HWND GetItem(Item item) const;
const std::vector<HWND>& GetItems() const;
// Returns remaining available area for the WebView
RECT Resize(RECT availableBounds);
void UpdateDpiAndTextScale();
private:
int GetItemLogicalWidth(Item item, int clientLogicalWidth) const;
void UpdateFont();
AppWindow* m_appWindow = nullptr;
HFONT m_font = nullptr;
std::vector<HWND> m_items;
};