5#ifndef MOLYBDEN_FRAME_HPP
6#define MOLYBDEN_FRAME_HPP
13#include "molybden/js/js_value.hpp"
34 virtual std::shared_ptr<Browser>
browser() = 0;
53 virtual std::string
name() = 0;
61 virtual std::string
html() = 0;
84 virtual std::string
text() = 0;
92 virtual void loadUrl(
const std::string& url) = 0;
129 virtual std::shared_ptr<Frame>
parent() = 0;
157 std::function<
void(
JsValue)> callback) = 0;
163 virtual std::vector<std::shared_ptr<Frame>>
children() = 0;
A web frame that provides access to DOM and JavaScript.
Definition frame.hpp:29
virtual JsValue executeJavaScript(const std::string &script)=0
Executes the given script in the frame and returns the result of the execution.
virtual std::string text()=0
Returns content of the frame and its sub-frames as plain text or an empty string if the frame does no...
virtual std::string name()=0
Returns the name of the frame or an empty string if the frame does not have a name.
virtual std::shared_ptr< Browser > browser()=0
The browser instance of the frame.
virtual bool isCommandEnabled(const std::string &command_name)=0
Returns true if the command with the given command_name can be executed in the frame.
virtual bool isMain()=0
Checks if it is a main frame.
virtual bool executeCommand(const EditorCommand &command)=0
Executes the given command in the frame.
virtual std::shared_ptr< RenderProcess > renderProcess()=0
Returns the render process associated with this frame.
virtual void loadUrl(const std::string &url)=0
Navigates the frame to a resource identified by the given URL.
virtual std::vector< std::shared_ptr< Frame > > children()=0
Returns a list of child frames or an empty list if this frame does not have any children.
virtual void print()=0
Requests printing of the currently loaded web page in this frame.
virtual std::string html()=0
Returns content of the frame in the HTML format or an empty string if the frame does not have a conte...
virtual std::shared_ptr< Frame > parent()=0
Returns the parent frame instance or nullptr if the frame is a main (top-level) frame that doesn't ha...
virtual void executeJavaScript(const std::string &script, std::function< void(JsValue)> callback)=0
Executes the given script in the frame and returns the result of the execution.
A JavaScript value.
Definition js_value.hpp:44
Definition editor_command.hpp:15