ETradeClientView.h
2.18 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// ETradeClientView.h : interface of the CETradeClientView class
//
#pragma once
#include <string>
#include <cstdint>
#include "include/internal/cef_ptr.h"
#include "etradeclient/browser/embedded_browser.h"
class MainViewBrowserHandler; // Forward declaration.
class CETradeClientView : public CWnd
{
// Construction
public:
CETradeClientView();
~CETradeClientView();
bool CreateBrowser(const std::string& url);
const EmbeddedBrower& Browser() const;
uint32_t BrowserState() const;
// Overrides
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
// Generated message map functions
protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnClose();
afx_msg void OnUpdateEditCut(CCmdUI *pCmdUI);
afx_msg void OnEditCut();
afx_msg void OnUpdateEditCopy(CCmdUI *pCmdUI);
afx_msg void OnEditCopy();
afx_msg void OnUpdateEditPaste(CCmdUI *pCmdUI);
afx_msg void OnEditPaste();
// Customized CEF message handlers.
afx_msg LRESULT OnBeforeBrowse(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnDownloadUpdate(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnLoadStart(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnLoadEnd(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnTitleChange(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnStateChange(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnAddressChange(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnStatusMessage(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnLoadError(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnNewBrowser(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnCloseBrowser(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnWindowCheck(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnAuthenticate(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnBadCertificate(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
private:
bool IsEditCtrl(CWnd* pWnd); // Check whether current focused windows is edit ctrl.
private:
EmbeddedBrower m_browser;
CefRefPtr<MainViewBrowserHandler> m_browser_handler; // MainViewBrowserHandler implements browser-level callbacks.
uint32_t m_browser_state;
};