24#ifndef _SCOL_EMBEDDED_WEB_NAVIGATOR_MANAGER_
25#define _SCOL_EMBEDDED_WEB_NAVIGATOR_MANAGER_
29#if SO3_WEB_NAVIGATOR_BUILD == 1
30#include "include/cef_base.h"
31#include "include/cef_app.h"
33#include <boost/asio.hpp>
35#include <shared_mutex>
39 namespace EmbeddedWebNavigator
43 public CefBrowserProcessHandler
52 const ScolWindowHandle scolMainWindowHandle;
55 unsigned long nextUniqueId;
56 HANDLE synchroEventSetCookie;
57 HANDLE synchroEventDeleteCookie;
59 bool bContextInitialized;
60 std::string sCachePath;
108 WebNavigator*
CreateNavigator(const ScolWindowHandle& parentWindowHandle,
int xPosition,
int yPosition,
int width,
int height, std::
string url);
113 WebNavigator*
CreateNavigator(const ScolWindowHandle& parentWindowHandle,
int width,
int height, std::
string url,
bool transparency = false);
135 bool SetCookie(const std::
string& url, const std::
string& name, const std::
string& value, const std::
string& domain, const std::
string& path, const
bool& secure, const
bool& httponly);
144 bool DeleteCookies(const std::
string& url, const std::
string& cookie_name);
169 void InvokeAddressChange(
unsigned long uniqueId, const std::
string& frameName, const std::
string& url);
179 void InvokeTooltip(
unsigned long uniqueId, std::
string& text);
194 void InvokeConsoleMessage(
unsigned long uniqueId, const std::
string& message, const std::
string& source,
int line);
199 void InvokeBeforePopup(
unsigned long uniqueId,
int popupX,
int popupY,
int popupWidth,
int popupHeight, std::
string popupUrl);
209 void InvokeLoadStart(
unsigned long uniqueId, const std::
string& frameName);
214 void InvokeLoadEnd(
unsigned long uniqueId, const std::
string& frameName,
int httpStatusCode);
219 void InvokeLoadError(
unsigned long uniqueId, const std::
string& frameName,
int errorCode, const std::
string& failedUrl, std::
string& errorText);
224 void InvokeFindResult(
unsigned long uniqueId,
int identifier,
int count, const CefRect& selectionRect,
int activeMatchOrdinal,
bool finalUpdate);
boost::asio::io_service mainThreadWebMessageQueue
void InvokeStatusMessage(unsigned long uniqueId, const std::string &value)
bool DeleteCookies(const std::string &url, const std::string &cookie_name)
void InvokeRunModal(unsigned long uniqueId)
static WebNavigatorManager * GetSingletonPtr()
void InvokeTooltip(unsigned long uniqueId, std::string &text)
static void DestroyManager()
std::map< unsigned long, WebNavigator * > WebNavigatorList
void InvokeNavStateChange(unsigned long uniqueId, bool canGoBack, bool canGoForward)
void InvokeConsoleMessage(unsigned long uniqueId, const std::string &message, const std::string &source, int line)
void InvokeExternalCall(unsigned long uniqueId, SScriptFunction functionCalled)
void InvokeLoadEnd(unsigned long uniqueId, const std::string &frameName, int httpStatusCode)
void InvokeLoadError(unsigned long uniqueId, const std::string &frameName, int errorCode, const std::string &failedUrl, std::string &errorText)
virtual void OnContextInitialized() OVERRIDE
static WebNavigatorManager & GetSingleton()
void DestroyNavigator(WebNavigator *webNavigator)
virtual CefRefPtr< CefBrowserProcessHandler > GetBrowserProcessHandler() OVERRIDE
WebNavigator * CreateNavigator(const ScolWindowHandle &parentWindowHandle, int xPosition, int yPosition, int width, int height, std::string url)
void InvokeCursorChange(unsigned long uniqueId, HCURSOR newCursor)
void InvokeExternalCallStr(unsigned long uniqueId, SScriptFunction functionCalled)
void InvokeTitleChange(unsigned long uniqueId, const std::string &title)
WebNavigator * GetNavigator(unsigned long uniqueId)
void InvokeFindResult(unsigned long uniqueId, int identifier, int count, const CefRect &selectionRect, int activeMatchOrdinal, bool finalUpdate)
void InvokeLoadStart(unsigned long uniqueId, const std::string &frameName)
bool SetCookie(const std::string &url, const std::string &name, const std::string &value, const std::string &domain, const std::string &path, const bool &secure, const bool &httponly)
void InvokeBeforePopup(unsigned long uniqueId, int popupX, int popupY, int popupWidth, int popupHeight, std::string popupUrl)
std::shared_mutex webMessageQueueCriticalSection
void InvokeAddressChange(unsigned long uniqueId, const std::string &frameName, const std::string &url)