Project

General

Profile

SO3Engine
SO3::EmbeddedWebNavigator::WebNavigator Class Reference

#include <SO3EmbeddedWebNavigator.h>

Public Member Functions

 WebNavigator (const unsigned long navigatorUniqueId, const ScolWindowHandle &scolMainWindow, const ScolWindowHandle &parentWindowHandleInstance, int xPosition, int yPosition, int width, int height, std::string url)
 
 WebNavigator (const unsigned long navigatorUniqueId, const ScolWindowHandle &scolMainWindow, const ScolWindowHandle &parentWindowHandleInstance, int width, int height, std::string url, bool transparency)
 
virtual ~WebNavigator ()
 
unsigned long GetUniqueId ()
 
ScolWindowHandle GetParentWindowHandle ()
 
CefRefPtr< WebNavigatorClient > & GetWebNavigatorClient ()
 
void LoadURL (const std::string &url, const std::string &frameName="")
 
void LoadFile (const std::string &file, const std::string &frameName="")
 
void LoadHTML (const std::string &html, const std::string &frameName="")
 
std::string GetURL (const std::string &frameName="")
 
void Undo (const std::string &frameName="")
 
void Redo (const std::string &frameName="")
 
void Cut (const std::string &frameName="")
 
void Copy (const std::string &frameName="")
 
void Paste (const std::string &frameName="")
 
void Delete (const std::string &frameName="")
 
void SelectAll (const std::string &frameName="")
 
void Print (const std::string &frameName="")
 
void ViewSource (const std::string &frameName="")
 
std::string GetSource (const std::string &frameName="")
 
std::string GetText (const std::string &frameName="")
 
void ExecuteJavaScript (const std::string &jsCode, const std::string &scriptUrl, int startLine, const std::string &frameName="")
 
bool CanGoBack ()
 
void GoBack ()
 
bool CanGoForward ()
 
void GoForward ()
 
void Reload ()
 
void ReloadIgnoreCache ()
 
void StopLoad ()
 
void Find (int identifier, const CefString &searchText, bool forward, bool matchCase, bool findNext)
 
void StopFinding (bool clearSelection)
 
double GetZoomLevel ()
 
void SetZoomLevel (double zoomLevel)
 
void ClearHistory ()
 
void ShowDevTools ()
 
void CloseDevTools ()
 
std::pair< int, int > GetSize ()
 
void SetSize (std::pair< int, int > newSize)
 
std::pair< int, int > GetPosition ()
 
void SetPosition (std::pair< int, int > newPosition)
 
bool IsOffscreen () const
 
void InjectKeyMsg (int msg, LPARAM lparam, WPARAM wparam)
 
void InjectKey (int scanCode, int keydata, bool down)
 
void InjectChar (int scanCode, int keydata)
 
void InjectMouseClick (int x, int y, int buttonType, bool mouseUp, int clickCount)
 
void InjectMouseMove (int x, int y, bool mouseLeave)
 
void InjectMouseWheel (int x, int y, int delta)
 
void InjectFocus (bool setFocus)
 
void SetListener (WebNavigatorListener *newListener)
 
WebNavigatorListenerGetListener ()
 

Protected Attributes

CefRefPtr< CefBrowser > browser
 

Detailed Description

Definition at line 121 of file SO3EmbeddedWebNavigator.h.

Constructor & Destructor Documentation

◆ WebNavigator() [1/2]

SO3::EmbeddedWebNavigator::WebNavigator::WebNavigator ( const unsigned long  navigatorUniqueId,
const ScolWindowHandle &  scolMainWindow,
const ScolWindowHandle &  parentWindowHandleInstance,
int  xPosition,
int  yPosition,
int  width,
int  height,
std::string  url 
)

Constructor, creates a new web navigator.

Definition at line 34 of file SO3EmbeddedWebNavigator.cpp.

◆ WebNavigator() [2/2]

SO3::EmbeddedWebNavigator::WebNavigator::WebNavigator ( const unsigned long  navigatorUniqueId,
const ScolWindowHandle &  scolMainWindow,
const ScolWindowHandle &  parentWindowHandleInstance,
int  width,
int  height,
std::string  url,
bool  transparency 
)

Constructor, creates a new web navigator that will render it's content "offscreen".

Definition at line 43 of file SO3EmbeddedWebNavigator.cpp.

