1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxHtmlCell class is used by wxHtmlWindow/wxHtmlWinParser
4 // as a basic visual element of HTML page
5 // Author: Vaclav Slavik
7 // Copyright: (c) 1999-2003 Vaclav Slavik
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_HTMLCELL_H_
12 #define _WX_HTMLCELL_H_
18 #include "wx/html/htmltag.h"
19 #include "wx/html/htmldefs.h"
20 #include "wx/window.h"
23 class WXDLLIMPEXP_HTML wxHtmlWindowInterface
;
24 class WXDLLIMPEXP_HTML wxHtmlLinkInfo
;
25 class WXDLLIMPEXP_HTML wxHtmlCell
;
26 class WXDLLIMPEXP_HTML wxHtmlContainerCell
;
29 // wxHtmlSelection is data holder with information about text selection.
30 // Selection is defined by two positions (beginning and end of the selection)
31 // and two leaf(!) cells at these positions.
32 class WXDLLIMPEXP_HTML wxHtmlSelection
36 : m_fromPos(wxDefaultPosition
), m_toPos(wxDefaultPosition
),
37 m_fromPrivPos(wxDefaultPosition
), m_toPrivPos(wxDefaultPosition
),
38 m_fromCell(NULL
), m_toCell(NULL
) {}
40 void Set(const wxPoint
& fromPos
, const wxHtmlCell
*fromCell
,
41 const wxPoint
& toPos
, const wxHtmlCell
*toCell
);
42 void Set(const wxHtmlCell
*fromCell
, const wxHtmlCell
*toCell
);
44 const wxHtmlCell
*GetFromCell() const { return m_fromCell
; }
45 const wxHtmlCell
*GetToCell() const { return m_toCell
; }
47 // these values are in absolute coordinates:
48 const wxPoint
& GetFromPos() const { return m_fromPos
; }
49 const wxPoint
& GetToPos() const { return m_toPos
; }
51 // these are From/ToCell's private data
52 const wxPoint
& GetFromPrivPos() const { return m_fromPrivPos
; }
53 const wxPoint
& GetToPrivPos() const { return m_toPrivPos
; }
54 void SetFromPrivPos(const wxPoint
& pos
) { m_fromPrivPos
= pos
; }
55 void SetToPrivPos(const wxPoint
& pos
) { m_toPrivPos
= pos
; }
56 void ClearPrivPos() { m_toPrivPos
= m_fromPrivPos
= wxDefaultPosition
; }
59 { return m_fromPos
== wxDefaultPosition
&&
60 m_toPos
== wxDefaultPosition
; }
63 wxPoint m_fromPos
, m_toPos
;
64 wxPoint m_fromPrivPos
, m_toPrivPos
;
65 const wxHtmlCell
*m_fromCell
, *m_toCell
;
70 enum wxHtmlSelectionState
72 wxHTML_SEL_OUT
, // currently rendered cell is outside the selection
73 wxHTML_SEL_IN
, // ... is inside selection
74 wxHTML_SEL_CHANGING
// ... is the cell on which selection state changes
77 // Selection state is passed to wxHtmlCell::Draw so that it can render itself
78 // differently e.g. when inside text selection or outside it.
79 class WXDLLIMPEXP_HTML wxHtmlRenderingState
82 wxHtmlRenderingState() : m_selState(wxHTML_SEL_OUT
) {}
84 void SetSelectionState(wxHtmlSelectionState s
) { m_selState
= s
; }
85 wxHtmlSelectionState
GetSelectionState() const { return m_selState
; }
87 void SetFgColour(const wxColour
& c
) { m_fgColour
= c
; }
88 const wxColour
& GetFgColour() const { return m_fgColour
; }
89 void SetBgColour(const wxColour
& c
) { m_bgColour
= c
; }
90 const wxColour
& GetBgColour() const { return m_bgColour
; }
93 wxHtmlSelectionState m_selState
;
94 wxColour m_fgColour
, m_bgColour
;
98 // HTML rendering customization. This class is used when rendering wxHtmlCells
100 class WXDLLIMPEXP_HTML wxHtmlRenderingStyle
103 virtual ~wxHtmlRenderingStyle() {}
104 virtual wxColour
GetSelectedTextColour(const wxColour
& clr
) = 0;
105 virtual wxColour
GetSelectedTextBgColour(const wxColour
& clr
) = 0;
109 class WXDLLIMPEXP_HTML wxDefaultHtmlRenderingStyle
: public wxHtmlRenderingStyle
112 virtual wxColour
GetSelectedTextColour(const wxColour
& clr
);
113 virtual wxColour
GetSelectedTextBgColour(const wxColour
& clr
);
117 // Information given to cells when drawing them. Contains rendering state,
118 // selection information and rendering style object that can be used to
119 // customize the output.
120 class WXDLLIMPEXP_HTML wxHtmlRenderingInfo
123 wxHtmlRenderingInfo() : m_selection(NULL
), m_style(NULL
) {}
125 void SetSelection(wxHtmlSelection
*s
) { m_selection
= s
; }
126 wxHtmlSelection
*GetSelection() const { return m_selection
; }
128 void SetStyle(wxHtmlRenderingStyle
*style
) { m_style
= style
; }
129 wxHtmlRenderingStyle
& GetStyle() { return *m_style
; }
131 wxHtmlRenderingState
& GetState() { return m_state
; }
134 wxHtmlSelection
*m_selection
;
135 wxHtmlRenderingStyle
*m_style
;
136 wxHtmlRenderingState m_state
;
140 // Flags for wxHtmlCell::FindCellByPos
143 wxHTML_FIND_EXACT
= 1,
144 wxHTML_FIND_NEAREST_BEFORE
= 2,
145 wxHTML_FIND_NEAREST_AFTER
= 4
149 // Superscript/subscript/normal script mode of a cell
150 enum wxHtmlScriptMode
152 wxHTML_SCRIPT_NORMAL
,
158 // ---------------------------------------------------------------------------
160 // Internal data structure. It represents fragments of parsed
161 // HTML page - a word, picture, table, horizontal line and so
162 // on. It is used by wxHtmlWindow to represent HTML page in
164 // ---------------------------------------------------------------------------
167 class WXDLLIMPEXP_HTML wxHtmlCell
: public wxObject
171 virtual ~wxHtmlCell();
173 void SetParent(wxHtmlContainerCell
*p
) {m_Parent
= p
;}
174 wxHtmlContainerCell
*GetParent() const {return m_Parent
;}
176 int GetPosX() const {return m_PosX
;}
177 int GetPosY() const {return m_PosY
;}
178 int GetWidth() const {return m_Width
;}
180 // Returns the maximum possible length of the cell.
181 // Call Layout at least once before using GetMaxTotalWidth()
182 virtual int GetMaxTotalWidth() const { return m_Width
; }
184 int GetHeight() const {return m_Height
;}
185 int GetDescent() const {return m_Descent
;}
187 void SetScriptMode(wxHtmlScriptMode mode
, long previousBase
);
188 wxHtmlScriptMode
GetScriptMode() const { return m_ScriptMode
; }
189 long GetScriptBaseline() { return m_ScriptBaseline
; }
191 // Formatting cells are not visible on the screen, they only alter
193 bool IsFormattingCell() const { return m_Width
== 0 && m_Height
== 0; }
195 const wxString
& GetId() const { return m_id
; }
196 void SetId(const wxString
& id
) { m_id
= id
; }
198 // returns the link associated with this cell. The position is position
199 // within the cell so it varies from 0 to m_Width, from 0 to m_Height
200 virtual wxHtmlLinkInfo
* GetLink(int WXUNUSED(x
) = 0,
201 int WXUNUSED(y
) = 0) const
204 // Returns cursor to be used when mouse is over the cell:
205 virtual wxCursor
GetCursor() const;
207 // return next cell among parent's cells
208 wxHtmlCell
*GetNext() const {return m_Next
;}
209 // returns first child cell (if there are any, i.e. if this is container):
210 virtual wxHtmlCell
* GetFirstChild() const { return NULL
; }
212 // members writing methods
213 virtual void SetPos(int x
, int y
) {m_PosX
= x
, m_PosY
= y
;}
214 void SetLink(const wxHtmlLinkInfo
& link
);
215 void SetNext(wxHtmlCell
*cell
) {m_Next
= cell
;}
217 // 1. adjust cell's width according to the fact that maximal possible width
218 // is w. (this has sense when working with horizontal lines, tables
220 // 2. prepare layout (=fill-in m_PosX, m_PosY (and sometime m_Height)
221 // members) = place items to fit window, according to the width w
222 virtual void Layout(int w
);
225 virtual void Draw(wxDC
& WXUNUSED(dc
),
226 int WXUNUSED(x
), int WXUNUSED(y
),
227 int WXUNUSED(view_y1
), int WXUNUSED(view_y2
),
228 wxHtmlRenderingInfo
& WXUNUSED(info
)) {}
230 // proceed drawing actions in case the cell is not visible (scrolled out of
231 // screen). This is needed to change fonts, colors and so on.
232 virtual void DrawInvisible(wxDC
& WXUNUSED(dc
),
233 int WXUNUSED(x
), int WXUNUSED(y
),
234 wxHtmlRenderingInfo
& WXUNUSED(info
)) {}
236 // This method returns pointer to the FIRST cell for that
238 // is true. It first checks if the condition is true for this
239 // cell and then calls m_Next->Find(). (Note: it checks
240 // all subcells if the cell is container)
241 // Condition is unique condition identifier (see htmldefs.h)
242 // (user-defined condition IDs should start from 10000)
243 // and param is optional parameter
244 // Example : m_Cell->Find(wxHTML_COND_ISANCHOR, "news");
245 // returns pointer to anchor news
246 virtual const wxHtmlCell
* Find(int condition
, const void* param
) const;
249 // This function is called when mouse button is clicked over the cell.
250 // Returns true if a link is clicked, false otherwise.
252 // 'window' is pointer to wxHtmlWindowInterface of the window which
253 // generated the event.
254 // HINT: if this handling is not enough for you you should use
256 virtual bool ProcessMouseClick(wxHtmlWindowInterface
*window
,
258 const wxMouseEvent
& event
);
260 #if WXWIN_COMPATIBILITY_2_6
261 // this was replaced by ProcessMouseClick, don't use in new code!
262 virtual void OnMouseClick(wxWindow
*window
,
263 int x
, int y
, const wxMouseEvent
& event
);
266 // This method used to adjust pagebreak position. The parameter is variable
267 // that contains y-coordinate of page break (= horizontal line that should
268 // not be crossed by words, images etc.). If this cell cannot be divided
269 // into two pieces (each one on another page) then it moves the pagebreak
272 // Returned value : true if pagebreak was modified, false otherwise
273 // Usage : while (container->AdjustPagebreak(&p)) {}
274 virtual bool AdjustPagebreak(int *pagebreak
,
275 int *known_pagebreaks
= NULL
,
276 int number_of_pages
= 0) const;
278 // Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default
279 // is true - the cell can be split on two pages
280 void SetCanLiveOnPagebreak(bool can
) { m_CanLiveOnPagebreak
= can
; }
282 // Can the line be broken before this cell?
283 virtual bool IsLinebreakAllowed() const
284 { return !IsFormattingCell(); }
286 // Returns true for simple == terminal cells, i.e. not composite ones.
287 // This if for internal usage only and may disappear in future versions!
288 virtual bool IsTerminalCell() const { return true; }
290 // Find a cell inside this cell positioned at the given coordinates
291 // (relative to this's positions). Returns NULL if no such cell exists.
292 // The flag can be used to specify whether to look for terminal or
293 // nonterminal cells or both. In either case, returned cell is deepest
294 // cell in cells tree that contains [x,y].
295 virtual wxHtmlCell
*FindCellByPos(wxCoord x
, wxCoord y
,
296 unsigned flags
= wxHTML_FIND_EXACT
) const;
298 // Returns absolute position of the cell on HTML canvas.
299 // If rootCell is provided, then it's considered to be the root of the
300 // hierarchy and the returned value is relative to it.
301 wxPoint
GetAbsPos(wxHtmlCell
*rootCell
= NULL
) const;
303 // Returns root cell of the hierarchy (i.e. grand-grand-...-parent that
304 // doesn't have a parent itself)
305 wxHtmlCell
*GetRootCell() const;
307 // Returns first (last) terminal cell inside this cell. It may return NULL,
308 // but it is rare -- only if there are no terminals in the tree.
309 virtual wxHtmlCell
*GetFirstTerminal() const
310 { return wxConstCast(this, wxHtmlCell
); }
311 virtual wxHtmlCell
*GetLastTerminal() const
312 { return wxConstCast(this, wxHtmlCell
); }
314 // Returns cell's depth, i.e. how far under the root cell it is
315 // (if it is the root, depth is 0)
316 unsigned GetDepth() const;
318 // Returns true if the cell appears before 'cell' in natural order of
319 // cells (= as they are read). If cell A is (grand)parent of cell B,
320 // then both A.IsBefore(B) and B.IsBefore(A) always return true.
321 bool IsBefore(wxHtmlCell
*cell
) const;
323 // Converts the cell into text representation. If sel != NULL then
324 // only part of the cell inside the selection is converted.
325 virtual wxString
ConvertToText(wxHtmlSelection
*WXUNUSED(sel
)) const
326 { return wxEmptyString
; }
329 // pointer to the next cell
331 // pointer to parent cell
332 wxHtmlContainerCell
*m_Parent
;
334 // dimensions of fragment (m_Descent is used to position text & images)
335 long m_Width
, m_Height
, m_Descent
;
336 // position where the fragment is drawn:
339 // superscript/subscript/normal:
340 wxHtmlScriptMode m_ScriptMode
;
341 long m_ScriptBaseline
;
343 // destination address if this fragment is hypertext link, NULL otherwise
344 wxHtmlLinkInfo
*m_Link
;
345 // true if this cell can be placed on pagebreak, false otherwise
346 bool m_CanLiveOnPagebreak
;
347 // unique identifier of the cell, generated from "id" property of tags
350 DECLARE_ABSTRACT_CLASS(wxHtmlCell
)
351 DECLARE_NO_COPY_CLASS(wxHtmlCell
)
357 // ----------------------------------------------------------------------------
359 // ----------------------------------------------------------------------------
362 // ----------------------------------------------------------------------------
364 // Single word in input stream.
365 // ----------------------------------------------------------------------------
367 class WXDLLIMPEXP_HTML wxHtmlWordCell
: public wxHtmlCell
370 wxHtmlWordCell(const wxString
& word
, const wxDC
& dc
);
371 void Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
,
372 wxHtmlRenderingInfo
& info
);
373 wxCursor
GetCursor() const;
374 wxString
ConvertToText(wxHtmlSelection
*sel
) const;
375 bool IsLinebreakAllowed() const { return m_allowLinebreak
; }
377 void SetPreviousWord(wxHtmlWordCell
*cell
);
380 void SetSelectionPrivPos(const wxDC
& dc
, wxHtmlSelection
*s
) const;
381 void Split(const wxDC
& dc
,
382 const wxPoint
& selFrom
, const wxPoint
& selTo
,
383 unsigned& pos1
, unsigned& pos2
) const;
386 bool m_allowLinebreak
;
388 DECLARE_ABSTRACT_CLASS(wxHtmlWordCell
)
389 DECLARE_NO_COPY_CLASS(wxHtmlWordCell
)
396 // Container contains other cells, thus forming tree structure of rendering
397 // elements. Basic code of layout algorithm is contained in this class.
398 class WXDLLIMPEXP_HTML wxHtmlContainerCell
: public wxHtmlCell
401 wxHtmlContainerCell(wxHtmlContainerCell
*parent
);
402 ~wxHtmlContainerCell();
404 virtual void Layout(int w
);
405 virtual void Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
,
406 wxHtmlRenderingInfo
& info
);
407 virtual void DrawInvisible(wxDC
& dc
, int x
, int y
,
408 wxHtmlRenderingInfo
& info
);
409 virtual bool AdjustPagebreak(int *pagebreak
, int *known_pagebreaks
= NULL
, int number_of_pages
= 0) const;
411 // insert cell at the end of m_Cells list
412 void InsertCell(wxHtmlCell
*cell
);
414 // sets horizontal/vertical alignment
415 void SetAlignHor(int al
) {m_AlignHor
= al
; m_LastLayout
= -1;}
416 int GetAlignHor() const {return m_AlignHor
;}
417 void SetAlignVer(int al
) {m_AlignVer
= al
; m_LastLayout
= -1;}
418 int GetAlignVer() const {return m_AlignVer
;}
420 // sets left-border indentation. units is one of wxHTML_UNITS_* constants
421 // what is combination of wxHTML_INDENT_*
422 void SetIndent(int i
, int what
, int units
= wxHTML_UNITS_PIXELS
);
423 // returns the indentation. ind is one of wxHTML_INDENT_* constants
424 int GetIndent(int ind
) const;
425 // returns type of value returned by GetIndent(ind)
426 int GetIndentUnits(int ind
) const;
428 // sets alignment info based on given tag's params
429 void SetAlign(const wxHtmlTag
& tag
);
430 // sets floating width adjustment
431 // (examples : 32 percent of parent container,
432 // -15 pixels percent (this means 100 % - 15 pixels)
433 void SetWidthFloat(int w
, int units
) {m_WidthFloat
= w
; m_WidthFloatUnits
= units
; m_LastLayout
= -1;}
434 void SetWidthFloat(const wxHtmlTag
& tag
, double pixel_scale
= 1.0);
435 // sets minimal height of this container.
436 void SetMinHeight(int h
, int align
= wxHTML_ALIGN_TOP
) {m_MinHeight
= h
; m_MinHeightAlign
= align
; m_LastLayout
= -1;}
438 void SetBackgroundColour(const wxColour
& clr
) {m_UseBkColour
= true; m_BkColour
= clr
;}
439 // returns background colour (of wxNullColour if none set), so that widgets can
441 wxColour
GetBackgroundColour();
442 void SetBorder(const wxColour
& clr1
, const wxColour
& clr2
) {m_UseBorder
= true; m_BorderColour1
= clr1
, m_BorderColour2
= clr2
;}
443 virtual wxHtmlLinkInfo
* GetLink(int x
= 0, int y
= 0) const;
444 virtual const wxHtmlCell
* Find(int condition
, const void* param
) const;
446 #if WXWIN_COMPATIBILITY_2_6
447 // this was replaced by ProcessMouseClick, don't use in new code!
448 virtual void OnMouseClick(wxWindow
*window
,
449 int x
, int y
, const wxMouseEvent
& event
);
451 virtual bool ProcessMouseClick(wxHtmlWindowInterface
*window
,
453 const wxMouseEvent
& event
);
455 virtual wxHtmlCell
* GetFirstChild() const { return m_Cells
; }
456 #if WXWIN_COMPATIBILITY_2_4
457 wxDEPRECATED( wxHtmlCell
* GetFirstCell() const );
459 // returns last child cell:
460 wxHtmlCell
* GetLastChild() const { return m_LastCell
; }
462 // see comment in wxHtmlCell about this method
463 virtual bool IsTerminalCell() const { return false; }
465 virtual wxHtmlCell
*FindCellByPos(wxCoord x
, wxCoord y
,
466 unsigned flags
= wxHTML_FIND_EXACT
) const;
468 virtual wxHtmlCell
*GetFirstTerminal() const;
469 virtual wxHtmlCell
*GetLastTerminal() const;
472 // Removes indentation on top or bottom of the container (i.e. above or
473 // below first/last terminal cell). For internal use only.
474 virtual void RemoveExtraSpacing(bool top
, bool bottom
);
476 // Returns the maximum possible length of the container.
477 // Call Layout at least once before using GetMaxTotalWidth()
478 virtual int GetMaxTotalWidth() const { return m_MaxTotalWidth
; }
481 void UpdateRenderingStatePre(wxHtmlRenderingInfo
& info
,
482 wxHtmlCell
*cell
) const;
483 void UpdateRenderingStatePost(wxHtmlRenderingInfo
& info
,
484 wxHtmlCell
*cell
) const;
487 int m_IndentLeft
, m_IndentRight
, m_IndentTop
, m_IndentBottom
;
488 // indentation of subcells. There is always m_Indent pixels
489 // big space between given border of the container and the subcells
490 // it m_Indent < 0 it is in PERCENTS, otherwise it is in pixels
491 int m_MinHeight
, m_MinHeightAlign
;
493 wxHtmlCell
*m_Cells
, *m_LastCell
;
494 // internal cells, m_Cells points to the first of them, m_LastCell to the last one.
495 // (LastCell is needed only to speed-up InsertCell)
496 int m_AlignHor
, m_AlignVer
;
497 // alignment horizontal and vertical (left, center, right)
498 int m_WidthFloat
, m_WidthFloatUnits
;
499 // width float is used in adjustWidth
502 // background color of this container
504 wxColour m_BorderColour1
, m_BorderColour2
;
505 // borders color of this container
507 // if != -1 then call to Layout may be no-op
508 // if previous call to Layout has same argument
510 // Maximum possible length if ignoring line wrap
513 DECLARE_ABSTRACT_CLASS(wxHtmlContainerCell
)
514 DECLARE_NO_COPY_CLASS(wxHtmlContainerCell
)
517 #if WXWIN_COMPATIBILITY_2_4
518 inline wxHtmlCell
* wxHtmlContainerCell
::GetFirstCell() const
519 { return GetFirstChild(); }
525 // ---------------------------------------------------------------------------
528 // ---------------------------------------------------------------------------
530 class WXDLLIMPEXP_HTML wxHtmlColourCell
: public wxHtmlCell
533 wxHtmlColourCell(const wxColour
& clr
, int flags
= wxHTML_CLR_FOREGROUND
) : wxHtmlCell() {m_Colour
= clr
; m_Flags
= flags
;}
534 virtual void Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
,
535 wxHtmlRenderingInfo
& info
);
536 virtual void DrawInvisible(wxDC
& dc
, int x
, int y
,
537 wxHtmlRenderingInfo
& info
);
543 DECLARE_ABSTRACT_CLASS(wxHtmlColourCell
)
544 DECLARE_NO_COPY_CLASS(wxHtmlColourCell
)
550 //--------------------------------------------------------------------------------
552 // Sets actual font used for text rendering
553 //--------------------------------------------------------------------------------
555 class WXDLLIMPEXP_HTML wxHtmlFontCell
: public wxHtmlCell
558 wxHtmlFontCell(wxFont
*font
) : wxHtmlCell() { m_Font
= (*font
); }
559 virtual void Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
,
560 wxHtmlRenderingInfo
& info
);
561 virtual void DrawInvisible(wxDC
& dc
, int x
, int y
,
562 wxHtmlRenderingInfo
& info
);
567 DECLARE_ABSTRACT_CLASS(wxHtmlFontCell
)
568 DECLARE_NO_COPY_CLASS(wxHtmlFontCell
)
576 //--------------------------------------------------------------------------------
578 // This cell is connected with wxWindow object
579 // You can use it to insert windows into HTML page
580 // (buttons, input boxes etc.)
581 //--------------------------------------------------------------------------------
583 class WXDLLIMPEXP_HTML wxHtmlWidgetCell
: public wxHtmlCell
586 // !!! wnd must have correct parent!
587 // if w != 0 then the m_Wnd has 'floating' width - it adjust
588 // it's width according to parent container's width
589 // (w is percent of parent's width)
590 wxHtmlWidgetCell(wxWindow
*wnd
, int w
= 0);
591 ~wxHtmlWidgetCell() { m_Wnd
->Destroy(); }
592 virtual void Draw(wxDC
& dc
, int x
, int y
, int view_y1
, int view_y2
,
593 wxHtmlRenderingInfo
& info
);
594 virtual void DrawInvisible(wxDC
& dc
, int x
, int y
,
595 wxHtmlRenderingInfo
& info
);
596 virtual void Layout(int w
);
601 // width float is used in adjustWidth (it is in percents)
603 DECLARE_ABSTRACT_CLASS(wxHtmlWidgetCell
)
604 DECLARE_NO_COPY_CLASS(wxHtmlWidgetCell
)
609 //--------------------------------------------------------------------------------
611 // Internal data structure. It represents hypertext link
612 //--------------------------------------------------------------------------------
614 class WXDLLIMPEXP_HTML wxHtmlLinkInfo
: public wxObject
617 wxHtmlLinkInfo() : wxObject()
618 { m_Href
= m_Target
= wxEmptyString
; m_Event
= NULL
, m_Cell
= NULL
; }
619 wxHtmlLinkInfo(const wxString
& href
, const wxString
& target
= wxEmptyString
) : wxObject()
620 { m_Href
= href
; m_Target
= target
; m_Event
= NULL
, m_Cell
= NULL
; }
621 wxHtmlLinkInfo(const wxHtmlLinkInfo
& l
) : wxObject()
622 { m_Href
= l
.m_Href
, m_Target
= l
.m_Target
, m_Event
= l
.m_Event
;
624 wxHtmlLinkInfo
& operator=(const wxHtmlLinkInfo
& l
)
625 { m_Href
= l
.m_Href
, m_Target
= l
.m_Target
, m_Event
= l
.m_Event
;
626 m_Cell
= l
.m_Cell
; return *this; }
628 void SetEvent(const wxMouseEvent
*e
) { m_Event
= e
; }
629 void SetHtmlCell(const wxHtmlCell
*e
) { m_Cell
= e
; }
631 wxString
GetHref() const { return m_Href
; }
632 wxString
GetTarget() const { return m_Target
; }
633 const wxMouseEvent
* GetEvent() const { return m_Event
; }
634 const wxHtmlCell
* GetHtmlCell() const { return m_Cell
; }
637 wxString m_Href
, m_Target
;
638 const wxMouseEvent
*m_Event
;
639 const wxHtmlCell
*m_Cell
;
644 // ----------------------------------------------------------------------------
645 // wxHtmlTerminalCellsInterator
646 // ----------------------------------------------------------------------------
648 class WXDLLIMPEXP_HTML wxHtmlTerminalCellsInterator
651 wxHtmlTerminalCellsInterator(const wxHtmlCell
*from
, const wxHtmlCell
*to
)
652 : m_to(to
), m_pos(from
) {}
654 operator bool() const { return m_pos
!= NULL
; }
655 const wxHtmlCell
* operator++();
656 const wxHtmlCell
* operator->() const { return m_pos
; }
657 const wxHtmlCell
* operator*() const { return m_pos
; }
660 const wxHtmlCell
*m_to
, *m_pos
;
667 #endif // _WX_HTMLCELL_H_