#include <BrowserContent.hpp>
Inheritance diagram for juce::BrowserContent:
Describe your class and how it works here! [/Comments]
Public Member Functions | |
void | broughtToFront () |
BrowserContent (const String &browsedURL) | |
const HTML::Renderer::BoxHierarchy * | BrowserContent::linkHitTest (const Point &point) const |
Fast hit testing algorithm to detect links on user actions. | |
void | childrenChanged () |
juce::String | convertFrom (const DOM::DOMString &string) const |
Convert a DOM String to Juce's String. | |
juce::Colour | convertFrom (const CSS::Colour &color) const |
Convert a CSS colour to Juce's color. | |
void | drawSplitText (Graphics &g, HTML::Renderer::Box *box, juce::Justification just) |
Draw a split text correctly. | |
void | enablementChanged () |
int | fastLinkArrayLookup (const HTML::Renderer::BoxHierarchy *box) const |
Fast search inside linkArea array for a given node. | |
int | fastWidgetArrayLookup (const HTML::Renderer::BoxHierarchy *box) const |
Fast search inside widget array for a given node. | |
bool | filesDropped (const StringArray &filenames, int mouseX, int mouseY) |
void | focusGained (FocusChangeType cause) |
void | focusLost (FocusChangeType cause) |
void | focusOfChildComponentChanged (FocusChangeType cause) |
virtual CSS::Font * | getBolderFont (CSS::Font *font) |
Get a bolder font than the given font. | |
virtual CSS::Font * | getColouredFont (CSS::Font *font, const CSS::Colour &color) |
Get a coloured font than the given font. | |
virtual CSS::Font * | getDefaultFont () |
Get the default font object to use for the renderer. | |
virtual CSS::Font * | getItalicFont (CSS::Font *font) |
Get an italic font derived from the given font. | |
virtual HTML::Renderer::TableLayout * | getKnownTableLayout (const HTML::Renderer::BoxHierarchy *box) |
Get an existing table layout from its BoxHierarchy key. | |
virtual bool | getMinAndMaxWidthOf (HTML::Renderer::Box *box, int32 &minimumWidth, int32 &maximumWidth) |
Get the minimum and maximum width of the given box, in order to compute table real size. | |
virtual uint32 | getMinimumHeightOf (HTML::Renderer::Box *box) |
Get the minimum height of the given element. | |
virtual uint32 | getMinimumWidthOf (HTML::Renderer::Box *box) |
Get the minimum width of the given element. | |
virtual CSS::Font * | getMonospaceFont (CSS::Font *font) |
Get an monospaced font derived from the given font. | |
virtual HTML::Renderer::TableLayout * | getNewTableLayout (const HTML::Renderer::BoxHierarchy *box) |
Get a new table layout object so the renderer can save the layout it finds in it. | |
virtual uint32 | getRenderedHeightOf (HTML::Renderer::Box *box) |
Get the rendering height of the given element. | |
virtual uint32 | getRenderedWidthOf (HTML::Renderer::Box *box) |
Get the rendering width of the given element. | |
virtual CSS::Font * | getScaledFont (CSS::Font *font, const float scale) |
Get a scaled font than the given font. | |
const String | getSourceText () |
Get the source of the currently displayed page. | |
virtual bool | getSplitLimitsOf (HTML::Renderer::Box *box, const int32 boxLeft, const int32 boxRight, const int32 top, const int32 left, int32 &right, int32 &bottom) |
Get the split limits of the given inline box. | |
void | handleCommandMessage (int commandId) |
bool | hitTest (int x, int y) |
void | inputAttemptWhenModal () |
bool | loadDocument () |
juce::Image * | loadImage (const Strings::FastString &url) const |
Load an image given its URL. | |
bool | loadTestDocument () |
void | lookAndFeelChanged () |
void | modifierKeysChanged (const ModifierKeys &modifiers) |
void | mouseDoubleClick (const MouseEvent &e) |
void | mouseDown (const MouseEvent &e) |
void | mouseDrag (const MouseEvent &e) |
void | mouseEnter (const MouseEvent &e) |
void | mouseExit (const MouseEvent &e) |
void | mouseMove (const MouseEvent &e) |
void | mouseUp (const MouseEvent &e) |
void | mouseWheelMove (const MouseEvent &e, float wheelIncrementX, float wheelIncrementY) |
void | moved () |
void | paint (Graphics &g) |
void | parentHierarchyChanged () |
void | parentSizeChanged () |
int32 | requiredHeightAfterRendering () |
Render the current DOM tree, and extract the required height for this document. | |
void | resized () |
void | setUpdater (URLChangeUpdate *_urlUpdater) |
Add a listener to the list. | |
void | showDOMTree () |
Show the current DOM tree. | |
void | showErrors () |
Show the error console. | |
void | visibilityChanged () |
~BrowserContent () |
juce::BrowserContent::BrowserContent | ( | const String & | browsedURL | ) |
juce::BrowserContent::~BrowserContent | ( | ) |
void juce::BrowserContent::broughtToFront | ( | ) |
const HTML::Renderer::BoxHierarchy* juce::BrowserContent::BrowserContent::linkHitTest | ( | const Point & | point | ) | const |
Fast hit testing algorithm to detect links on user actions.
pt | The point to test against |
void juce::BrowserContent::childrenChanged | ( | ) |
juce::String juce::BrowserContent::convertFrom | ( | const DOM::DOMString & | string | ) | const [inline] |
Convert a DOM String to Juce's String.
juce::Colour juce::BrowserContent::convertFrom | ( | const CSS::Colour & | color | ) | const [inline] |
Convert a CSS colour to Juce's color.
void juce::BrowserContent::drawSplitText | ( | Graphics & | g, | |
HTML::Renderer::Box * | box, | |||
juce::Justification | just | |||
) |
Draw a split text correctly.
void juce::BrowserContent::enablementChanged | ( | ) |
int juce::BrowserContent::fastLinkArrayLookup | ( | const HTML::Renderer::BoxHierarchy * | box | ) | const |
Fast search inside linkArea array for a given node.
box | The box to use as key for searching |
int juce::BrowserContent::fastWidgetArrayLookup | ( | const HTML::Renderer::BoxHierarchy * | box | ) | const |
Fast search inside widget array for a given node.
box | The box to use as key for searching |
bool juce::BrowserContent::filesDropped | ( | const StringArray & | filenames, | |
int | mouseX, | |||
int | mouseY | |||
) |
void juce::BrowserContent::focusGained | ( | FocusChangeType | cause | ) |
void juce::BrowserContent::focusLost | ( | FocusChangeType | cause | ) |
void juce::BrowserContent::focusOfChildComponentChanged | ( | FocusChangeType | cause | ) |
Get a bolder font than the given font.
font | The reference font to get an heavier stroke from The mapper doesn't manage the returned object, so the application must clean font objects after deleting the mapper |
Implements HTML::Renderer::RequiredRendererImplementation.
CSS::Font * juce::BrowserContent::getColouredFont | ( | CSS::Font * | font, | |
const CSS::Colour & | color | |||
) | [virtual] |
Get a coloured font than the given font.
font | The reference font to scale from | |
color | The new font color |
Implements HTML::Renderer::RequiredRendererImplementation.
CSS::Font * juce::BrowserContent::getDefaultFont | ( | ) | [virtual] |
Get the default font object to use for the renderer.
The mapper doesn't manage the returned object, so the application must clean font objects after deleting the mapper
Implements HTML::Renderer::RequiredRendererImplementation.
Get an italic font derived from the given font.
font | The reference font to get an inclined stroke from The mapper doesn't manage the returned object, so the application must clean font objects after deleting the mapper |
Implements HTML::Renderer::RequiredRendererImplementation.
HTML::Renderer::TableLayout * juce::BrowserContent::getKnownTableLayout | ( | const HTML::Renderer::BoxHierarchy * | box | ) | [virtual] |
Get an existing table layout from its BoxHierarchy key.
This method is called when the box hierarchy is mapped to individual rendering boxes.
box | The box object which is used as a key in the table layout array |
Implements HTML::Renderer::RequiredRendererImplementation.
bool juce::BrowserContent::getMinAndMaxWidthOf | ( | HTML::Renderer::Box * | box, | |
int32 & | minimumWidth, | |||
int32 & | maximumWidth | |||
) | [virtual] |
Get the minimum and maximum width of the given box, in order to compute table real size.
The minimum width is not like the other method which tries to determine the required size in the box rendering algorithm. In this case, the minimum width is the mathematical minimum width of all individual items in this box.
For example, a box that contains "A small text that may contain such <PICTURE>", will be cut in parts:
The maximum width is computed like if the rendering area was unlimited. They are no line break to take into account, but
are still valid. The biggest line will make the maximum width.
In the previous example, it's the width of "A small text that may contain such <PICTURE>" that should be stored in maximum width.
Then, both minimum and maximum width will be stored in the given table layout by the mapper at the right place.
It's mapper's responsibility to iterate over every box in every cell of the table. The renderer simply returns the widths as required.
box | The box that need to be measured and/or split | |
minimunWidth | A reference on the minimum width variable to store result into | |
maximumWidth | A reference on the maximum width variable to store result into |
Implements HTML::Renderer::RequiredRendererImplementation.
uint32 juce::BrowserContent::getMinimumHeightOf | ( | HTML::Renderer::Box * | box | ) | [virtual] |
Get the minimum height of the given element.
box | The box to get the minimum rendered content height |
Implements HTML::Renderer::RequiredRendererImplementation.
uint32 juce::BrowserContent::getMinimumWidthOf | ( | HTML::Renderer::Box * | box | ) | [virtual] |
Get the minimum width of the given element.
box | The box to get the minimum rendered content width |
Implements HTML::Renderer::RequiredRendererImplementation.
Get an monospaced font derived from the given font.
font | The reference font to get an monospaced stroke from The mapper doesn't manage the returned object, so the application must clean font objects after deleting the mapper |
Implements HTML::Renderer::RequiredRendererImplementation.
HTML::Renderer::TableLayout * juce::BrowserContent::getNewTableLayout | ( | const HTML::Renderer::BoxHierarchy * | box | ) | [virtual] |
Get a new table layout object so the renderer can save the layout it finds in it.
Currently, the DOM tree is entirely parsed. This means that we can render a table correctly, as we have access to every cell content of the table. The table layout is created by the mapper, and 2 rendering passes are applied on the the cells. The first rendering pass determines the table layout (number of rows & columns), and the minimum cell size for each cells (using CSS rendering model) The table width is then adjusted and column size are computed exactly. The last rendering pass set the column size, row & cell positions and break the cell content if required.
The mapper performs the first part of the first pass when it generates the box hierarchy. Then, when it maps the box hierarchy to individuals boxes it call the getStoredTableLayout callback to add the final part of the first pass and then add the second pass.
The table layout is cell size-independent, so it can/will be reused when the rendering viewport is updated.
box | The box object which is used as a key in the table layout array |
Implements HTML::Renderer::RequiredRendererImplementation.
uint32 juce::BrowserContent::getRenderedHeightOf | ( | HTML::Renderer::Box * | box | ) | [virtual] |
Get the rendering height of the given element.
box | The box to get the rendered content width |
Implements HTML::Renderer::RequiredRendererImplementation.
uint32 juce::BrowserContent::getRenderedWidthOf | ( | HTML::Renderer::Box * | box | ) | [virtual] |
Get the rendering width of the given element.
box | The box to get the rendered content width |
Implements HTML::Renderer::RequiredRendererImplementation.
Get a scaled font than the given font.
font | The reference font to scale from | |
scale | The scale factor The mapper doesn't manage the returned object, so the application must clean font objects after deleting the mapper |
Implements HTML::Renderer::RequiredRendererImplementation.
const String juce::BrowserContent::getSourceText | ( | ) | [inline] |
Get the source of the currently displayed page.
bool juce::BrowserContent::getSplitLimitsOf | ( | HTML::Renderer::Box * | box, | |
const int32 | boxLeft, | |||
const int32 | boxRight, | |||
const int32 | top, | |||
const int32 | left, | |||
int32 & | right, | |||
int32 & | bottom | |||
) | [virtual] |
Get the split limits of the given inline box.
Typical renderer will find where to split the box's text (can be split multiple time if required) and then extract the right and bottom position of the last text's character from the top and left position of the first. The renderer will then modify the right and bottom parameters to reflect the last part.
// Let's say we want to render "My big house is marvelous in summer and wonderful in winter." // so that only 20 chars can fit on a line // The renderer will probably render : // // \/ BoxLeft \/ Top Left // previous line. My // big house is // marvelous in |< BoxRight // summer and // wonderful in // winter. // /\ Bottom right // For example, on input top = 2, left = 15, boxLeft = 0, boxRight = 20 getSplitLimitsOf(box, boxLeft, boxRight, top, left, right, bottom); // Method should return in previous example : right = 7, bottom = 7 // BTW, the example assume 1 char = 1 px * 1px which is obviously wrong
box | The box to get the render and split the content text | |
boxLeft | The container's box left content position (so that when splitting occur, bottom line's left border will match boxLeft position) | |
boxRight | The container's box right content position (so that splitting occur when any text render on the right of this position) | |
top | The top position of the first char of text | |
left | The left position of the first char of text | |
right | The right position of the last line's char should be saved here | |
bottom | The bottom position of the last line's char should be saved here |
Implements HTML::Renderer::RequiredRendererImplementation.
void juce::BrowserContent::handleCommandMessage | ( | int | commandId | ) |
bool juce::BrowserContent::hitTest | ( | int | x, | |
int | y | |||
) |
void juce::BrowserContent::inputAttemptWhenModal | ( | ) |
bool juce::BrowserContent::loadDocument | ( | ) |
juce::Image * juce::BrowserContent::loadImage | ( | const Strings::FastString & | url | ) | const [inline] |
Load an image given its URL.
bool juce::BrowserContent::loadTestDocument | ( | ) |
void juce::BrowserContent::lookAndFeelChanged | ( | ) |
void juce::BrowserContent::modifierKeysChanged | ( | const ModifierKeys & | modifiers | ) |
void juce::BrowserContent::mouseDoubleClick | ( | const MouseEvent & | e | ) |
void juce::BrowserContent::mouseDown | ( | const MouseEvent & | e | ) |
void juce::BrowserContent::mouseDrag | ( | const MouseEvent & | e | ) |
void juce::BrowserContent::mouseEnter | ( | const MouseEvent & | e | ) |
void juce::BrowserContent::mouseExit | ( | const MouseEvent & | e | ) |
void juce::BrowserContent::mouseMove | ( | const MouseEvent & | e | ) |
void juce::BrowserContent::mouseUp | ( | const MouseEvent & | e | ) |
void juce::BrowserContent::mouseWheelMove | ( | const MouseEvent & | e, | |
float | wheelIncrementX, | |||
float | wheelIncrementY | |||
) |
void juce::BrowserContent::moved | ( | ) |
void juce::BrowserContent::paint | ( | Graphics & | g | ) |
void juce::BrowserContent::parentHierarchyChanged | ( | ) |
void juce::BrowserContent::parentSizeChanged | ( | ) |
int32 juce::BrowserContent::requiredHeightAfterRendering | ( | ) |
Render the current DOM tree, and extract the required height for this document.
Call this method after loading the HTML stream, and after every resizing.
void juce::BrowserContent::resized | ( | ) |
void juce::BrowserContent::setUpdater | ( | URLChangeUpdate * | _urlUpdater | ) | [inline] |
Add a listener to the list.
void juce::BrowserContent::showDOMTree | ( | ) | [inline] |
Show the current DOM tree.
void juce::BrowserContent::showErrors | ( | ) | [inline] |
Show the error console.
void juce::BrowserContent::visibilityChanged | ( | ) |