◆ ~WebNavigator()

SO3::EmbeddedWebNavigator::WebNavigator::~WebNavigator ( )
virtual

Destructor.

Definition at line 105 of file SO3EmbeddedWebNavigator.cpp.

Member Function Documentation

◆ CanGoBack()

bool SO3::EmbeddedWebNavigator::WebNavigator::CanGoBack ( )

Returns true if the browser can navigate backwards.

Definition at line 156 of file SO3EmbeddedWebNavigator.cpp.

◆ CanGoForward()

bool SO3::EmbeddedWebNavigator::WebNavigator::CanGoForward ( )

Returns true if the browser can navigate forwards.

Definition at line 170 of file SO3EmbeddedWebNavigator.cpp.

◆ ClearHistory()

void SO3::EmbeddedWebNavigator::WebNavigator::ClearHistory ( )

Clear the back/forward browsing history.

Definition at line 223 of file SO3EmbeddedWebNavigator.cpp.

◆ CloseDevTools()

void SO3::EmbeddedWebNavigator::WebNavigator::CloseDevTools ( )

Close the developer tools window if one exists for this browser instance.

Definition at line 233 of file SO3EmbeddedWebNavigator.cpp.

◆ Copy()

void SO3::EmbeddedWebNavigator::WebNavigator::Copy ( const std::string &  frameName = "")

Execute copy on a frame.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 309 of file SO3EmbeddedWebNavigator.cpp.

◆ Cut()

void SO3::EmbeddedWebNavigator::WebNavigator::Cut ( const std::string &  frameName = "")

Execute cut on a frame.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 304 of file SO3EmbeddedWebNavigator.cpp.

◆ Delete()

void SO3::EmbeddedWebNavigator::WebNavigator::Delete ( const std::string &  frameName = "")

Execute delete on a frame.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 319 of file SO3EmbeddedWebNavigator.cpp.

◆ ExecuteJavaScript()

void SO3::EmbeddedWebNavigator::WebNavigator::ExecuteJavaScript ( const std::string &  jsCode,
const std::string &  scriptUrl,
int  startLine,
const std::string &  frameName = "" 
)

Execute a string of JavaScript code in this frame. The |script_url| parameter is the URL where the script in question can be found, if any. The renderer may request this URL to show the developer the source of the error. The |start_line| parameter is the base line number to use for error reporting.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 357 of file SO3EmbeddedWebNavigator.cpp.

◆ Find()

void SO3::EmbeddedWebNavigator::WebNavigator::Find ( int  identifier,
const CefString &  searchText,
bool  forward,
bool  matchCase,
bool  findNext 
)

Search for text in the current page.

Parameters
identifierCan be used to have multiple searches running simultaniously (search index).
searchTextThe searched text
forwardIndicates whether to search forward or backward within the page.
matchCaseIndicates whether the search should be case-sensitive.
findNextIndicates whether this is the first request or a follow-up.

Definition at line 199 of file SO3EmbeddedWebNavigator.cpp.

◆ GetListener()

WebNavigatorListener * SO3::EmbeddedWebNavigator::WebNavigator::GetListener ( )

Definition at line 497 of file SO3EmbeddedWebNavigator.cpp.

◆ GetParentWindowHandle()

ScolWindowHandle SO3::EmbeddedWebNavigator::WebNavigator::GetParentWindowHandle ( )

Definition at line 136 of file SO3EmbeddedWebNavigator.cpp.

◆ GetPosition()

std::pair< int, int > SO3::EmbeddedWebNavigator::WebNavigator::GetPosition ( )

Definition at line 249 of file SO3EmbeddedWebNavigator.cpp.

◆ GetSize()

std::pair< int, int > SO3::EmbeddedWebNavigator::WebNavigator::GetSize ( )

Definition at line 238 of file SO3EmbeddedWebNavigator.cpp.

◆ GetSource()

std::string SO3::EmbeddedWebNavigator::WebNavigator::GetSource ( const std::string &  frameName = "")

Returns a frame's HTML source as a string.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 339 of file SO3EmbeddedWebNavigator.cpp.

◆ GetText()

std::string SO3::EmbeddedWebNavigator::WebNavigator::GetText ( const std::string &  frameName = "")

Returns a frame's display text as a string.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 348 of file SO3EmbeddedWebNavigator.cpp.

