1 | |
2 | /* This file is part of the KDE project |
3 | Copyright 2002 Cornelius Schumacher <schumacher@kde.org> |
4 | |
5 | This program is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU General Public |
7 | License version 2 or at your option version 3 as published |
8 | by the Free Software Foundation. |
9 | |
10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU General Public License |
16 | along with this program; see the file COPYING. If not, write to |
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 | Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #ifndef KHC_DOCENTRYTRAVERSER_H |
22 | #define KHC_DOCENTRYTRAVERSER_H |
23 | |
24 | namespace KHC { |
25 | |
26 | class DocEntry; |
27 | class DocMetaInfo; |
28 | |
29 | class DocEntryTraverser |
30 | { |
31 | public: |
32 | DocEntryTraverser() : mNotifyee( 0 ), mParent( 0 ), mParentEntry( 0 ) {} |
33 | virtual ~DocEntryTraverser() {} |
34 | |
35 | void setNotifyee( DocMetaInfo * ); |
36 | |
37 | virtual void process( DocEntry * ) = 0; |
38 | |
39 | virtual void startProcess( DocEntry * ); |
40 | |
41 | virtual DocEntryTraverser *createChild( DocEntry *parentEntry ) = 0; |
42 | |
43 | virtual void deleteTraverser(); |
44 | |
45 | virtual void finishTraversal() {} |
46 | |
47 | DocEntryTraverser *childTraverser( DocEntry *parentEntry ); |
48 | virtual DocEntryTraverser *parentTraverser(); |
49 | |
50 | void setParentEntry( DocEntry * ); |
51 | DocEntry *parentEntry(); |
52 | |
53 | protected: |
54 | DocMetaInfo *mNotifyee; |
55 | DocEntryTraverser *mParent; |
56 | |
57 | private: |
58 | DocEntry *mParentEntry; |
59 | }; |
60 | |
61 | } |
62 | |
63 | #endif //KHC_DOCENTRYTRAVERSER_H |
64 | // vim:ts=2:sw=2:et |
65 | |