when a new activity is added, don't move more than necessary to show it
[kdebase.git] / runtime / khelpcenter / toc.h
blob0da57eab801a7d06c490ebb875bb531d032c40bd
1 /*
2 * toc.h - part of the KDE Help Center
4 * Copyright (C) 2002 Frerich Raabe (raabe@kde.org)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef KHC_TOC_H
21 #define KHC_TOC_H
23 #include "navigatoritem.h"
25 #include <QtXml/QtXml>
26 #include <Qt3Support/Q3CheckListItem>
27 #include <QObject>
29 #include <KProcess>
31 namespace KHC {
33 class TOC : public QObject
35 Q_OBJECT
36 public:
37 TOC( NavigatorItem *parentItem );
39 QString application() const { return m_application; }
40 void setApplication( const QString &application ) { m_application = application; }
42 public Q_SLOTS:
43 void build( const QString &file );
45 Q_SIGNALS:
46 void itemSelected( const QString &url );
48 private Q_SLOTS:
49 void slotItemSelected( Q3ListViewItem *item );
50 void meinprocExited( int exitCode, QProcess::ExitStatus exitStatus);
52 private:
53 enum CacheStatus { NeedRebuild, CacheOk };
55 CacheStatus cacheStatus() const;
56 int sourceFileCTime() const;
57 int cachedCTime() const;
58 QDomElement childElement( const QDomElement &e, const QString &name );
59 void buildCache();
60 void fillTree();
62 QString m_application;
63 QString m_cacheFile;
64 QString m_sourceFile;
66 NavigatorItem *m_parentItem;
67 static bool m_alreadyWarned;
72 #endif // KHC_TOC_H
73 // vim:ts=2:sw=2:et