Fix crash if key bindings specified in profile cannot be found. Improve
[personal-kdebase.git] / apps / konqueror / src / konqactions.h
blob76c5af6b3e896d411547376fc5f8275996484510
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>
29 struct HistoryEntry;
30 class QMenu;
32 namespace KonqActions {
33 void fillHistoryPopup(const QList<HistoryEntry*> &history, int historyIndex,
34 QMenu * popup,
35 bool onlyBack,
36 bool onlyForward);
39 #if 0
40 /**
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
46 Q_OBJECT
47 public:
48 KonqBidiHistoryAction( const QString & text, QObject * parent );
49 virtual ~KonqBidiHistoryAction();
51 void fillGoMenu( const QList<HistoryEntry*> &history, int historyIndex );
53 protected Q_SLOTS:
54 void slotTriggered( QAction* action );
56 Q_SIGNALS:
57 void menuAboutToShow();
58 // -1 for one step back, 0 for don't move, +1 for one step forward, etc.
59 void step( int );
60 private:
61 int m_startPos;
62 int m_currentPos; // == history.at()
65 #endif
67 /////
69 class KonqMostOftenURLSAction : public KActionMenu
71 Q_OBJECT
73 public:
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;
81 Q_SIGNALS:
82 void activated(const KUrl&);
84 private Q_SLOTS:
85 void slotHistoryCleared();
86 void slotEntryAdded( const KonqHistoryEntry& entry );
87 void slotEntryRemoved( const KonqHistoryEntry& entry );
89 void slotFillMenu();
90 void slotActivated(QAction* action);
92 private:
93 void init();
94 void parseHistory();
95 static void inSort( const KonqHistoryEntry& entry );
96 bool m_parsingDone;
99 /////
101 class KonqHistoryAction : public KActionMenu
103 Q_OBJECT
105 public:
106 KonqHistoryAction(const QString& text, QObject* parent);
107 virtual ~KonqHistoryAction();
109 Q_SIGNALS:
110 void activated(const KUrl&);
112 private Q_SLOTS:
113 void slotFillMenu();
114 void slotActivated(QAction* action);
117 #endif