◆ GetUniqueId()

unsigned long SO3::EmbeddedWebNavigator::WebNavigator::GetUniqueId ( )

Definition at line 126 of file SO3EmbeddedWebNavigator.cpp.

◆ GetURL()

std::string SO3::EmbeddedWebNavigator::WebNavigator::GetURL ( const std::string &  frameName = "")

Returns the URL currently loaded in a frame.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 285 of file SO3EmbeddedWebNavigator.cpp.

◆ GetWebNavigatorClient()

CefRefPtr< WebNavigatorClient > & SO3::EmbeddedWebNavigator::WebNavigator::GetWebNavigatorClient ( )

Definition at line 131 of file SO3EmbeddedWebNavigator.cpp.

◆ GetZoomLevel()

double SO3::EmbeddedWebNavigator::WebNavigator::GetZoomLevel ( )

Get the zoom level.

Definition at line 209 of file SO3EmbeddedWebNavigator.cpp.

◆ GoBack()

void SO3::EmbeddedWebNavigator::WebNavigator::GoBack ( )

Navigate backwards.

Definition at line 165 of file SO3EmbeddedWebNavigator.cpp.

◆ GoForward()

void SO3::EmbeddedWebNavigator::WebNavigator::GoForward ( )

Navigate forwards.

Definition at line 179 of file SO3EmbeddedWebNavigator.cpp.

◆ InjectChar()

void SO3::EmbeddedWebNavigator::WebNavigator::InjectChar ( int  scanCode,
int  keydata 
)

Send a char to the web navigatoc

Definition at line 411 of file SO3EmbeddedWebNavigator.cpp.

◆ InjectFocus()

void SO3::EmbeddedWebNavigator::WebNavigator::InjectFocus ( bool  setFocus)

Send a focus event to the browser.

Definition at line 466 of file SO3EmbeddedWebNavigator.cpp.

◆ InjectKey()

void SO3::EmbeddedWebNavigator::WebNavigator::InjectKey ( int  scanCode,
int  keydata,
bool  down 
)

Send a key event to the web navigator

Definition at line 389 of file SO3EmbeddedWebNavigator.cpp.

◆ InjectKeyMsg()

void SO3::EmbeddedWebNavigator::WebNavigator::InjectKeyMsg ( int  msg,
LPARAM  lparam,
WPARAM  wparam 
)

Send a key event to the web navigator

Definition at line 367 of file SO3EmbeddedWebNavigator.cpp.

◆ InjectMouseClick()

void SO3::EmbeddedWebNavigator::WebNavigator::InjectMouseClick ( int  x,
int  y,
int  buttonType,
bool  mouseUp,
int  clickCount 
)

Send a mouse click event to the browser. The |x| and |y| coordinates are relative to the upper-left corner of the view.

Definition at line 427 of file SO3EmbeddedWebNavigator.cpp.

◆ InjectMouseMove()

void SO3::EmbeddedWebNavigator::WebNavigator::InjectMouseMove ( int  x,
int  y,
bool  mouseLeave 
)

Send a mouse move event to the browser. The |x| and |y| coordinates are relative to the upper-left corner of the view.

Definition at line 439 of file SO3EmbeddedWebNavigator.cpp.

◆ InjectMouseWheel()

void SO3::EmbeddedWebNavigator::WebNavigator::InjectMouseWheel ( int  x,
int  y,
int  delta 
)

Send a mouse wheel event to the browser. The |x| and |y| coordinates are relative to the upper-left corner of the view.

Definition at line 454 of file SO3EmbeddedWebNavigator.cpp.

◆ IsOffscreen()

bool SO3::EmbeddedWebNavigator::WebNavigator::IsOffscreen ( ) const

Definition at line 362 of file SO3EmbeddedWebNavigator.cpp.

◆ LoadFile()

void SO3::EmbeddedWebNavigator::WebNavigator::LoadFile ( const std::string &  file,
const std::string &  frameName = "" 
)

Loads a local file.

Parameters
urlThe file to load
frameNameThe target frame, main frame will be used if empty.
Note
The file should reside in a scol partition.

Definition at line 146 of file SO3EmbeddedWebNavigator.cpp.

◆ LoadHTML()

void SO3::EmbeddedWebNavigator::WebNavigator::LoadHTML ( const std::string &  html,
const std::string &  frameName = "" 
)

