X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5bddd46dde044ccb04952e027b4ec27bb1251bba..97929f6bd992c185834656b5e3fff5a50ba7360a:/interface/wx/html/htmlcell.h diff --git a/interface/wx/html/htmlcell.h b/interface/wx/html/htmlcell.h index 34b3c9c3a7..d5b53bd0e7 100644 --- a/interface/wx/html/htmlcell.h +++ b/interface/wx/html/htmlcell.h @@ -6,61 +6,67 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// + + /** - @class wxHtmlColourCell + @class wxHtmlRenderingStyle - This cell changes the colour of either the background or the foreground. + Allows HTML rendering customizations. + This class is used when rendering wxHtmlCells as a callback. @library{wxhtml} @category{html} + + @see wxHtmlRenderingInfo */ -class wxHtmlColourCell : public wxHtmlCell +class wxHtmlRenderingStyle { public: /** - Constructor. + Returns the colour to use for the selected text. + */ + virtual wxColour GetSelectedTextColour(const wxColour& clr) = 0; - @param clr - The color - @param flags - Can be one of following: - - wxHTML_CLR_FOREGROUND: change color of text - - wxHTML_CLR_BACKGROUND: change background color + /** + Returns the colour to use for the selected text's background. */ - wxHtmlColourCell(const wxColour& clr, int flags = wxHTML_CLR_FOREGROUND); + virtual wxColour GetSelectedTextBgColour(const wxColour& clr) = 0; }; - /** - @class wxHtmlWidgetCell + @class wxHtmlRenderingInfo - 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. + 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. @library{wxhtml} @category{html} + + @see @ref overview_html_cells, wxHtmlCell */ -class wxHtmlWidgetCell : public wxHtmlCell +class wxHtmlRenderingInfo { public: /** - Constructor. + Default ctor. + */ + wxHtmlRenderingInfo(); - @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). + //@{ + /** + Accessors. */ - wxHtmlWidgetCell(wxWindow* wnd, int w = 0); -}; + void SetSelection(wxHtmlSelection *s); + wxHtmlSelection *GetSelection() const; + + void SetStyle(wxHtmlRenderingStyle *style); + wxHtmlRenderingStyle& GetStyle(); + wxHtmlRenderingState& GetState(); + //@} +}; /** @@ -100,13 +106,14 @@ public: while (container->AdjustPagebreak(&p)) {} @endcode */ - virtual bool AdjustPagebreak(int* pagebreak); + virtual bool AdjustPagebreak(int* pagebreak, + wxArrayInt& known_pagebreaks) const; /** Renders the cell. @param dc - Device context to which the cell is to be drawn + Device context to which the cell is to be drawn. @param x,y Coordinates of parent's upper left corner (origin). You must add this to m_PosX,m_PosY when passing coordinates to dc's methods @@ -116,12 +123,14 @@ public: @endcode @param view_y1 y-coord of the first line visible in window. - This is used to optimize rendering speed + This is used to optimize rendering speed. @param view_y2 y-coord of the last line visible in window. - This is used to optimize rendering speed + This is used to optimize rendering speed. + @param info + Additional information for the rendering of the cell. */ - virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2); + virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2, wxHtmlRenderingInfo& info); /** This method is called instead of Draw() when the cell is certainly out of @@ -137,8 +146,10 @@ public: @code dc->DrawText("hello", x + m_PosX, y + m_PosY) @endcode + @param info + Additional information for the rendering of the cell. */ - virtual void DrawInvisible(wxDC& dc, int x, int y); + virtual void DrawInvisible(wxDC& dc, int x , int y, wxHtmlRenderingInfo& info); /** Returns pointer to itself if this cell matches condition (or if any of the @@ -182,7 +193,7 @@ public: /** Returns unique cell identifier if there is any, the empty string otherwise. */ - virtual wxString GetId() const; + const wxString& GetId() const; /** Returns hypertext link if associated with this cell or @NULL otherwise. @@ -284,13 +295,13 @@ public: Sets the next cell in the list. This shouldn't be called by user - it is to be used only by wxHtmlContainerCell::InsertCell. */ - void SetNext(wxHtmlCell cell); + void SetNext(wxHtmlCell* cell); /** Sets parent container of this cell. This is called from wxHtmlContainerCell::InsertCell. */ - void SetParent(wxHtmlContainerCell p); + void SetParent(wxHtmlContainerCell* p); /** Sets the cell's position within parent container. @@ -353,7 +364,7 @@ public: /** Inserts a new cell into the container. */ - void InsertCell(wxHtmlCell cell); + void InsertCell(wxHtmlCell* cell); /** Sets the container's alignment (both horizontal and vertical) according to @@ -536,3 +547,57 @@ public: wxString GetTarget() const; }; +/** + @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); +};