]> git.saurik.com Git - wxWidgets.git/blob - include/wx/html/htmlcell.h
First hack at wxBrush for wxCocoa
[wxWidgets.git] / include / wx / html / htmlcell.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: htmlcell.h
3 // Purpose: wxHtmlCell class is used by wxHtmlWindow/wxHtmlWinParser
4 // as a basic visual element of HTML page
5 // Author: Vaclav Slavik
6 // RCS-ID: $Id$
7 // Copyright: (c) 1999-2003 Vaclav Slavik
8 // Licence: wxWindows Licence
9 /////////////////////////////////////////////////////////////////////////////
10
11
12 #ifndef _WX_HTMLCELL_H_
13 #define _WX_HTMLCELL_H_
14
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "htmlcell.h"
17 #endif
18
19 #include "wx/defs.h"
20
21 #if wxUSE_HTML
22
23 #include "wx/html/htmltag.h"
24 #include "wx/html/htmldefs.h"
25 #include "wx/window.h"
26
27
28 class WXDLLIMPEXP_HTML wxHtmlLinkInfo;
29 class WXDLLIMPEXP_HTML wxHtmlCell;
30 class WXDLLIMPEXP_HTML wxHtmlContainerCell;
31
32
33 // wxHtmlSelection is data holder with information about text selection.
34 // Selection is defined by two positions (beginning and end of the selection)
35 // and two leaf(!) cells at these positions.
36 class WXDLLIMPEXP_HTML wxHtmlSelection
37 {
38 public:
39 wxHtmlSelection()
40 : m_fromPos(wxDefaultPosition), m_toPos(wxDefaultPosition),
41 m_fromPrivPos(wxDefaultPosition), m_toPrivPos(wxDefaultPosition),
42 m_fromCell(NULL), m_toCell(NULL) {}
43
44 void Set(const wxPoint& fromPos, const wxHtmlCell *fromCell,
45 const wxPoint& toPos, const wxHtmlCell *toCell);
46 void Set(const wxHtmlCell *fromCell, const wxHtmlCell *toCell);
47
48 const wxHtmlCell *GetFromCell() const { return m_fromCell; }
49 const wxHtmlCell *GetToCell() const { return m_toCell; }
50
51 // these values are in absolute coordinates:
52 const wxPoint& GetFromPos() const { return m_fromPos; }
53 const wxPoint& GetToPos() const { return m_toPos; }
54
55 // these are From/ToCell's private data
56 const wxPoint& GetFromPrivPos() const { return m_fromPrivPos; }
57 const wxPoint& GetToPrivPos() const { return m_toPrivPos; }
58 void SetFromPrivPos(const wxPoint& pos) { m_fromPrivPos = pos; }
59 void SetToPrivPos(const wxPoint& pos) { m_toPrivPos = pos; }
60 void ClearPrivPos() { m_toPrivPos = m_fromPrivPos = wxDefaultPosition; }
61
62 const bool IsEmpty() const
63 { return m_fromPos == wxDefaultPosition &&
64 m_toPos == wxDefaultPosition; }
65
66 private:
67 wxPoint m_fromPos, m_toPos;
68 wxPoint m_fromPrivPos, m_toPrivPos;
69 const wxHtmlCell *m_fromCell, *m_toCell;
70 };
71
72
73
74 enum wxHtmlSelectionState
75 {
76 wxHTML_SEL_OUT, // currently rendered cell is outside the selection
77 wxHTML_SEL_IN, // ... is inside selection
78 wxHTML_SEL_CHANGING // ... is the cell on which selection state changes
79 };
80
81 // Selection state is passed to wxHtmlCell::Draw so that it can render itself
82 // differently e.g. when inside text selection or outside it.
83 class WXDLLIMPEXP_HTML wxHtmlRenderingState
84 {
85 public:
86 wxHtmlRenderingState() : m_selState(wxHTML_SEL_OUT) {}
87
88 void SetSelectionState(wxHtmlSelectionState s) { m_selState = s; }
89 wxHtmlSelectionState GetSelectionState() const { return m_selState; }
90
91 void SetFgColour(const wxColour& c) { m_fgColour = c; }
92 const wxColour& GetFgColour() const { return m_fgColour; }
93 void SetBgColour(const wxColour& c) { m_bgColour = c; }
94 const wxColour& GetBgColour() const { return m_bgColour; }
95
96 private:
97 wxHtmlSelectionState m_selState;
98 wxColour m_fgColour, m_bgColour;
99 };
100
101
102 // HTML rendering customization. This class is used when rendering wxHtmlCells
103 // as a callback:
104 class WXDLLIMPEXP_HTML wxHtmlRenderingStyle
105 {
106 public:
107 virtual wxColour GetSelectedTextColour(const wxColour& clr) = 0;
108 virtual wxColour GetSelectedTextBgColour(const wxColour& clr) = 0;
109 };
110
111 // Standard style:
112 class WXDLLIMPEXP_HTML wxDefaultHtmlRenderingStyle : public wxHtmlRenderingStyle
113 {
114 public:
115 virtual wxColour GetSelectedTextColour(const wxColour& clr);
116 virtual wxColour GetSelectedTextBgColour(const wxColour& clr);
117 };
118
119
120 // Information given to cells when drawing them. Contains rendering state,
121 // selection information and rendering style object that can be used to
122 // customize the output.
123 class WXDLLIMPEXP_HTML wxHtmlRenderingInfo
124 {
125 public:
126 wxHtmlRenderingInfo() : m_selection(NULL), m_style(NULL) {}
127
128 void SetSelection(wxHtmlSelection *s) { m_selection = s; }
129 wxHtmlSelection *GetSelection() const { return m_selection; }
130
131 void SetStyle(wxHtmlRenderingStyle *style) { m_style = style; }
132 wxHtmlRenderingStyle& GetStyle() { return *m_style; }
133
134 wxHtmlRenderingState& GetState() { return m_state; }
135
136 protected:
137 wxHtmlSelection *m_selection;
138 wxHtmlRenderingStyle *m_style;
139 wxHtmlRenderingState m_state;
140 };
141
142
143 // Flags for wxHtmlCell::FindCellByPos
144 enum
145 {
146 wxHTML_FIND_EXACT = 1,
147 wxHTML_FIND_NEAREST_BEFORE = 2,
148 wxHTML_FIND_NEAREST_AFTER = 4
149 };
150
151
152
153
154 // ---------------------------------------------------------------------------
155 // wxHtmlCell
156 // Internal data structure. It represents fragments of parsed
157 // HTML page - a word, picture, table, horizontal line and so
158 // on. It is used by wxHtmlWindow to represent HTML page in
159 // memory.
160 // ---------------------------------------------------------------------------
161
162
163 class WXDLLIMPEXP_HTML wxHtmlCell : public wxObject
164 {
165 public:
166 wxHtmlCell();
167 virtual ~wxHtmlCell();
168
169 void SetParent(wxHtmlContainerCell *p) {m_Parent = p;}
170 wxHtmlContainerCell *GetParent() const {return m_Parent;}
171
172 int GetPosX() const {return m_PosX;}
173 int GetPosY() const {return m_PosY;}
174 int GetWidth() const {return m_Width;}
175 int GetHeight() const {return m_Height;}
176 int GetDescent() const {return m_Descent;}
177
178 const wxString& GetId() const { return m_id; }
179 void SetId(const wxString& id) { m_id = id; }
180
181 // returns the link associated with this cell. The position is position
182 // within the cell so it varies from 0 to m_Width, from 0 to m_Height
183 virtual wxHtmlLinkInfo* GetLink(int WXUNUSED(x) = 0,
184 int WXUNUSED(y) = 0) const
185 { return m_Link; }
186
187 // Returns cursor to be used when mouse is over the cell:
188 virtual wxCursor GetCursor() const;
189
190 // return next cell among parent's cells
191 wxHtmlCell *GetNext() const {return m_Next;}
192 // returns first child cell (if there are any, i.e. if this is container):
193 virtual wxHtmlCell* GetFirstChild() const { return NULL; }
194
195 // members writing methods
196 virtual void SetPos(int x, int y) {m_PosX = x, m_PosY = y;}
197 void SetLink(const wxHtmlLinkInfo& link);
198 void SetNext(wxHtmlCell *cell) {m_Next = cell;}
199
200 // 1. adjust cell's width according to the fact that maximal possible width
201 // is w. (this has sense when working with horizontal lines, tables
202 // etc.)
203 // 2. prepare layout (=fill-in m_PosX, m_PosY (and sometime m_Height)
204 // members) = place items to fit window, according to the width w
205 virtual void Layout(int w);
206
207 // renders the cell
208 virtual void Draw(wxDC& WXUNUSED(dc),
209 int WXUNUSED(x), int WXUNUSED(y),
210 int WXUNUSED(view_y1), int WXUNUSED(view_y2),
211 wxHtmlRenderingInfo& WXUNUSED(info)) {}
212
213 // proceed drawing actions in case the cell is not visible (scrolled out of
214 // screen). This is needed to change fonts, colors and so on.
215 virtual void DrawInvisible(wxDC& WXUNUSED(dc),
216 int WXUNUSED(x), int WXUNUSED(y),
217 wxHtmlRenderingInfo& WXUNUSED(info)) {}
218
219 // This method returns pointer to the FIRST cell for that
220 // the condition
221 // is true. It first checks if the condition is true for this
222 // cell and then calls m_Next->Find(). (Note: it checks
223 // all subcells if the cell is container)
224 // Condition is unique condition identifier (see htmldefs.h)
225 // (user-defined condition IDs should start from 10000)
226 // and param is optional parameter
227 // Example : m_Cell->Find(wxHTML_COND_ISANCHOR, "news");
228 // returns pointer to anchor news
229 virtual const wxHtmlCell* Find(int condition, const void* param) const;
230
231 // This function is called when mouse button is clicked over the cell.
232 //
233 // Parent is pointer to wxHtmlWindow that generated the event
234 // HINT: if this handling is not enough for you you should use
235 // wxHtmlWidgetCell
236 virtual void OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event);
237
238 // This method used to adjust pagebreak position. The parameter is variable
239 // that contains y-coordinate of page break (= horizontal line that should
240 // not be crossed by words, images etc.). If this cell cannot be divided
241 // into two pieces (each one on another page) then it moves the pagebreak
242 // few pixels up.
243 //
244 // Returned value : true if pagebreak was modified, false otherwise
245 // Usage : while (container->AdjustPagebreak(&p)) {}
246 virtual bool AdjustPagebreak(int *pagebreak,
247 int *known_pagebreaks = NULL,
248 int number_of_pages = 0) const;
249
250 // Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default
251 // is true - the cell can be split on two pages
252 void SetCanLiveOnPagebreak(bool can) { m_CanLiveOnPagebreak = can; }
253
254 // Returns y-coordinates that contraint the cell, i.e. left is highest
255 // and right lowest coordinate such that the cell lays between then.
256 // Note: this method does not return meaningful values if you haven't
257 // called Layout() before!
258 virtual void GetHorizontalConstraints(int *left, int *right) const;
259
260 // Returns true for simple == terminal cells, i.e. not composite ones.
261 // This if for internal usage only and may disappear in future versions!
262 virtual bool IsTerminalCell() const { return TRUE; }
263
264 // Find a cell inside this cell positioned at the given coordinates
265 // (relative to this's positions). Returns NULL if no such cell exists.
266 // The flag can be used to specify whether to look for terminal or
267 // nonterminal cells or both. In either case, returned cell is deepest
268 // cell in cells tree that contains [x,y].
269 virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y,
270 unsigned flags = wxHTML_FIND_EXACT) const;
271
272 // Returns absolute position of the cell on HTML canvas
273 wxPoint GetAbsPos() const;
274
275 // Returns first (last) terminal cell inside this cell. It may return NULL,
276 // but it is rare -- only if there are no terminals in the tree.
277 virtual wxHtmlCell *GetFirstTerminal() const
278 { return wxConstCast(this, wxHtmlCell); }
279 virtual wxHtmlCell *GetLastTerminal() const
280 { return wxConstCast(this, wxHtmlCell); }
281
282 // Returns cell's depth, i.e. how far under the root cell it is
283 // (if it is the root, depth is 0)
284 unsigned GetDepth() const;
285
286 // Returns true if the cell appears before 'cell' in natural order of
287 // cells (= as they are read). If cell A is (grand)parent of cell B,
288 // then both A.IsBefore(B) and B.IsBefore(A) always return true.
289 bool IsBefore(wxHtmlCell *cell) const;
290
291 // Converts the cell into text representation. If sel != NULL then
292 // only part of the cell inside the selection is converted.
293 virtual wxString ConvertToText(wxHtmlSelection *WXUNUSED(sel)) const
294 { return wxEmptyString; }
295
296 protected:
297 wxHtmlCell *m_Next;
298 // pointer to the next cell
299 wxHtmlContainerCell *m_Parent;
300 // pointer to parent cell
301 long m_Width, m_Height, m_Descent;
302 // dimensions of fragment
303 // m_Descent is used to position text&images..
304 long m_PosX, m_PosY;
305 // position where the fragment is drawn
306 wxHtmlLinkInfo *m_Link;
307 // destination address if this fragment is hypertext link, NULL otherwise
308 bool m_CanLiveOnPagebreak;
309 // true if this cell can be placed on pagebreak, false otherwise
310 wxString m_id;
311 // unique identifier of the cell, generated from "id" property of tags
312
313 DECLARE_NO_COPY_CLASS(wxHtmlCell)
314 };
315
316
317
318
319 // ----------------------------------------------------------------------------
320 // Inherited cells:
321 // ----------------------------------------------------------------------------
322
323
324 // ----------------------------------------------------------------------------
325 // wxHtmlWordCell
326 // Single word in input stream.
327 // ----------------------------------------------------------------------------
328
329 class WXDLLIMPEXP_HTML wxHtmlWordCell : public wxHtmlCell
330 {
331 public:
332 wxHtmlWordCell(const wxString& word, wxDC& dc);
333 void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2,
334 wxHtmlRenderingInfo& info);
335 wxCursor GetCursor() const;
336 wxString ConvertToText(wxHtmlSelection *sel) const;
337
338 protected:
339 void SetSelectionPrivPos(wxDC& dc, wxHtmlSelection *s) const;
340 void Split(wxDC& dc,
341 const wxPoint& selFrom, const wxPoint& selTo,
342 unsigned& pos1, unsigned& pos2) const;
343
344 wxString m_Word;
345 };
346
347
348
349
350
351 // Container contains other cells, thus forming tree structure of rendering
352 // elements. Basic code of layout algorithm is contained in this class.
353 class WXDLLIMPEXP_HTML wxHtmlContainerCell : public wxHtmlCell
354 {
355 public:
356 wxHtmlContainerCell(wxHtmlContainerCell *parent);
357 ~wxHtmlContainerCell();
358
359 virtual void Layout(int w);
360 virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2,
361 wxHtmlRenderingInfo& info);
362 virtual void DrawInvisible(wxDC& dc, int x, int y,
363 wxHtmlRenderingInfo& info);
364 virtual bool AdjustPagebreak(int *pagebreak, int *known_pagebreaks = NULL, int number_of_pages = 0) const;
365
366 // insert cell at the end of m_Cells list
367 void InsertCell(wxHtmlCell *cell);
368
369 // sets horizontal/vertical alignment
370 void SetAlignHor(int al) {m_AlignHor = al; m_LastLayout = -1;}
371 int GetAlignHor() const {return m_AlignHor;}
372 void SetAlignVer(int al) {m_AlignVer = al; m_LastLayout = -1;}
373 int GetAlignVer() const {return m_AlignVer;}
374
375 // sets left-border indentation. units is one of wxHTML_UNITS_* constants
376 // what is combination of wxHTML_INDENT_*
377 void SetIndent(int i, int what, int units = wxHTML_UNITS_PIXELS);
378 // returns the indentation. ind is one of wxHTML_INDENT_* constants
379 int GetIndent(int ind) const;
380 // returns type of value returned by GetIndent(ind)
381 int GetIndentUnits(int ind) const;
382
383 // sets alignment info based on given tag's params
384 void SetAlign(const wxHtmlTag& tag);
385 // sets floating width adjustment
386 // (examples : 32 percent of parent container,
387 // -15 pixels percent (this means 100 % - 15 pixels)
388 void SetWidthFloat(int w, int units) {m_WidthFloat = w; m_WidthFloatUnits = units; m_LastLayout = -1;}
389 void SetWidthFloat(const wxHtmlTag& tag, double pixel_scale = 1.0);
390 // sets minimal height of this container.
391 void SetMinHeight(int h, int align = wxHTML_ALIGN_TOP) {m_MinHeight = h; m_MinHeightAlign = align; m_LastLayout = -1;}
392
393 void SetBackgroundColour(const wxColour& clr) {m_UseBkColour = TRUE; m_BkColour = clr;}
394 // returns background colour (of wxNullColour if none set), so that widgets can
395 // adapt to it:
396 wxColour GetBackgroundColour();
397 void SetBorder(const wxColour& clr1, const wxColour& clr2) {m_UseBorder = TRUE; m_BorderColour1 = clr1, m_BorderColour2 = clr2;}
398 virtual wxHtmlLinkInfo* GetLink(int x = 0, int y = 0) const;
399 virtual const wxHtmlCell* Find(int condition, const void* param) const;
400 virtual void OnMouseClick(wxWindow *parent, int x, int y, const wxMouseEvent& event);
401 virtual void GetHorizontalConstraints(int *left, int *right) const;
402
403 virtual wxHtmlCell* GetFirstChild() const { return m_Cells; }
404 #if WXWIN_COMPATIBILITY_2_4
405 wxDEPRECATED( wxHtmlCell* GetFirstCell() const );
406 #endif
407
408 // see comment in wxHtmlCell about this method
409 virtual bool IsTerminalCell() const { return FALSE; }
410
411 virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y,
412 unsigned flags = wxHTML_FIND_EXACT) const;
413
414 virtual wxHtmlCell *GetFirstTerminal() const;
415 virtual wxHtmlCell *GetLastTerminal() const;
416
417 protected:
418 void UpdateRenderingStatePre(wxHtmlRenderingInfo& info,
419 wxHtmlCell *cell) const;
420 void UpdateRenderingStatePost(wxHtmlRenderingInfo& info,
421 wxHtmlCell *cell) const;
422
423 protected:
424 int m_IndentLeft, m_IndentRight, m_IndentTop, m_IndentBottom;
425 // indentation of subcells. There is always m_Indent pixels
426 // big space between given border of the container and the subcells
427 // it m_Indent < 0 it is in PERCENTS, otherwise it is in pixels
428 int m_MinHeight, m_MinHeightAlign;
429 // minimal height.
430 wxHtmlCell *m_Cells, *m_LastCell;
431 // internal cells, m_Cells points to the first of them, m_LastCell to the last one.
432 // (LastCell is needed only to speed-up InsertCell)
433 int m_AlignHor, m_AlignVer;
434 // alignment horizontal and vertical (left, center, right)
435 int m_WidthFloat, m_WidthFloatUnits;
436 // width float is used in adjustWidth
437 bool m_UseBkColour;
438 wxColour m_BkColour;
439 // background color of this container
440 bool m_UseBorder;
441 wxColour m_BorderColour1, m_BorderColour2;
442 // borders color of this container
443 int m_LastLayout;
444 // if != -1 then call to Layout may be no-op
445 // if previous call to Layout has same argument
446
447 DECLARE_NO_COPY_CLASS(wxHtmlContainerCell)
448 };
449
450 #if WXWIN_COMPATIBILITY_2_4
451 inline wxHtmlCell* wxHtmlContainerCell::GetFirstCell() const
452 { return GetFirstChild(); }
453 #endif
454
455
456
457
458 // ---------------------------------------------------------------------------
459 // wxHtmlColourCell
460 // Color changer.
461 // ---------------------------------------------------------------------------
462
463 class WXDLLIMPEXP_HTML wxHtmlColourCell : public wxHtmlCell
464 {
465 public:
466 wxHtmlColourCell(const wxColour& clr, int flags = wxHTML_CLR_FOREGROUND) : wxHtmlCell() {m_Colour = clr; m_Flags = flags;}
467 virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2,
468 wxHtmlRenderingInfo& info);
469 virtual void DrawInvisible(wxDC& dc, int x, int y,
470 wxHtmlRenderingInfo& info);
471
472 protected:
473 wxColour m_Colour;
474 unsigned m_Flags;
475 };
476
477
478
479
480 //--------------------------------------------------------------------------------
481 // wxHtmlFontCell
482 // Sets actual font used for text rendering
483 //--------------------------------------------------------------------------------
484
485 class WXDLLIMPEXP_HTML wxHtmlFontCell : public wxHtmlCell
486 {
487 public:
488 wxHtmlFontCell(wxFont *font) : wxHtmlCell() { m_Font = (*font); }
489 virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2,
490 wxHtmlRenderingInfo& info);
491 virtual void DrawInvisible(wxDC& dc, int x, int y,
492 wxHtmlRenderingInfo& info);
493
494 protected:
495 wxFont m_Font;
496 };
497
498
499
500
501
502
503 //--------------------------------------------------------------------------------
504 // wxHtmlwidgetCell
505 // This cell is connected with wxWindow object
506 // You can use it to insert windows into HTML page
507 // (buttons, input boxes etc.)
508 //--------------------------------------------------------------------------------
509
510 class WXDLLIMPEXP_HTML wxHtmlWidgetCell : public wxHtmlCell
511 {
512 public:
513 // !!! wnd must have correct parent!
514 // if w != 0 then the m_Wnd has 'floating' width - it adjust
515 // it's width according to parent container's width
516 // (w is percent of parent's width)
517 wxHtmlWidgetCell(wxWindow *wnd, int w = 0);
518 ~wxHtmlWidgetCell() { m_Wnd->Destroy(); }
519 virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2,
520 wxHtmlRenderingInfo& info);
521 virtual void DrawInvisible(wxDC& dc, int x, int y,
522 wxHtmlRenderingInfo& info);
523 virtual void Layout(int w);
524
525 protected:
526 wxWindow* m_Wnd;
527 int m_WidthFloat;
528 // width float is used in adjustWidth (it is in percents)
529
530 DECLARE_NO_COPY_CLASS(wxHtmlWidgetCell)
531 };
532
533
534
535 //--------------------------------------------------------------------------------
536 // wxHtmlLinkInfo
537 // Internal data structure. It represents hypertext link
538 //--------------------------------------------------------------------------------
539
540 class WXDLLIMPEXP_HTML wxHtmlLinkInfo : public wxObject
541 {
542 public:
543 wxHtmlLinkInfo() : wxObject()
544 { m_Href = m_Target = wxEmptyString; m_Event = NULL, m_Cell = NULL; }
545 wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString) : wxObject()
546 { m_Href = href; m_Target = target; m_Event = NULL, m_Cell = NULL; }
547 wxHtmlLinkInfo(const wxHtmlLinkInfo& l) : wxObject()
548 { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event;
549 m_Cell = l.m_Cell; }
550 wxHtmlLinkInfo& operator=(const wxHtmlLinkInfo& l)
551 { m_Href = l.m_Href, m_Target = l.m_Target, m_Event = l.m_Event;
552 m_Cell = l.m_Cell; return *this; }
553
554 void SetEvent(const wxMouseEvent *e) { m_Event = e; }
555 void SetHtmlCell(const wxHtmlCell *e) { m_Cell = e; }
556
557 wxString GetHref() const { return m_Href; }
558 wxString GetTarget() const { return m_Target; }
559 const wxMouseEvent* GetEvent() const { return m_Event; }
560 const wxHtmlCell* GetHtmlCell() const { return m_Cell; }
561
562 private:
563 wxString m_Href, m_Target;
564 const wxMouseEvent *m_Event;
565 const wxHtmlCell *m_Cell;
566 };
567
568
569
570 // ----------------------------------------------------------------------------
571 // wxHtmlTerminalCellsInterator
572 // ----------------------------------------------------------------------------
573
574 class WXDLLIMPEXP_HTML wxHtmlTerminalCellsInterator
575 {
576 public:
577 wxHtmlTerminalCellsInterator(const wxHtmlCell *from, const wxHtmlCell *to)
578 : m_to(to), m_pos(from) {}
579
580 operator bool() const { return m_pos != NULL; }
581 const wxHtmlCell* operator++();
582 const wxHtmlCell* operator->() const { return m_pos; }
583 const wxHtmlCell* operator*() const { return m_pos; }
584
585 private:
586 const wxHtmlCell *m_to, *m_pos;
587 };
588
589
590
591 #endif // wxUSE_HTML
592
593 #endif // _WX_HTMLCELL_H_
594