Definition at line 151 of file SO3EmbeddedWebNavigator.cpp.

◆ LoadURL()

void SO3::EmbeddedWebNavigator::WebNavigator::LoadURL ( const std::string &  url,
const std::string &  frameName = "" 
)

Loads an URL.

Parameters
urlThe url to load
frameNameThe target frame, main frame will be used if empty.

Definition at line 141 of file SO3EmbeddedWebNavigator.cpp.

◆ Paste()

void SO3::EmbeddedWebNavigator::WebNavigator::Paste ( const std::string &  frameName = "")

Execute paste on a frame.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 314 of file SO3EmbeddedWebNavigator.cpp.

◆ Print()

void SO3::EmbeddedWebNavigator::WebNavigator::Print ( const std::string &  frameName = "")

Execute printing on a frame. The user will be prompted with the print dialog appropriate to the operating system.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 329 of file SO3EmbeddedWebNavigator.cpp.

◆ Redo()

void SO3::EmbeddedWebNavigator::WebNavigator::Redo ( const std::string &  frameName = "")

Execute redo on a frame.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 299 of file SO3EmbeddedWebNavigator.cpp.

◆ Reload()

void SO3::EmbeddedWebNavigator::WebNavigator::Reload ( )

Reload the current page.

Definition at line 184 of file SO3EmbeddedWebNavigator.cpp.

◆ ReloadIgnoreCache()

void SO3::EmbeddedWebNavigator::WebNavigator::ReloadIgnoreCache ( )

Reload the current page ignoring any cached data.

Definition at line 189 of file SO3EmbeddedWebNavigator.cpp.

◆ SelectAll()

void SO3::EmbeddedWebNavigator::WebNavigator::SelectAll ( const std::string &  frameName = "")

Execute select all on a frame.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 324 of file SO3EmbeddedWebNavigator.cpp.

◆ SetListener()

void SO3::EmbeddedWebNavigator::WebNavigator::SetListener ( WebNavigatorListener newListener)

Send a capture lost event to the browser.

Definition at line 492 of file SO3EmbeddedWebNavigator.cpp.

◆ SetPosition()

void SO3::EmbeddedWebNavigator::WebNavigator::SetPosition ( std::pair< int, int >  newPosition)

Definition at line 254 of file SO3EmbeddedWebNavigator.cpp.

◆ SetSize()

void SO3::EmbeddedWebNavigator::WebNavigator::SetSize ( std::pair< int, int >  newSize)

Definition at line 243 of file SO3EmbeddedWebNavigator.cpp.

◆ SetZoomLevel()

void SO3::EmbeddedWebNavigator::WebNavigator::SetZoomLevel ( double  zoomLevel)

Change the zoom level to the specified value.

Definition at line 218 of file SO3EmbeddedWebNavigator.cpp.

◆ ShowDevTools()

void SO3::EmbeddedWebNavigator::WebNavigator::ShowDevTools ( )

Open developer tools window.

Definition at line 228 of file SO3EmbeddedWebNavigator.cpp.

◆ StopFinding()

void SO3::EmbeddedWebNavigator::WebNavigator::StopFinding ( bool  clearSelection)

Cancel all searches that are currently going on.

Definition at line 204 of file SO3EmbeddedWebNavigator.cpp.

◆ StopLoad()

void SO3::EmbeddedWebNavigator::WebNavigator::StopLoad ( )

Stop loading the page.

Definition at line 194 of file SO3EmbeddedWebNavigator.cpp.

◆ Undo()

void SO3::EmbeddedWebNavigator::WebNavigator::Undo ( const std::string &  frameName = "")

Execute undo on a frame.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 294 of file SO3EmbeddedWebNavigator.cpp.

◆ ViewSource()

void SO3::EmbeddedWebNavigator::WebNavigator::ViewSource ( const std::string &  frameName = "")

Save a frame's HTML source to a temporary file and open it in the default text viewing application.

Parameters
frameNameThe target frame, main frame will be used if empty.

Definition at line 334 of file SO3EmbeddedWebNavigator.cpp.

Member Data Documentation

◆ browser

CefRefPtr<CefBrowser> SO3::EmbeddedWebNavigator::WebNavigator::browser
protected

Definition at line 418 of file SO3EmbeddedWebNavigator.h.


The documentation for this class was generated from the following files: