X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/79d6c01818cafa1d95973955c8c55519d9550cf1..0e0de6b8aa49309ba439fcfd7251967915749c09:/include/wx/html/htmlcell.h diff --git a/include/wx/html/htmlcell.h b/include/wx/html/htmlcell.h index 166f9be9d9..8de135b8f2 100644 --- a/include/wx/html/htmlcell.h +++ b/include/wx/html/htmlcell.h @@ -51,6 +51,9 @@ public: int GetWidth() const {return m_Width;} int GetHeight() const {return m_Height;} int GetDescent() const {return m_Descent;} + + const wxString& GetId() const { return m_id; } + void SetId(const wxString& id) { m_id = id; } // returns the link associated with this cell. The position is position within // the cell so it varies from 0 to m_Width, from 0 to m_Height @@ -60,7 +63,7 @@ public: // members access methods wxHtmlCell *GetNext() const {return m_Next;} - // members writin methods + // members writing methods virtual void SetPos(int x, int y) {m_PosX = x, m_PosY = y;} void SetLink(const wxHtmlLinkInfo& link); void SetNext(wxHtmlCell *cell) {m_Next = cell;} @@ -91,8 +94,7 @@ public: virtual const wxHtmlCell* Find(int condition, const void* param) const; // This function is called when mouse button is clicked over the cell. - // left, middle, right are flags indicating whether the button was or wasn't - // pressed. + // // Parent is pointer to wxHtmlWindow that generated the event // HINT: if this handling is not enough for you you should use // wxHtmlBinderCell @@ -118,20 +120,32 @@ public: // called Layout() before! virtual void GetHorizontalConstraints(int *left, int *right) const; + // Returns true for simple == terminal cells, i.e. not composite ones. + // This if for internal usage only and may disappear in future versions! + virtual bool IsTerminalCell() const { return TRUE; } + + // Find the terminal cell inside this cell at the given position (relative + // to this cell) + // + // Returns NULL if not found + virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y) const; + protected: wxHtmlCell *m_Next; // pointer to the next cell wxHtmlContainerCell *m_Parent; - // pointer to parent cell + // pointer to parent cell long m_Width, m_Height, m_Descent; // dimensions of fragment // m_Descent is used to position text&images.. long m_PosX, m_PosY; // position where the fragment is drawn wxHtmlLinkInfo *m_Link; - // destination address if this fragment is hypertext link, "" otherwise + // destination address if this fragment is hypertext link, NULL otherwise bool m_CanLiveOnPagebreak; // true if this cell can be placed on pagebreak, false otherwise + wxString m_id; + // unique identifier of the cell, generated from "id" property of tags }; @@ -214,6 +228,11 @@ public: // returns pointer to the first cell in container or NULL wxHtmlCell* GetFirstCell() const {return m_Cells;} + // see comment in wxHtmlCell about this method + virtual bool IsTerminalCell() const { return false; } + + virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y) const; + protected: int m_IndentLeft, m_IndentRight, m_IndentTop, m_IndentBottom; // indentation of subcells. There is always m_Indent pixels