2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: html/htmlcell.h
|
2008-10-25 16:44:52 -04:00
|
|
|
// Purpose: interface of wxHtml*Cell
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-11-03 06:57:07 -05:00
|
|
|
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
2008-11-03 06:57:07 -05:00
|
|
|
@class wxHtmlRenderingStyle
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-11-03 06:57:07 -05:00
|
|
|
Allows HTML rendering customizations.
|
|
|
|
This class is used when rendering wxHtmlCells as a callback.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxhtml}
|
2008-10-13 09:46:42 -04:00
|
|
|
@category{html}
|
2008-11-03 06:57:07 -05:00
|
|
|
|
|
|
|
@see wxHtmlRenderingInfo
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-11-03 06:57:07 -05:00
|
|
|
class wxHtmlRenderingStyle
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-11-03 06:57:07 -05:00
|
|
|
Returns the colour to use for the selected text.
|
|
|
|
*/
|
|
|
|
virtual wxColour GetSelectedTextColour(const wxColour& clr) = 0;
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-11-03 06:57:07 -05:00
|
|
|
/**
|
|
|
|
Returns the colour to use for the selected text's background.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-11-03 06:57:07 -05:00
|
|
|
virtual wxColour GetSelectedTextBgColour(const wxColour& clr) = 0;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2008-11-03 06:57:07 -05:00
|
|
|
@class wxHtmlRenderingInfo
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-11-03 06:57:07 -05:00
|
|
|
This class contains information given to cells when drawing them.
|
|
|
|
Contains rendering state, selection information and rendering style object
|
|
|
|
that can be used to customize the output.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxhtml}
|
2008-10-25 16:44:52 -04:00
|
|
|
@category{html}
|
2008-11-03 06:57:07 -05:00
|
|
|
|
|
|
|
@see @ref overview_html_cells, wxHtmlCell
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-11-03 06:57:07 -05:00
|
|
|
class wxHtmlRenderingInfo
|
2008-03-08 08:52:38 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-11-03 06:57:07 -05:00
|
|
|
Default ctor.
|
|
|
|
*/
|
|
|
|
wxHtmlRenderingInfo();
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-11-03 06:57:07 -05:00
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Accessors.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-11-03 06:57:07 -05:00
|
|
|
void SetSelection(wxHtmlSelection *s);
|
|
|
|
wxHtmlSelection *GetSelection() const;
|
|
|
|
|
|
|
|
void SetStyle(wxHtmlRenderingStyle *style);
|
|
|
|
wxHtmlRenderingStyle& GetStyle();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-11-03 06:57:07 -05:00
|
|
|
wxHtmlRenderingState& GetState();
|
|
|
|
//@}
|
|
|
|
};
|
2008-03-08 08:52:38 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxHtmlCell
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-25 16:44:52 -04:00
|
|
|
Internal data structure. It represents fragments of parsed HTML page, the
|
|
|
|
so-called @b cell - a word, picture, table, horizontal line and so on.
|
|
|
|
It is used by wxHtmlWindow and wxHtmlWinParser to represent HTML page in memory.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
You can divide cells into two groups : @e visible cells with non-zero width and
|
2008-10-25 16:44:52 -04:00
|
|
|
height and @e helper cells (usually with zero width and height) that perform
|
|
|
|
special actions such as color or font change.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxhtml}
|
2008-10-25 16:44:52 -04:00
|
|
|
@category{html}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-25 16:44:52 -04:00
|
|
|
@see @ref overview_html_cells, wxHtmlContainerCell
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxHtmlCell : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxHtmlCell();
|
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
This method is used to adjust pagebreak position.
|
|
|
|
The parameter is variable that contains y-coordinate of page break
|
|
|
|
(= horizontal line that should not be crossed by words, images etc.).
|
|
|
|
If this cell cannot be divided into two pieces (each one on another page)
|
|
|
|
then it moves the pagebreak few pixels up.
|
|
|
|
Returns @true if pagebreak was modified, @false otherwise.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
Usage:
|
2008-10-25 16:44:52 -04:00
|
|
|
@code
|
|
|
|
while (container->AdjustPagebreak(&p)) {}
|
|
|
|
@endcode
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
virtual bool AdjustPagebreak(int* pagebreak,
|
|
|
|
wxArrayInt& known_pagebreaks) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Renders the cell.
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param dc
|
2008-11-03 06:57:07 -05:00
|
|
|
Device context to which the cell is to be drawn.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param x,y
|
2008-03-09 08:33:59 -04:00
|
|
|
Coordinates of parent's upper left corner (origin). You must
|
|
|
|
add this to m_PosX,m_PosY when passing coordinates to dc's methods
|
2008-10-25 16:44:52 -04:00
|
|
|
Example:
|
|
|
|
@code
|
|
|
|
dc->DrawText("hello", x + m_PosX, y + m_PosY)
|
|
|
|
@endcode
|
2008-03-08 09:43:31 -05:00
|
|
|
@param view_y1
|
2008-10-25 16:44:52 -04:00
|
|
|
y-coord of the first line visible in window.
|
2008-11-03 06:57:07 -05:00
|
|
|
This is used to optimize rendering speed.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param view_y2
|
2008-10-25 16:44:52 -04:00
|
|
|
y-coord of the last line visible in window.
|
2008-11-03 06:57:07 -05:00
|
|
|
This is used to optimize rendering speed.
|
|
|
|
@param info
|
|
|
|
Additional information for the rendering of the cell.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, wxHtmlRenderingInfo& info);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
This method is called instead of Draw() when the cell is certainly out of
|
|
|
|
the screen (and thus invisible). This is not nonsense - some tags (like
|
|
|
|
wxHtmlColourCell or font setter) must be drawn even if they are invisible!
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param dc
|
2008-10-25 16:44:52 -04:00
|
|
|
Device context to which the cell is to be drawn.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param x,y
|
2008-03-09 08:33:59 -04:00
|
|
|
Coordinates of parent's upper left corner. You must
|
|
|
|
add this to m_PosX,m_PosY when passing coordinates to dc's methods
|
2008-10-25 16:44:52 -04:00
|
|
|
Example:
|
|
|
|
@code
|
|
|
|
dc->DrawText("hello", x + m_PosX, y + m_PosY)
|
|
|
|
@endcode
|
2008-11-03 06:57:07 -05:00
|
|
|
@param info
|
|
|
|
Additional information for the rendering of the cell.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-11-03 06:57:07 -05:00
|
|
|
virtual void DrawInvisible(wxDC& dc, int x , int y, wxHtmlRenderingInfo& info);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Returns pointer to itself if this cell matches condition (or if any of the
|
|
|
|
cells following in the list matches), @NULL otherwise.
|
|
|
|
(In other words if you call top-level container's Find() it will
|
2008-03-08 08:52:38 -05:00
|
|
|
return pointer to the first cell that matches the condition)
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
It is recommended way how to obtain pointer to particular cell or
|
2008-10-25 16:44:52 -04:00
|
|
|
to cell of some type (e.g. wxHtmlAnchorCell reacts on wxHTML_COND_ISANCHOR
|
|
|
|
condition).
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param condition
|
2008-03-09 08:33:59 -04:00
|
|
|
Unique integer identifier of condition
|
2008-03-08 09:43:31 -05:00
|
|
|
@param param
|
2008-03-09 08:33:59 -04:00
|
|
|
Optional parameters
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual const wxHtmlCell* Find(int condition, const void* param) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Returns descent value of the cell (m_Descent member).
|
2008-03-08 08:52:38 -05:00
|
|
|
See explanation:
|
2009-01-21 17:54:29 -05:00
|
|
|
@image html htmlcell_descent.png
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetDescent() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns pointer to the first cell in the list.
|
2008-10-25 16:44:52 -04:00
|
|
|
You can then use child's GetNext() method to obtain pointer to the next
|
|
|
|
cell in list.
|
|
|
|
|
2008-04-01 09:59:28 -04:00
|
|
|
@note This shouldn't be used by the end user. If you need some way of
|
2008-10-25 16:44:52 -04:00
|
|
|
finding particular cell in the list, try Find() method instead.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxHtmlCell* GetFirstChild() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns height of the cell (m_Height member).
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetHeight() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Returns unique cell identifier if there is any, the empty string otherwise.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
const wxString& GetId() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns hypertext link if associated with this cell or @NULL otherwise.
|
2008-10-25 16:44:52 -04:00
|
|
|
See wxHtmlLinkInfo. (Note: this makes sense only for visible tags).
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param x,y
|
2008-03-09 08:33:59 -04:00
|
|
|
Coordinates of position where the user pressed mouse button.
|
|
|
|
These coordinates are used e.g. by COLORMAP. Values are relative to the
|
|
|
|
upper left corner of THIS cell (i.e. from 0 to m_Width or m_Height)
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
virtual wxHtmlLinkInfo* GetLink(int x = 0, int y = 0) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns cursor to show when mouse pointer is over the cell.
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param window
|
2008-03-09 08:33:59 -04:00
|
|
|
interface to the parent HTML window
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual wxCursor GetMouseCursor(wxHtmlWindowInterface* window) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns pointer to the next cell in list (see htmlcell.h if you're
|
|
|
|
interested in details).
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxHtmlCell* GetNext() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns pointer to parent container.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxHtmlContainerCell* GetParent() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns X position within parent (the value is relative to parent's
|
|
|
|
upper left corner). The returned value is meaningful only if
|
|
|
|
parent's Layout() was called before!
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetPosX() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns Y position within parent (the value is relative to parent's
|
|
|
|
upper left corner). The returned value is meaningful only if
|
|
|
|
parent's Layout() was called before!
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetPosY() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns width of the cell (m_Width member).
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetWidth() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2009-01-21 18:34:03 -05:00
|
|
|
Layouts the cell.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This method performs two actions:
|
2008-10-25 16:44:52 -04:00
|
|
|
-# adjusts the cell's width according to the fact that maximal possible
|
2009-01-21 18:34:03 -05:00
|
|
|
width is @e w (this has sense when working with horizontal lines, tables etc.)
|
2008-10-25 16:44:52 -04:00
|
|
|
-# prepares layout (=fill-in m_PosX, m_PosY (and sometimes m_Height) members)
|
|
|
|
based on actual width @e w
|
|
|
|
|
|
|
|
It must be called before displaying cells structure because m_PosX and
|
|
|
|
m_PosY are undefined (or invalid) before calling Layout().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual void Layout(int w);
|
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
This function is simple event handler.
|
|
|
|
Each time the user clicks mouse button over a cell within wxHtmlWindow
|
|
|
|
this method of that cell is called.
|
|
|
|
Default behavior is to call wxHtmlWindow::LoadPage.
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param window
|
2008-03-09 08:33:59 -04:00
|
|
|
interface to the parent HTML window
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
coordinates of mouse click (this is relative to cell's origin
|
2008-03-08 09:43:31 -05:00
|
|
|
@param event
|
2008-03-09 08:33:59 -04:00
|
|
|
mouse event that triggered the call
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-05-10 21:38:53 -04:00
|
|
|
@return @true if a link was clicked, @false otherwise.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
|
|
|
@since 2.7.0 (before OnMouseClick() method served a similar purpose).
|
|
|
|
|
|
|
|
@note
|
|
|
|
If you need more "advanced" event handling you should use wxHtmlBinderCell instead.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual bool ProcessMouseClick(wxHtmlWindowInterface* window,
|
|
|
|
const wxPoint& pos,
|
|
|
|
const wxMouseEvent& event);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets unique cell identifier. Default value is no identifier, i.e. empty string.
|
|
|
|
*/
|
|
|
|
void SetId(const wxString& id);
|
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Sets the hypertext link associated with this cell.
|
|
|
|
(Default value is wxHtmlLinkInfo("", "") (no link))
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetLink(const wxHtmlLinkInfo& link);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the next cell in the list. This shouldn't be called by user - it is
|
|
|
|
to be used only by wxHtmlContainerCell::InsertCell.
|
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
void SetNext(wxHtmlCell* cell);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Sets parent container of this cell.
|
|
|
|
This is called from wxHtmlContainerCell::InsertCell.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
void SetParent(wxHtmlContainerCell* p);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the cell's position within parent container.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual void SetPos(int x, int y);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxHtmlContainerCell
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The wxHtmlContainerCell class is an implementation of a cell that may
|
|
|
|
contain more cells in it. It is heavily used in the wxHTML layout algorithm.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxhtml}
|
2008-10-25 16:44:52 -04:00
|
|
|
@category{html}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-25 16:44:52 -04:00
|
|
|
@see @ref overview_html_cells
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxHtmlContainerCell : public wxHtmlCell
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Constructor. @a parent is pointer to parent container or @NULL.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-13 09:46:42 -04:00
|
|
|
wxHtmlContainerCell(wxHtmlContainerCell* parent);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns container's horizontal alignment.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetAlignHor() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns container's vertical alignment.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetAlignVer() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the background colour of the container or @c wxNullColour if no
|
2008-10-25 16:44:52 -04:00
|
|
|
background colour is set.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxColour GetBackgroundColour();
|
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Returns the indentation. @a ind is one of the @b wxHTML_INDENT_* constants.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
|
|
|
@note You must call GetIndentUnits() with same @a ind parameter in order
|
|
|
|
to correctly interpret the returned integer value.
|
|
|
|
It is NOT always in pixels!
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetIndent(int ind) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-09 08:33:59 -04:00
|
|
|
Returns the units of indentation for @a ind where @a ind is one
|
2008-03-08 08:52:38 -05:00
|
|
|
of the @b wxHTML_INDENT_* constants.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
int GetIndentUnits(int ind) const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Inserts a new cell into the container.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-10-29 11:34:31 -04:00
|
|
|
void InsertCell(wxHtmlCell* cell);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the container's alignment (both horizontal and vertical) according to
|
2008-10-25 16:44:52 -04:00
|
|
|
the values stored in @e tag. (Tags @c ALIGN parameter is extracted.)
|
|
|
|
In fact it is only a front-end to SetAlignHor() and SetAlignVer().
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetAlign(const wxHtmlTag& tag);
|
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Sets the container's @e horizontal alignment.
|
|
|
|
During wxHtmlCell::Layout each line is aligned according to @a al value.
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param al
|
2008-03-09 08:33:59 -04:00
|
|
|
new horizontal alignment. May be one of these values:
|
2008-10-25 16:44:52 -04:00
|
|
|
- wxHTML_ALIGN_LEFT: lines are left-aligned (default)
|
|
|
|
- wxHTML_ALIGN_JUSTIFY: lines are justified
|
|
|
|
- wxHTML_ALIGN_CENTER: lines are centered
|
|
|
|
- wxHTML_ALIGN_RIGHT: lines are right-aligned
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetAlignHor(int al);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the container's @e vertical alignment. This is per-line alignment!
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param al
|
2008-03-09 08:33:59 -04:00
|
|
|
new vertical alignment. May be one of these values:
|
2008-10-25 16:44:52 -04:00
|
|
|
- wxHTML_ALIGN_BOTTOM: cells are over the line (default)
|
|
|
|
- wxHTML_ALIGN_CENTER: cells are centered on line
|
|
|
|
- wxHTML_ALIGN_TOP: cells are under the line
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2009-01-21 17:54:29 -05:00
|
|
|
@image html htmlcontcell_alignv.png
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetAlignVer(int al);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the background colour for this container.
|
|
|
|
*/
|
|
|
|
void SetBackgroundColour(const wxColour& clr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the border (frame) colours. A border is a rectangle around the container.
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param clr1
|
2008-03-09 08:33:59 -04:00
|
|
|
Colour of top and left lines
|
2008-03-08 09:43:31 -05:00
|
|
|
@param clr2
|
2008-03-09 08:33:59 -04:00
|
|
|
Colour of bottom and right lines
|
2009-04-25 19:19:04 -04:00
|
|
|
@param border
|
|
|
|
Size of the border in pixels
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2009-04-25 19:19:04 -04:00
|
|
|
void SetBorder(const wxColour& clr1, const wxColour& clr2, int border = 1);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the indentation (free space between borders of container and subcells).
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2009-01-21 17:54:29 -05:00
|
|
|
@image html htmlcontcell_indent.png
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param i
|
2008-03-09 08:33:59 -04:00
|
|
|
Indentation value.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param what
|
2008-03-09 08:33:59 -04:00
|
|
|
Determines which of the four borders we're setting. It is OR
|
|
|
|
combination of following constants:
|
2008-10-25 16:44:52 -04:00
|
|
|
- wxHTML_INDENT_TOP: top border
|
|
|
|
- wxHTML_INDENT_BOTTOM: bottom
|
|
|
|
- wxHTML_INDENT_LEFT: left
|
|
|
|
- wxHTML_INDENT_RIGHT: right
|
|
|
|
- wxHTML_INDENT_HORIZONTAL: left and right
|
|
|
|
- wxHTML_INDENT_VERTICAL: top and bottom
|
|
|
|
- wxHTML_INDENT_ALL: all 4 borders
|
2008-03-08 09:43:31 -05:00
|
|
|
@param units
|
2008-10-25 16:44:52 -04:00
|
|
|
Units of i. This parameter affects interpretation of value.
|
|
|
|
- wxHTML_UNITS_PIXELS: @a i is number of pixels
|
|
|
|
- wxHTML_UNITS_PERCENT: @a i is interpreted as percents of width
|
|
|
|
of parent container
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetIndent(int i, int what, int units = wxHTML_UNITS_PIXELS);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets minimal height of the container.
|
2008-10-25 16:44:52 -04:00
|
|
|
When container's wxHtmlCell::Layout is called, m_Height is set depending
|
|
|
|
on layout of subcells to the height of area covered by layed-out subcells.
|
|
|
|
Calling this method guarantees you that the height of container is never
|
|
|
|
smaller than @a h - even if the subcells cover much smaller area.
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param h
|
2008-03-09 08:33:59 -04:00
|
|
|
The minimal height.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param align
|
2008-03-09 08:33:59 -04:00
|
|
|
If height of the container is lower than the minimum height, empty space
|
2008-10-25 16:44:52 -04:00
|
|
|
must be inserted somewhere in order to ensure minimal height.
|
|
|
|
This parameter is one of @c wxHTML_ALIGN_TOP, @c wxHTML_ALIGN_BOTTOM,
|
|
|
|
@c wxHTML_ALIGN_CENTER. It refers to the contents, not to the
|
2008-03-09 08:33:59 -04:00
|
|
|
empty place.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets floating width adjustment.
|
2008-10-25 16:44:52 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The normal behaviour of container is that its width is the same as the width of
|
|
|
|
parent container (and thus you can have only one sub-container per line).
|
2008-10-25 16:44:52 -04:00
|
|
|
You can change this by setting the floating width adjustment.
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param w
|
2008-03-09 08:33:59 -04:00
|
|
|
Width of the container. If the value is negative it means
|
2008-10-25 16:44:52 -04:00
|
|
|
complement to full width of parent container.
|
|
|
|
E.g. @code SetWidthFloat(-50, wxHTML_UNITS_PIXELS) @endcode sets the
|
|
|
|
width of container to parent's width minus 50 pixels. This is useful when
|
|
|
|
creating tables - you can call SetWidthFloat(50) and SetWidthFloat(-50).
|
2008-03-08 09:43:31 -05:00
|
|
|
@param units
|
2008-03-09 08:33:59 -04:00
|
|
|
Units of w This parameter affects the interpretation of value.
|
2008-10-25 16:44:52 -04:00
|
|
|
- wxHTML_UNITS_PIXELS: @a w is number of pixels
|
|
|
|
- wxHTML_UNITS_PERCENT: @a w is interpreted as percents of width
|
|
|
|
of parent container
|
|
|
|
*/
|
|
|
|
void SetWidthFloat(int w, int units);
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-10-25 16:44:52 -04:00
|
|
|
/**
|
|
|
|
Sets floating width adjustment.
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-10-25 16:44:52 -04:00
|
|
|
The normal behaviour of container is that its width is the same as the width of
|
|
|
|
parent container (and thus you can have only one sub-container per line).
|
|
|
|
You can change this by setting the floating width adjustment.
|
2008-10-13 09:46:42 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param tag
|
2008-10-25 16:44:52 -04:00
|
|
|
In the second version of method, @a w and @a units info is extracted
|
|
|
|
from tag's WIDTH parameter.
|
|
|
|
@param pixel_scale
|
|
|
|
This is number of real pixels that equals to 1 HTML pixel.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
void SetWidthFloat(const wxHtmlTag& tag,
|
|
|
|
double pixel_scale = 1.0);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxHtmlLinkInfo
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-25 16:44:52 -04:00
|
|
|
This class stores all necessary information about hypertext links
|
|
|
|
(as represented by \<A\> tag in HTML documents).
|
|
|
|
In current implementation it stores URL and target frame name.
|
|
|
|
|
|
|
|
@note Frames are not currently supported by wxHTML!
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxhtml}
|
2008-10-25 16:44:52 -04:00
|
|
|
@category{html}
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxHtmlLinkInfo : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Default ctor.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxHtmlLinkInfo();
|
2008-10-25 16:44:52 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Construct hypertext link from HREF (aka URL) and TARGET (name of target frame).
|
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxHtmlLinkInfo(const wxString& href,
|
|
|
|
const wxString& target = wxEmptyString);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Return pointer to event that generated OnLinkClicked() event.
|
|
|
|
Valid only within wxHtmlWindow::OnLinkClicked, @NULL otherwise.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
const wxMouseEvent* GetEvent() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Return @e HREF value of the \<A\> tag.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
wxString GetHref() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Return pointer to the cell that was clicked.
|
|
|
|
Valid only within wxHtmlWindow::OnLinkClicked, @NULL otherwise.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
const wxHtmlCell* GetHtmlCell() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-25 16:44:52 -04:00
|
|
|
Return @e TARGET value of the \<A\> tag (this value is used to specify
|
|
|
|
in which frame should be the page pointed by @ref GetHref() Href opened).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
wxString GetTarget() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-11-03 06:57:07 -05:00
|
|
|
/**
|
|
|
|
@class wxHtmlColourCell
|
|
|
|
|
|
|
|
This cell changes the colour of either the background or the foreground.
|
|
|
|
|
|
|
|
@library{wxhtml}
|
|
|
|
@category{html}
|
|
|
|
*/
|
|
|
|
class wxHtmlColourCell : public wxHtmlCell
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
|
|
|
|
@param clr
|
|
|
|
The color
|
|
|
|
@param flags
|
|
|
|
Can be one of following:
|
|
|
|
- wxHTML_CLR_FOREGROUND: change color of text
|
|
|
|
- wxHTML_CLR_BACKGROUND: change background color
|
|
|
|
*/
|
|
|
|
wxHtmlColourCell(const wxColour& clr, int flags = wxHTML_CLR_FOREGROUND);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxHtmlWidgetCell
|
|
|
|
|
|
|
|
wxHtmlWidgetCell is a class that provides a connection between HTML cells and
|
|
|
|
widgets (an object derived from wxWindow).
|
|
|
|
You can use it to display things like forms, input boxes etc. in an HTML window.
|
|
|
|
|
|
|
|
wxHtmlWidgetCell takes care of resizing and moving window.
|
|
|
|
|
|
|
|
@library{wxhtml}
|
|
|
|
@category{html}
|
|
|
|
*/
|
|
|
|
class wxHtmlWidgetCell : public wxHtmlCell
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
|
|
|
|
@param wnd
|
|
|
|
Connected window. It is parent window @b must be the wxHtmlWindow object
|
|
|
|
within which it is displayed!
|
|
|
|
@param w
|
|
|
|
Floating width. If non-zero width of wnd window is adjusted so that it is
|
|
|
|
always w percents of parent container's width. (For example w = 100 means
|
|
|
|
that the window will always have same width as parent container).
|
|
|
|
*/
|
|
|
|
wxHtmlWidgetCell(wxWindow* wnd, int w = 0);
|
|
|
|
};
|