• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • bookmarks
kbookmarkmenu.h
Go to the documentation of this file.
1// -*- c-basic-offset:4; indent-tabs-mode:nil -*-
2// vim: set ts=4 sts=4 sw=4 et:
3/* This file is part of the KDE project
4 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
5 Copyright (C) 2006 Daniel Teske <teske@squorn.de>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
22
23#ifndef __kbookmarkmenu_h__
24#define __kbookmarkmenu_h__
25
26#include <sys/types.h>
27
28#include <QtCore/QObject>
29#include <QtCore/QStack>
30
31#include <klocale.h>
32#include <kaction.h>
33#include <kactionmenu.h>
34#include <kicon.h>
35#include <krun.h>
36#include <kmenu.h>
37
38#include "kbookmark.h"
39#include "kbookmarkmanager.h"
40
41class QString;
42class QMenu;
43class KBookmark;
44class KAction;
45class QAction;
46class KActionMenu;
47class KActionCollection;
48class KBookmarkOwner;
49class KBookmarkMenu;
50class KMenu;
51class KBookmarkActionInterface;
52
53class KBookmarkMenuPrivate; // Not implemented
54
55namespace KIO { class Job; }
56
76class KIO_EXPORT KBookmarkMenu : public QObject
77{
78 Q_OBJECT
79public:
95 KBookmarkMenu( KBookmarkManager* mgr, KBookmarkOwner * owner, KMenu * parentMenu, KActionCollection *collec);
96
103 KBookmarkMenu( KBookmarkManager* mgr, KBookmarkOwner * owner,
104 KMenu * parentMenu, const QString & parentAddress);
105
106 ~KBookmarkMenu();
107
112 void ensureUpToDate();
113
114public Q_SLOTS:
115 // public for KonqBookmarkBar
116 void slotBookmarksChanged( const QString & );
117
118protected Q_SLOTS:
119 void slotAboutToShow();
120 void slotAddBookmarksList();
121 void slotAddBookmark();
122 void slotNewFolder();
123 void slotOpenFolderInTabs();
124
125protected:
126 virtual void clear();
127 virtual void refill();
128 virtual QAction* actionForBookmark(const KBookmark &bm);
129 virtual KMenu * contextMenu(QAction * action );
130
131 void addActions();
132 void fillBookmarks();
133 void addAddBookmark();
134 void addAddBookmarksList();
135 void addEditBookmarks();
136 void addNewFolder();
137 void addOpenInTabs();
138
139
140 bool isRoot() const;
141 bool isDirty() const;
142
146 QString parentAddress() const;
147
148 KBookmarkManager * manager() const;
149 KBookmarkOwner * owner() const;
154 KMenu * parentMenu() const;
155
159 QList<KBookmarkMenu *> m_lstSubMenus;
160
161 // This is used to "export" our actions into an actionlist
162 // we got in the constructor. So that the program can show our
163 // actions in their shortcut dialog
164 KActionCollection * m_actionCollection;
168 QList<QAction *> m_actions;
169
170
171private Q_SLOTS:
172 void slotCustomContextMenu( const QPoint & );
173
174private:
175 KBookmarkMenuPrivate* d;
176
177 bool m_bIsRoot;
178 bool m_bDirty;
179 KBookmarkManager * m_pManager;
180 KBookmarkOwner * m_pOwner;
181
182 KMenu * m_parentMenu;
183
184private:
185 QString m_parentAddress;
186};
187
188class KIO_EXPORT KBookmarkContextMenu : public KMenu
189{
190 Q_OBJECT
191
192public:
193 KBookmarkContextMenu(const KBookmark & bm, KBookmarkManager * manager, KBookmarkOwner *owner, QWidget * parent = 0);
194 virtual ~KBookmarkContextMenu();
195 virtual void addActions();
196
197public Q_SLOTS:
198 void slotEditAt();
199 void slotProperties();
200 void slotInsert();
201 void slotRemove();
202 void slotCopyLocation();
203 void slotOpenFolderInTabs();
204
205protected:
206 void addBookmark();
207 void addFolderActions();
208 void addProperties();
209 void addBookmarkActions();
210 void addOpenFolderInTabs();
211
212 KBookmarkManager * manager() const;
213 KBookmarkOwner * owner() const;
214 KBookmark bookmark() const;
215
216private Q_SLOTS:
217 void slotAboutToShow();
218
219private:
220 KBookmark bm;
221 KBookmarkManager * m_pManager;
222 KBookmarkOwner * m_pOwner;
223};
224
225class KIO_EXPORT KBookmarkActionInterface
226{
227public:
228 KBookmarkActionInterface(const KBookmark &bk);
229 virtual ~KBookmarkActionInterface();
230 const KBookmark bookmark() const;
231private:
232 KBookmark bm;
233};
234
235/***
236 * A wrapper around KActionMenu to provide a nice constructor for bookmark groups.
237 *
238 */
239
240class KIO_EXPORT KBookmarkActionMenu : public KActionMenu, public KBookmarkActionInterface
241{
242public:
243 KBookmarkActionMenu(const KBookmark &bm, QObject *parent);
244 KBookmarkActionMenu(const KBookmark &bm, const QString & text, QObject *parent);
245 virtual ~KBookmarkActionMenu();
246};
247
248/***
249 * This class is a KAction for bookmarks.
250 * It provides a nice constructor.
251 * And on triggered uses the owner to open the bookmark.
252 *
253 */
254
255class KIO_EXPORT KBookmarkAction : public KAction, public KBookmarkActionInterface
256{
257 Q_OBJECT
258public:
259 KBookmarkAction(const KBookmark &bk, KBookmarkOwner* owner, QObject *parent);
260 virtual ~KBookmarkAction();
261
262public Q_SLOTS:
263 void slotSelected(Qt::MouseButtons mb, Qt::KeyboardModifiers km);
264
265private:
266 KBookmarkOwner* m_pOwner;
267};
268
269#endif
KActionCollection
KActionMenu
KAction
KBookmarkActionInterface
Definition: kbookmarkmenu.h:226
KBookmarkActionMenu
Definition: kbookmarkmenu.h:241
KBookmarkAction
Definition: kbookmarkmenu.h:256
KBookmarkContextMenu
Definition: kbookmarkmenu.h:189
KBookmarkManager
This class implements the reading/writing of bookmarks in XML.
Definition: kbookmarkmanager.h:66
KBookmarkMenu
This class provides a bookmark menu.
Definition: kbookmarkmenu.h:77
KBookmarkMenu::m_actionCollection
KActionCollection * m_actionCollection
Definition: kbookmarkmenu.h:164
KBookmarkMenu::m_actions
QList< QAction * > m_actions
List of our actions.
Definition: kbookmarkmenu.h:168
KBookmarkMenu::m_lstSubMenus
QList< KBookmarkMenu * > m_lstSubMenus
List of our sub menus.
Definition: kbookmarkmenu.h:159
KBookmarkOwner
The KBookmarkMenu and KBookmarkBar classes gives the user the ability to either edit bookmarks or add...
Definition: kbookmarkmanager.h:383
KBookmark
Definition: kbookmark.h:35
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:94
KMenu
QAction
QList
QMenu
QObject
QWidget
kaction.h
kactionmenu.h
kbookmark.h
kbookmarkmanager.h
kicon.h
klocale.h
kmenu.h
krun.h
KIO
A namespace for KIO globals.
Definition: kbookmarkmenu.h:55
addBookmark
KAction * addBookmark(const QObject *recvr, const char *slot, QObject *parent)
clear
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal