Notation used in Ruby API documentation
Module: lay
Description: A HTML display and browser dialog
Class hierarchy: BrowserDialog » QDialog » QWidget » QObject
The browser dialog displays HTML code in a browser panel. The HTML code is delivered through a separate object of class BrowserSource which acts as a "server" for a specific kind of URL scheme. Whenever the browser sees a URL starting with "int:" it will ask the connected BrowserSource object for the HTML code of that page using its 'get' method. The task of the BrowserSource object is to format the data requested in HTML and deliver it.
One use case for that class is the implementation of rich data browsers for structured information. In a simple scenario, the browser dialog can be instantiated with a static HTML page. In that case, only the content of that page is shown.
Here's a simple example:
html = "<html><body>Hello, world!</body></html>" RBA::BrowserDialog::new(html).exec
And that is an example for the use case with a BrowserSource as the "server":
class MySource < RBA::BrowserSource def get(url) if (url =~ /b.html$/) return "<html><body>The second page</body></html>" else return "<html><body>The first page with a <a href='int:b.html'>link</a></body></html>" end end end source = MySource::new RBA::BrowserDialog::new(source).exec
new BrowserDialog ptr | new | (BrowserSource ptr source) | Creates a HTML browser window with a BrowserSource as the source of HTML code |
new BrowserDialog ptr | new | (string html) | Creates a HTML browser window with a static HTML content |
new BrowserDialog ptr | new | (QWidget ptr parent, BrowserSource ptr source) | Creates a HTML browser window with a BrowserSource as the source of HTML code |
new BrowserDialog ptr | new | (QWidget ptr parent, string html) | Creates a HTML browser window with a static HTML content |
[const] | BrowserDialog ptr | _const_cast | Returns a non-const reference to self. | |
void | _create | Ensures the C++ object is created | ||
void | _destroy | Explicitly destroys the object | ||
[const] | bool | _destroyed? | Returns a value indicating whether the object was already destroyed | |
[const] | bool | _is_const_object? | Returns a value indicating whether the reference is a const reference | |
void | _manage | Marks the object as managed by the script side. | ||
void | _unmanage | Marks the object as no longer owned by the script side. | ||
void | caption= | (string caption) | Sets the caption of the window | |
int | execute | Executes the HTML browser dialog as a modal window | ||
void | home= | (string home_url) | Sets the browser's initial and current URL which is selected if the "home" location is chosen | |
void | label= | (string label) | Sets the label text | |
void | load | (string url) | Loads the given URL into the browser dialog | |
void | reload | Reloads the current page | ||
void | resize | (int width, int height) | Sets the size of the dialog window | |
void | search | (string search_item) | Issues a search request using the given search item and the search URL specified with set_search_url | |
void | set_search_url | (string url, string query_item) | Enables the search field and specifies the search URL generated for a search | |
void | source= | (BrowserSource ptr source) | Connects to a source object |
[virtual] | void | closed | Use of this method is deprecated | |
int | exec | Use of this method is deprecated. Use execute instead | ||
void | set_caption | (string caption) | Use of this method is deprecated. Use caption= instead | |
void | set_home | (string home_url) | Use of this method is deprecated. Use home= instead | |
void | set_size | (int width, int height) | Use of this method is deprecated. Use resize instead | |
void | set_source | (BrowserSource ptr source) | Use of this method is deprecated. Use source= instead |
_const_cast | Signature: [const] BrowserDialog ptr _const_cast Description: Returns a non-const reference to self. Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects. This method has been introduced in version 0.29.6. |
_create | Signature: void _create Description: Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. |
_destroy | Signature: void _destroy Description: Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing. |
_destroyed? | Signature: [const] bool _destroyed? Description: Returns a value indicating whether the object was already destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. |
_is_const_object? | Signature: [const] bool _is_const_object? Description: Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self. |
_manage | Signature: void _manage Description: Marks the object as managed by the script side. After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. Usually it's not required to call this method. It has been introduced in version 0.24. |
_unmanage | Signature: void _unmanage Description: Marks the object as no longer owned by the script side. Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. Usually it's not required to call this method. It has been introduced in version 0.24. |
caption= | Signature: void caption= (string caption) Description: Sets the caption of the window Python specific notes: |
closed | Signature: [virtual] void closed Description: Callback when the dialog is closed Use of this method is deprecated This callback can be reimplemented to implement cleanup functionality when the dialog is closed. |
exec | Signature: int exec Description: Executes the HTML browser dialog as a modal window Use of this method is deprecated. Use execute instead Python specific notes: |
execute | Signature: int execute Description: Executes the HTML browser dialog as a modal window Python specific notes: |
home= | Signature: void home= (string home_url) Description: Sets the browser's initial and current URL which is selected if the "home" location is chosen The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". Python specific notes: |
label= | Signature: void label= (string label) Description: Sets the label text The label is shown left of the navigation buttons. By default, no label is specified. This method has been introduced in version 0.23. Python specific notes: |
load | Signature: void load (string url) Description: Loads the given URL into the browser dialog Typically the URL has the "int:" scheme so the HTML code is taken from the BrowserSource object. |
new | (1) Signature: [static] new BrowserDialog ptr new (BrowserSource ptr source) Description: Creates a HTML browser window with a BrowserSource as the source of HTML code This method has been introduced in version 0.23. Python specific notes: |
(2) Signature: [static] new BrowserDialog ptr new (string html) Description: Creates a HTML browser window with a static HTML content This method has been introduced in version 0.23. Python specific notes: | |
(3) Signature: [static] new BrowserDialog ptr new (QWidget ptr parent, BrowserSource ptr source) Description: Creates a HTML browser window with a BrowserSource as the source of HTML code This method variant with a parent argument has been introduced in version 0.24.2. Python specific notes: | |
(4) Signature: [static] new BrowserDialog ptr new (QWidget ptr parent, string html) Description: Creates a HTML browser window with a static HTML content This method variant with a parent argument has been introduced in version 0.24.2. Python specific notes: | |
reload | Signature: void reload Description: Reloads the current page |
resize | Signature: void resize (int width, int height) Description: Sets the size of the dialog window |
search | Signature: void search (string search_item) Description: Issues a search request using the given search item and the search URL specified with set_search_url See set_search_url for a description of the search mechanism. |
set_caption | Signature: void set_caption (string caption) Description: Sets the caption of the window Use of this method is deprecated. Use caption= instead Python specific notes: |
set_home | Signature: void set_home (string home_url) Description: Sets the browser's initial and current URL which is selected if the "home" location is chosen Use of this method is deprecated. Use home= instead The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". Python specific notes: |
set_search_url | Signature: void set_search_url (string url, string query_item) Description: Enables the search field and specifies the search URL generated for a search If a search URL is set, the search box right to the navigation bar will be enabled. When a text is entered into the search box, the browser will navigate to an URL composed of the search URL, the search item and the search text, i.e. "myurl?item=search_text". This method has been introduced in version 0.23. |
set_size | Signature: void set_size (int width, int height) Description: Sets the size of the dialog window Use of this method is deprecated. Use resize instead |
set_source | Signature: void set_source (BrowserSource ptr source) Description: Connects to a source object Use of this method is deprecated. Use source= instead Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, home= should be called after the source was set. Python specific notes: |
source= | Signature: void source= (BrowserSource ptr source) Description: Connects to a source object Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, home= should be called after the source was set. Python specific notes: |