DEADSOFTWARE

fix gcc 4.0
[odcread.git] / visitor / visitor.h
1 #ifndef _VISITOR_H_
2 #define _VISITOR_H_
4 namespace odc {
6 class ShortPiece;
7 class LongPiece;
9 /**
10 * Visitor role of the Visitor design pattern.
11 * Can be used to transform the document tree.
12 */
13 class Visitor {
14 public:
15 /**
16 * A "part" that can contain other elements starts here.
17 * This can be an StdTextModel or a ViewPiece or another container.
18 */
19 virtual void partStart() = 0;
20 /**
21 * A "part" ends here.
22 */
23 virtual void partEnd() = 0;
24 /**
25 * A left fold has been found.
26 * If the fold is collapsed, the first part that follows is the
27 * "hidden" part, otherwise the first part that follows is the
28 * "alternative" text. The rest is the vice versa.
29 * This is the main reason we even need a visitor.
30 * @param collapsed true if the fold is in collapsed form.
31 */
32 virtual void foldLeft(bool collapsed) = 0;
33 /**
34 * A right fold has been found.
35 */
36 virtual void foldRight() = 0;
37 /**
38 * A text piece has been found (8-bit characters).
39 */
40 virtual void textShortPiece(const ShortPiece *piece) = 0;
41 /**
42 * A text piece has been found (16-bit characters).
43 */
44 virtual void textLongPiece(const LongPiece *piece) = 0;
45 };
46 }
48 #endif // _VISITOR_H_