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 | #include "docentrytraverser.h" |
22 | #include "docmetainfo.h" |
23 | |
24 | using namespace KHC; |
25 | |
26 | void DocEntryTraverser::setNotifyee( DocMetaInfo *n ) |
27 | { |
28 | mNotifyee = n; |
29 | } |
30 | |
31 | void DocEntryTraverser::startProcess( DocEntry *entry ) |
32 | { |
33 | process( entry ); |
34 | mNotifyee->endProcess( entry, this ); |
35 | } |
36 | |
37 | DocEntryTraverser *DocEntryTraverser::childTraverser( DocEntry *parentEntry ) |
38 | { |
39 | DocEntryTraverser *child = createChild( parentEntry ); |
40 | if (!child) |
41 | return 0; |
42 | if ( child != this ) |
43 | { |
44 | child->mParent = this; |
45 | child->mNotifyee = mNotifyee; |
46 | } |
47 | return child; |
48 | } |
49 | |
50 | DocEntryTraverser *DocEntryTraverser::parentTraverser() |
51 | { |
52 | return mParent; |
53 | } |
54 | |
55 | void DocEntryTraverser::deleteTraverser() |
56 | { |
57 | delete this; |
58 | } |
59 | |
60 | void DocEntryTraverser::setParentEntry( DocEntry *entry ) |
61 | { |
62 | mParentEntry = entry; |
63 | } |
64 | |
65 | DocEntry *DocEntryTraverser::parentEntry() |
66 | { |
67 | return mParentEntry; |
68 | } |
69 | // vim:ts=2:sw=2:et |
70 |