|
1 /****************************************************************************** |
|
2 * |
|
3 * $Id: linkedtexthandler.h 597 2007-09-25 19:13:15Z dimitri $ |
|
4 * |
|
5 * |
|
6 * Copyright (C) 1997-2006 by Dimitri van Heesch. |
|
7 * |
|
8 * Permission to use, copy, modify, and distribute this software and its |
|
9 * documentation under the terms of the GNU General Public License is hereby |
|
10 * granted. No representations are made about the suitability of this software |
|
11 * for any purpose. It is provided "as is" without express or implied warranty. |
|
12 * See the GNU General Public License for more details. |
|
13 * |
|
14 */ |
|
15 #ifndef LINKEDTEXTHANDLER_H |
|
16 #define LINKEDTEXTHANDLER_H |
|
17 |
|
18 #include "baseiterator.h" |
|
19 #include "basehandler.h" |
|
20 |
|
21 class LT_Ref; |
|
22 class LinkedTextImpl : public ILinkedText |
|
23 { |
|
24 public: |
|
25 virtual ~LinkedTextImpl() {} |
|
26 }; |
|
27 |
|
28 class LinkedTextHandler : public BaseHandler<LinkedTextHandler> |
|
29 { |
|
30 public: |
|
31 LinkedTextHandler(IBaseHandler *parent,QList<LinkedTextImpl> &children); |
|
32 virtual ~LinkedTextHandler(); |
|
33 virtual void start(const char *endTag); |
|
34 virtual void end(); |
|
35 virtual void startRef(const QXmlAttributes& attrib); |
|
36 virtual void endRef(); |
|
37 static QString toString(const QList<LinkedTextImpl> &list); |
|
38 |
|
39 // ILinkedText |
|
40 |
|
41 private: |
|
42 IBaseHandler *m_parent; |
|
43 QList<LinkedTextImpl> &m_children; |
|
44 LT_Ref *m_ref; |
|
45 }; |
|
46 |
|
47 class LinkedTextIterator : public BaseIterator<ILinkedTextIterator,ILinkedText,LinkedTextImpl> |
|
48 { |
|
49 public: |
|
50 LinkedTextIterator(const QList<LinkedTextImpl> &list) : |
|
51 BaseIterator<ILinkedTextIterator,ILinkedText,LinkedTextImpl>(list) {} |
|
52 }; |
|
53 |
|
54 #endif |