// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. #ifndef _HANDLER_CTOCPP_H #define _HANDLER_CTOCPP_H #ifndef BUILDING_CEF_SHARED #pragma message("Warning: "__FILE__" may be accessed DLL-side only") #else // BUILDING_CEF_SHARED #include "cef.h" #include "cef_capi.h" #include "ctocpp.h" // Wrap a C handler structure with a C++ handler class. // This class may be instantiated and accessed DLL-side only. class CefHandlerCToCpp : public CefCToCpp { public: CefHandlerCToCpp(cef_handler_t* str) : CefCToCpp(str) {} virtual ~CefHandlerCToCpp() {} // CefHandler methods virtual RetVal HandleBeforeCreated(CefRefPtr parentBrowser, CefWindowInfo& windowInfo, bool popup, CefRefPtr& handler, std::wstring& url); virtual RetVal HandleAfterCreated(CefRefPtr browser); virtual RetVal HandleAddressChange(CefRefPtr browser, CefRefPtr frame, const std::wstring& url); virtual RetVal HandleTitleChange(CefRefPtr browser, const std::wstring& title); virtual RetVal HandleBeforeBrowse(CefRefPtr browser, CefRefPtr frame, CefRefPtr request, NavType navType, bool isRedirect); virtual RetVal HandleLoadStart(CefRefPtr browser, CefRefPtr frame); virtual RetVal HandleLoadEnd(CefRefPtr browser, CefRefPtr frame); virtual RetVal HandleLoadError(CefRefPtr browser, CefRefPtr frame, ErrorCode errorCode, const std::wstring& failedUrl, std::wstring& errorText); virtual RetVal HandleBeforeResourceLoad(CefRefPtr browser, CefRefPtr request, std::wstring& redirectUrl, CefRefPtr& resourceStream, std::wstring& mimeType, int loadFlags); virtual RetVal HandleBeforeMenu(CefRefPtr browser, const MenuInfo& menuInfo); virtual RetVal HandleGetMenuLabel(CefRefPtr browser, MenuId menuId, std::wstring& label); virtual RetVal HandleMenuAction(CefRefPtr browser, MenuId menuId); virtual RetVal HandlePrintHeaderFooter(CefRefPtr browser, CefRefPtr frame, CefPrintInfo& printInfo, const std::wstring& url, const std::wstring& title, int currentPage, int maxPages, std::wstring& topLeft, std::wstring& topCenter, std::wstring& topRight, std::wstring& bottomLeft, std::wstring& bottomCenter, std::wstring& bottomRight); virtual RetVal HandleJSAlert(CefRefPtr browser, CefRefPtr frame, const std::wstring& message); virtual RetVal HandleJSConfirm(CefRefPtr browser, CefRefPtr frame, const std::wstring& message, bool& retval); virtual RetVal HandleJSPrompt(CefRefPtr browser, CefRefPtr frame, const std::wstring& message, const std::wstring& default_value, bool& retval, std::wstring& result); virtual RetVal HandleBeforeWindowClose(CefRefPtr browser); virtual RetVal HandleTakeFocus(CefRefPtr browser, bool reverse); virtual RetVal HandleJSBinding(CefRefPtr browser, CefRefPtr frame, CefRefPtr object); }; #endif // BUILDING_CEF_SHARED #endif // _HANDLER_CTOCPP_H