Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / khelpcenter / navigator.h
blob55f63a956ce175213d751f9ea352586eb17958d4
1 /*
2 * This file is part of the KDE Help Center
4 * Copyright (C) 1999 Matthias Elter (me@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.
21 #ifndef __navigator_h__
22 #define __navigator_h__
24 #include "glossary.h"
26 #include <k3listview.h>
27 #include <kurl.h>
29 #include <QFile>
30 #include <QTextStream>
31 #include <QTimer>
32 #include <Qt3Support/Q3PtrList>
33 #include <QTabWidget>
34 #include <Qt3Support/Q3CheckListItem>
35 #include <Qt3Support/Q3Dict>
36 //Added by qt3to4:
37 #include <QFrame>
39 class QPushButton;
41 class K3ListView;
42 class KLineEdit;
44 class KCMHelpCenter;
46 namespace KHC {
48 class NavigatorItem;
49 class Navigator;
50 class View;
51 class SearchEngine;
52 class SearchWidget;
53 class Formatter;
55 class Navigator : public QWidget
57 Q_OBJECT
58 public:
59 explicit Navigator(View *, QWidget *parent=0, const char *name=0);
60 virtual ~Navigator();
62 KUrl homeURL();
64 SearchEngine *searchEngine() const;
65 Formatter *formatter() const;
67 const GlossaryEntry &glossEntry(const QString &term) const { return mGlossaryTree->entry( term ); }
69 void insertParentAppDocs( const QString &name, NavigatorItem *parent );
70 void insertAppletDocs( NavigatorItem *parent );
71 NavigatorItem *insertScrollKeeperDocs( NavigatorItem *parentItem,
72 NavigatorItem *after );
73 void insertInfoDocs( NavigatorItem *parentItem );
74 void insertIOSlaveDocs(const QString &, NavigatorItem*parent);
76 void createItemFromDesktopFile( NavigatorItem *item, const QString &name );
78 bool showMissingDocs() const;
80 void clearSelection();
82 void showOverview( NavigatorItem *item, const KUrl &url );
84 void readConfig();
85 void writeConfig();
87 public Q_SLOTS:
88 void openInternalUrl( const KUrl &url );
89 void slotItemSelected(Q3ListViewItem* index);
90 void slotSearch();
91 void slotShowSearchResult( const QString & );
92 void slotSelectGlossEntry( const QString &id );
93 void selectItem( const KUrl &url );
94 void showIndexDialog();
96 Q_SIGNALS:
97 void itemSelected(const QString& itemURL);
98 void glossSelected(const GlossaryEntry &entry);
100 protected Q_SLOTS:
101 void slotSearchFinished();
102 void slotTabChanged( QWidget * );
103 void checkSearchButton();
105 bool checkSearchIndex();
107 void clearSearch();
109 protected:
110 QString createChildrenList( Q3ListViewItem *child );
112 private:
113 void setupContentsTab();
114 void setupIndexTab();
115 void setupSearchTab();
116 void setupGlossaryTab();
118 void insertPlugins();
119 void hideSearch();
121 K3ListView *mContentsTree;
122 Glossary *mGlossaryTree;
124 SearchWidget *mSearchWidget;
125 KCMHelpCenter *mIndexDialog;
127 QTabWidget *mTabWidget;
129 QFrame *mSearchFrame;
130 KLineEdit *mSearchEdit;
131 QPushButton *mSearchButton;
133 bool mShowMissingDocs;
135 SearchEngine *mSearchEngine;
137 View *mView;
139 KUrl mHomeUrl;
141 bool mSelected;
143 KUrl mLastUrl;
145 int mDirLevel;
150 #endif
151 // vim:ts=2:sw=2:et