00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef HISTORY_H
00021 #define HISTORY_H
00022
00023 #include <kurl.h>
00024
00025 #include <tqobject.h>
00026 #include <tqptrlist.h>
00027
00028 class KActionCollection;
00029 class KMainWindow;
00030 class KToolBarPopupAction;
00031 class TQPopupMenu;
00032
00033 namespace KHC {
00034
00035 class View;
00036
00037 class History : public QObject
00038 {
00039 Q_OBJECT
00040 public:
00041 friend class foo;
00042 struct Entry
00043 {
00044 Entry() : view( 0 ), search( false ) {}
00045
00046 View *view;
00047 KURL url;
00048 TQString title;
00049 TQByteArray buffer;
00050 bool search;
00051 };
00052
00053 static History &self();
00054
00055 void setupActions( KActionCollection *coll );
00056 void updateActions();
00057
00058 void installMenuBarHook( KMainWindow *mainWindow );
00059
00060 void createEntry();
00061 void updateCurrentEntry( KHC::View *view );
00062
00063 signals:
00064 void goInternalUrl( const KURL & );
00065 void goUrl( const KURL & );
00066
00067 private slots:
00068 void backActivated( int id );
00069 void fillBackMenu();
00070 void forwardActivated( int id );
00071 void fillForwardMenu();
00072 void goMenuActivated( int id );
00073 void fillGoMenu();
00074 void back();
00075 void forward();
00076 void goHistoryActivated( int steps );
00077 void goHistory( int steps );
00078 void goHistoryDelayed();
00079
00080 private:
00081 History();
00082 History( const History &rhs );
00083 History &operator=( const History &rhs );
00084 ~History();
00085
00086 bool canGoBack() const;
00087 bool canGoForward() const;
00088 void fillHistoryPopup( TQPopupMenu *, bool, bool, bool, uint = 0 );
00089
00090 static History *m_instance;
00091
00092 TQPtrList<Entry> m_entries;
00093
00094
00095 int m_goBuffer;
00096 int m_goMenuIndex;
00097 int m_goMenuHistoryStartPos;
00098 int m_goMenuHistoryCurrentPos;
00099 public:
00100 KToolBarPopupAction *m_backAction;
00101 KToolBarPopupAction *m_forwardAction;
00102 };
00103
00104 }
00105
00106 #endif // HISTORY_H
00107