1 /* This file is part of the KDE project
2 Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef __konq_actions_h__
21 #define __konq_actions_h__
23 #include <ktoolbarpopupaction.h>
24 #include <konqhistorymanager.h>
25 #include <kactionmenu.h>
26 #include <QtGui/QWidget>
27 #include <QtCore/QList>
32 namespace KonqActions
{
33 void fillHistoryPopup(const QList
<HistoryEntry
*> &history
, int historyIndex
,
41 * Plug this action into a menu to get a bidirectional history
42 * (both back and forward, including current location)
44 class KonqBidiHistoryAction
: public KToolBarPopupAction
48 KonqBidiHistoryAction( const QString
& text
, QObject
* parent
);
49 virtual ~KonqBidiHistoryAction();
51 void fillGoMenu( const QList
<HistoryEntry
*> &history
, int historyIndex
);
54 void slotTriggered( QAction
* action
);
57 void menuAboutToShow();
58 // -1 for one step back, 0 for don't move, +1 for one step forward, etc.
62 int m_currentPos
; // == history.at()
69 class KonqMostOftenURLSAction
: public KActionMenu
74 KonqMostOftenURLSAction( const QString
& text
, QObject
* parent
);
75 virtual ~KonqMostOftenURLSAction();
77 static bool numberOfVisitOrder( const KonqHistoryEntry
& lhs
, const KonqHistoryEntry
& rhs
) {
78 return lhs
.numberOfTimesVisited
< rhs
.numberOfTimesVisited
;
82 void activated(const KUrl
&);
85 void slotHistoryCleared();
86 void slotEntryAdded( const KonqHistoryEntry
& entry
);
87 void slotEntryRemoved( const KonqHistoryEntry
& entry
);
90 void slotActivated(QAction
* action
);
95 static void inSort( const KonqHistoryEntry
& entry
);
101 class KonqHistoryAction
: public KActionMenu
106 KonqHistoryAction(const QString
& text
, QObject
* parent
);
107 virtual ~KonqHistoryAction();
110 void activated(const KUrl
&);
114 void slotActivated(QAction
* action
);