// Purpose: wxHtmlCell class is used by wxHtmlWindow/wxHtmlWinParser
// as a basic visual element of HTML page
// Author: Vaclav Slavik
+// RCS-ID: $Id$
// Copyright: (c) 1999 Vaclav Slavik
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __HTMLCELL_H__
-#define __HTMLCELL_H__
+#ifndef _WX_HTMLCELL_H_
+#define _WX_HTMLCELL_H_
#ifdef __GNUG__
-#pragma interface "htmlcell.h"
+#pragma interface
#endif
#include "wx/defs.h"
class WXDLLEXPORT wxHtmlCell : public wxObject
{
- protected:
- wxHtmlCell *m_Next;
- // pointer to the next cell
- wxHtmlContainerCell *m_Parent;
- // 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
- wxString m_Link;
- // destination address if this fragment is hypertext link, "" otherwise
-
public:
- wxHtmlCell() : wxObject() {m_Next = NULL; m_Parent = NULL; m_Width = m_Height = m_Descent = 0;};
+ wxHtmlCell() : wxObject() {m_Next = NULL; m_Parent = NULL; m_Width = m_Height = m_Descent = 0; m_CanLiveOnPagebreak = TRUE;}
virtual ~wxHtmlCell() {if (m_Next) delete m_Next;};
void SetParent(wxHtmlContainerCell *p) {m_Parent = p;}
// Parent is pointer to wxHtmlWindow that generated the event
// HINT: if this handling is not enough for you you should use
// wxHtmlBinderCell
+
+ virtual bool AdjustPagebreak(int *pagebreak);
+ // This method 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.
+ //
+ // Returned value : true if pagebreak was modified, false otherwise
+ // Usage : while (container->AdjustPagebreak(&p)) {}
+
+ void SetCanLiveOnPagebreak(bool can) {m_CanLiveOnPagebreak = can;}
+ // Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default
+ // is true - the cell can be split on two pages
+
+
+ protected:
+ wxHtmlCell *m_Next;
+ // pointer to the next cell
+ wxHtmlContainerCell *m_Parent;
+ // 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
+ wxString m_Link;
+ // destination address if this fragment is hypertext link, "" otherwise
+ bool m_CanLiveOnPagebreak;
+ // true if this cell can be placed on pagebreak, false otherwise
+
};
virtual void Layout(int w);
virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
virtual void DrawInvisible(wxDC& dc, int x, int y);
+ virtual bool AdjustPagebreak(int *pagebreak);
void InsertCell(wxHtmlCell *cell);
// insert cell at the end of m_Cells list
-
-#endif // __HTMLCELL_H__
-
#endif
-
-
-
-
-
-
+#endif // _WX_HTMLCELL_H_