kbookmarkmenu.h
// -*- c-basic-offset:4; indent-tabs-mode:nil -*-
// vim: set ts=4 sts=4 sw=4 et:
/* This file is part of the KDE project
Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __kbookmarkmenu_h__
#define __kbookmarkmenu_h__
#include <sys/types.h>
#include <qptrlist.h>
#include <qptrstack.h>
#include <qobject.h>
#include <qlistview.h>
#include <kdialogbase.h>
#include <klocale.h>
#include <kaction.h>
#include "kbookmark.h"
#include "kbookmarkmanager.h"
class QString;
class QPopupMenu;
class QPushButton;
class QListView;
class KLineEdit;
class KBookmark;
class KBookmarkGroup;
class KAction;
class KActionMenu;
class KActionCollection;
class KBookmarkOwner;
class KBookmarkMenu;
class KPopupMenu;
namespace KIO { class Job; }
class KIO_EXPORT KBookmarkMenu : public QObject
{
Q_OBJECT
friend class KBookmarkMenuNSImporter;
friend class RMB;
public:
KBookmarkMenu( KBookmarkManager* mgr,
KBookmarkOwner * owner, KPopupMenu * parentMenu,
KActionCollection * collec, bool root, bool add = true,
const QString & parentAddress = "" );
~KBookmarkMenu();
void fillBookmarkMenu();
void ensureUpToDate();
// TODO - transform into class
struct DynMenuInfo {
bool show;
QString location;
QString type;
QString name;
class DynMenuInfoPrivate *d;
};
static DynMenuInfo showDynamicBookmarks( const QString &id );
static void setDynamicBookmarks( const QString &id, const DynMenuInfo &info );
static QStringList dynamicBookmarksList();
signals:
void aboutToShowContextMenu( const KBookmark &, QPopupMenu * );
void openBookmark( const QString& url, Qt::ButtonState state );
public slots: // public for bookmark bar
void slotBookmarksChanged( const QString & );
protected slots:
void slotAboutToShow();
void slotAboutToShowContextMenu( KPopupMenu *, int, QPopupMenu * );
void slotActionHighlighted( KAction * );
void slotRMBActionRemove( int );
void slotRMBActionInsert( int );
void slotRMBActionCopyLocation( int );
void slotRMBActionEditAt( int );
void slotRMBActionProperties( int );
void slotBookmarkSelected();
void slotBookmarkSelected( KAction::ActivationReason reason, Qt::ButtonState state );
void slotAddBookmarksList();
void slotAddBookmark();
void slotNewFolder();
void slotNSLoad();
protected:
KExtendedBookmarkOwner* extOwner();
void refill();
void addAddBookmark();
void addAddBookmarksList();
void addEditBookmarks();
void addNewFolder();
void fillContextMenu( QPopupMenu *, const QString &, int );
bool m_bIsRoot:1;
bool m_bAddBookmark:1;
bool m_bDirty:1;
bool m_bNSBookmark:1;
bool m_bAddShortcuts:1;
KBookmarkManager * m_pManager;
KBookmarkOwner *m_pOwner;
KPopupMenu * m_parentMenu;
QPtrList<KBookmarkMenu> m_lstSubMenus;
KActionCollection * m_actionCollection;
QPtrList<KAction> m_actions;
QString m_parentAddress;
// TODO make non static!
static QString s_highlightedAddress;
static QString s_highlightedImportLocation;
static QString s_highlightedImportType;
};
class KIO_EXPORT KBookmarkMenuNSImporter : public QObject
{
Q_OBJECT
public:
KBookmarkMenuNSImporter( KBookmarkManager* mgr, KBookmarkMenu * menu, KActionCollection * act ) :
m_menu(menu), m_actionCollection(act), m_pManager(mgr) {}
void openNSBookmarks();
void openBookmarks( const QString &location, const QString &type );
void connectToImporter( const QObject &importer );
protected slots:
void newBookmark( const QString & text, const QCString & url, const QString & );
void newFolder( const QString & text, bool, const QString & );
void newSeparator();
void endFolder();
protected:
QPtrStack<KBookmarkMenu> mstack;
KBookmarkMenu * m_menu;
KActionCollection * m_actionCollection;
KBookmarkManager* m_pManager;
};
#endif
KBookmarkManager
This class implements the reading/writing of bookmarks in XML.
Definition: kbookmarkmanager.h:53
KExtendedBookmarkOwner
Definition: kbookmarkmanager.h:353
KBookmarkGroup
A group of bookmarks.
Definition: kbookmark.h:199
KBookmarkOwner
The KBookmarkMenu and KBookmarkBar classes gives the user the ability to either edit bookmarks or add...
Definition: kbookmarkmanager.h:317

KDE Home | KDE Accessibility Home | Description of Access Keys