X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/846f4568e5599a964ee04b186a263cd07b959d2f..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/html/htmlcell.h diff --git a/interface/wx/html/htmlcell.h b/interface/wx/html/htmlcell.h index 86351e6055..9abac27be7 100644 --- a/interface/wx/html/htmlcell.h +++ b/interface/wx/html/htmlcell.h @@ -2,11 +2,85 @@ // Name: html/htmlcell.h // Purpose: interface of wxHtml*Cell // Author: wxWidgets team -// RCS-ID: $Id$ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +/** + @class wxHtmlRenderingStyle + + wxHtmlSelection is data holder with information about text selection. + Selection is defined by two positions (beginning and end of the selection) + and two leaf(!) cells at these positions. + + @library{wxhtml} + @category{html} +*/ +class wxHtmlSelection +{ +public: + wxHtmlSelection(); + + // this version is used for the user selection defined with the mouse + void Set(const wxPoint& fromPos, const wxHtmlCell *fromCell, + const wxPoint& toPos, const wxHtmlCell *toCell); + void Set(const wxHtmlCell *fromCell, const wxHtmlCell *toCell); + + const wxHtmlCell *GetFromCell() const; + const wxHtmlCell *GetToCell() const; + + // these values are in absolute coordinates: + const wxPoint& GetFromPos() const; + const wxPoint& GetToPos() const; + + // these are From/ToCell's private data + void ClearFromToCharacterPos(); + bool AreFromToCharacterPosSet() const; + + void SetFromCharacterPos (wxCoord pos); + void SetToCharacterPos (wxCoord pos); + wxCoord GetFromCharacterPos () const; + wxCoord GetToCharacterPos () const; + + bool IsEmpty() const; +}; + + + +enum wxHtmlSelectionState +{ + wxHTML_SEL_OUT, // currently rendered cell is outside the selection + wxHTML_SEL_IN, // ... is inside selection + wxHTML_SEL_CHANGING // ... is the cell on which selection state changes +}; + + +/** + @class wxHtmlRenderingState + + Selection state is passed to wxHtmlCell::Draw so that it can render itself + differently e.g. when inside text selection or outside it. + + @library{wxhtml} + @category{html} +*/ +class wxHtmlRenderingState +{ +public: + wxHtmlRenderingState(); + + void SetSelectionState(wxHtmlSelectionState s); + wxHtmlSelectionState GetSelectionState() const; + + void SetFgColour(const wxColour& c); + const wxColour& GetFgColour() const; + void SetBgColour(const wxColour& c); + const wxColour& GetBgColour() const; + void SetBgMode(int m); + int GetBgMode() const; +}; + + /** @class wxHtmlRenderingStyle @@ -69,6 +143,25 @@ public: }; + +// Flags for wxHtmlCell::FindCellByPos +enum +{ + wxHTML_FIND_EXACT = 1, + wxHTML_FIND_NEAREST_BEFORE = 2, + wxHTML_FIND_NEAREST_AFTER = 4 +}; + + +// Superscript/subscript/normal script mode of a cell +enum wxHtmlScriptMode +{ + wxHTML_SCRIPT_NORMAL, + wxHTML_SCRIPT_SUB, + wxHTML_SCRIPT_SUP +}; + + /** @class wxHtmlCell @@ -225,9 +318,28 @@ public: @param window interface to the parent HTML window + + @see GetMouseCursorAt() */ virtual wxCursor GetMouseCursor(wxHtmlWindowInterface* window) const; + /** + Returns cursor to show when mouse pointer is over the specified point. + + This function should be overridden instead of GetMouseCursorAt() if + the cursor should depend on the exact position of the mouse in the + window. + + @param window + interface to the parent HTML window + @param rePos + Position to show cursor. + + @since 3.0 + */ + virtual wxCursor GetMouseCursorAt(wxHtmlWindowInterface* window, + const wxPoint& rePos) const; + /** Returns pointer to the next cell in list (see htmlcell.h if you're interested in details). @@ -619,3 +731,53 @@ public: */ wxHtmlWidgetCell(wxWindow* wnd, int w = 0); }; + + + +/** + @class wxHtmlWordCell + + This html cell represents a single word or text fragment in the document stream. + + @library{wxhtml} + @category{html} +*/ +class wxHtmlWordCell : public wxHtmlCell +{ +public: + wxHtmlWordCell(const wxString& word, const wxDC& dc); +}; + + +/** + @class wxHtmlWordWithTabsCell + + wxHtmlWordCell is a specialization for storing text fragments with + embedded tab characters. + + @library{wxhtml} + @category{html} +*/ +class wxHtmlWordWithTabsCell : public wxHtmlWordCell +{ +public: + wxHtmlWordWithTabsCell(const wxString& word, + const wxString& wordOrig, + size_t linepos, + const wxDC& dc); +}; + + +/** + @class wxHtmlFontCell + + This cell represents a font change in the document stream. + + @library{wxhtml} + @category{html} +*/ +class wxHtmlFontCell : public wxHtmlCell +{ +public: + wxHtmlFontCell(wxFont *font); +};