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., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
20
#ifndef __konq_actions_h__
21
#define __konq_actions_h__ "$Id: konq_actions.h,v 1.46 2003/11/14 00:23:41 faure Exp $"
23
#include <konq_historymgr.h>
31
* Plug this action into a menu to get a bidirectional history
32
* (both back and forward, including current location)
34
class KonqBidiHistoryAction : public KAction
38
KonqBidiHistoryAction( const QString & text, QObject* parent = 0, const char* name = 0 );
40
virtual ~KonqBidiHistoryAction() {};
42
virtual int plug( QWidget *widget, int index = -1 );
43
//virtual void unplug( QWidget *widget );
45
void fillGoMenu( const QPtrList<HistoryEntry> &history );
47
// Used by KonqHistoryAction and KonqBidiHistoryAction
48
static void fillHistoryPopup( const QPtrList<HistoryEntry> &history,
50
bool onlyBack = false,
51
bool onlyForward = false,
52
bool checkCurrentItem = false,
56
void slotActivated( int );
59
void menuAboutToShow();
60
// -1 for one step back, 0 for don't move, +1 for one step forward, etc.
61
void activated( int );
63
uint m_firstIndex; // first index in the Go menu
65
int m_currentPos; // == history.at()
66
QPopupMenu *m_goMenu; // hack
71
class KonqLogoAction : public KAction
75
KonqLogoAction( const QString& text, int accel = 0, QObject* parent = 0, const char* name = 0 );
76
KonqLogoAction( const QString& text, int accel,
77
QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
78
KonqLogoAction( const QString& text, const QIconSet& pix, int accel = 0,
79
QObject* parent = 0, const char* name = 0 );
80
KonqLogoAction( const QString& text, const QIconSet& pix, int accel,
81
QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
83
KonqLogoAction( const QStringList& icons, QObject* receiver,
84
const char* slot, QObject* parent, const char* name = 0 );
86
virtual int plug( QWidget *widget, int index = -1 );
87
virtual void updateIcon(int id);
96
class KonqViewModeAction : public KRadioAction
100
KonqViewModeAction( const QString &text, const QString &icon,
101
QObject *parent, const char *name );
102
virtual ~KonqViewModeAction();
104
virtual int plug( QWidget *widget, int index = -1 );
106
QPopupMenu *popupMenu() const { return m_menu; }
109
void slotPopupAboutToShow();
110
void slotPopupActivated();
111
void slotPopupAboutToHide();
114
bool m_popupActivated;
118
class MostOftenList : public KonqBaseHistoryList
122
* Ensures that the items are sorted by numberOfTimesVisited
124
virtual int compareItems( QPtrCollection::Item, QPtrCollection::Item );
127
class KonqMostOftenURLSAction : public KActionMenu
132
KonqMostOftenURLSAction( const QString& text, QObject *parent,
134
virtual ~KonqMostOftenURLSAction();
137
void activated( const KURL& );
140
void slotHistoryCleared();
141
void slotEntryAdded( const KonqHistoryEntry *entry );
142
void slotEntryRemoved( const KonqHistoryEntry *entry );
145
//void slotClearMenu();
147
void slotActivated( int );
153
static MostOftenList *s_mostEntries;
154
static uint s_maxEntries;
155
KURL::List m_popupList;
158
class KonqGoURLAction : public KAction
161
KonqGoURLAction( const QString &text, const QString &pix, int accel,
162
const QObject *receiver, const char *slot,
163
QObject *parent, const char *name );
165
virtual int plug( QWidget *widget, int index = -1 );