Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / khelpcenter / history.h
blob6da64adbe7e25a94b14673336bece250625abdf5
1 /*
2 * This file is 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 HISTORY_H
21 #define HISTORY_H
23 #include <kurl.h>
25 #include <QObject>
26 #include <Qt3Support/Q3PtrList>
27 #include <QMenu>
29 class KActionCollection;
30 class KXmlGuiWindow;
31 class KToolBarPopupAction;
32 class QMenu;
34 namespace KHC {
36 class View;
38 class History : public QObject
40 Q_OBJECT
41 public:
42 friend class foo; // to make gcc shut up
43 struct Entry
45 Entry() : view( 0 ), search( false ) {}
47 View *view;
48 KUrl url;
49 QString title;
50 QByteArray buffer;
51 bool search;
54 static History &self();
56 void setupActions( KActionCollection *coll );
57 void updateActions();
59 void installMenuBarHook( KXmlGuiWindow *mainWindow );
61 void createEntry();
62 void updateCurrentEntry( KHC::View *view );
64 Q_SIGNALS:
65 void goInternalUrl( const KUrl & );
66 void goUrl( const KUrl & );
68 private Q_SLOTS:
69 void backActivated( int id );
70 void fillBackMenu();
71 void forwardActivated( int id );
72 void fillForwardMenu();
73 void goMenuActivated( int id );
74 void fillGoMenu();
75 void back();
76 void forward();
77 void goHistoryActivated( int steps );
78 void goHistory( int steps );
79 void goHistoryDelayed();
81 private:
82 History();
83 History( const History &rhs );
84 History &operator=( const History &rhs );
85 ~History();
87 bool canGoBack() const;
88 bool canGoForward() const;
89 void fillHistoryPopup( QMenu *, bool, bool, bool, uint = 0 );
91 static History *m_instance;
93 Q3PtrList<Entry> m_entries;
96 int m_goBuffer;
97 int m_goMenuIndex;
98 int m_goMenuHistoryStartPos;
99 int m_goMenuHistoryCurrentPos;
100 public:
101 KToolBarPopupAction *m_backAction;
102 KToolBarPopupAction *m_forwardAction;
107 #endif // HISTORY_H
108 // vim:ts=2:sw=2:et