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

KFile

  • kfile
kurlnavigator.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright (C) 2006-2010 by Peter Penz <peter.penz@gmx.at> *
3 * Copyright (C) 2006 by Aaron J. Seigo <aseigo@kde.org> *
4 * Copyright (C) 2007 by Kevin Ottens <ervin@kde.org> *
5 * Copyright (C) 2007 by Urs Wolfer <uwolfer @ kde.org> *
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 KURLNAVIGATOR_H
24#define KURLNAVIGATOR_H
25
26#include <kfile_export.h>
27
28#include <kurl.h>
29#include <QtGui/QWidget>
30#include <QtCore/QByteArray>
31
32class KFilePlacesModel;
33class KUrlComboBox;
34class QMouseEvent;
35
75class KFILE_EXPORT KUrlNavigator : public QWidget
76{
77 Q_OBJECT
78
79public:
81 KUrlNavigator(QWidget* parent = 0);
82
90 KUrlNavigator(KFilePlacesModel* placesModel, const KUrl& url, QWidget* parent);
91 virtual ~KUrlNavigator();
92
98 KUrl locationUrl(int historyIndex = -1) const;
99
120 void saveLocationState(const QByteArray& state);
121
128 QByteArray locationState(int historyIndex = -1) const;
129
138 bool goBack();
139
148 bool goForward();
149
157 bool goUp();
158
166 // KDE5: Remove the home-property. It is sufficient to invoke
167 // KUrlNavigator::setLocationUrl(homeUrl) on application-side.
168 void goHome();
169
175 // KDE5: Remove the home-property. It is sufficient to invoke
176 // KUrlNavigator::setLocationUrl(homeUrl) on application-side.
177 void setHomeUrl(const KUrl& url);
178
179 KUrl homeUrl() const;
180
187 void setUrlEditable(bool editable);
188
194 bool isUrlEditable() const;
195
205 void setShowFullPath(bool show);
206
211 bool showFullPath() const;
212
222 void setActive(bool active);
223
228 bool isActive() const;
229
236 void setPlacesSelectorVisible(bool visible);
237
239 bool isPlacesSelectorVisible() const;
240
245 KUrl uncommittedUrl() const;
246
252 int historySize() const;
253
259 int historyIndex() const;
260
265 KUrlComboBox* editor() const;
266
271 // KDE5: Think about removing the custom-protocols-property. It had been used
272 // only by one application currently which uses a different approach now.
273 void setCustomProtocols(const QStringList& protocols);
274
278 QStringList customProtocols() const;
279
280#if !defined(KDE_NO_DEPRECATED) && !defined(DOXYGEN_SHOULD_SKIP_THIS)
285 KDE_DEPRECATED const KUrl& url() const;
286
297 KDE_DEPRECATED KUrl url(int index) const;
298
305 KDE_DEPRECATED KUrl historyUrl(int historyIndex) const;
306
311 KDE_DEPRECATED const KUrl& savedRootUrl() const;
312
318 KDE_DEPRECATED QPoint savedPosition() const;
319
321 KDE_DEPRECATED void setHomeUrl(const QString& homeUrl);
322#endif
323
324public Q_SLOTS:
332 void setLocationUrl(const KUrl& url);
333
339 void requestActivation();
340
341#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
342 // KDE5: Remove and listen for focus-signal instead
343 void setFocus();
344#endif
345
346#if !defined(KDE_NO_DEPRECATED) && !defined(DOXYGEN_SHOULD_SKIP_THIS)
351 KDE_DEPRECATED void setUrl(const KUrl& url);
352
357 KDE_DEPRECATED void saveRootUrl(const KUrl& url);
358
363 KDE_DEPRECATED void savePosition(int x, int y);
364#endif
365
366Q_SIGNALS:
372 void activated();
373
379 void urlChanged(const KUrl& url);
380
388 void urlAboutToBeChanged(const KUrl& newUrl);
389
394 void editableStateChanged(bool editable);
395
400 void historyChanged();
401
408 void urlsDropped(const KUrl& destination, QDropEvent* event);
409
413 void returnPressed();
414
420 void tabRequested(const KUrl& url);
421
422#if !defined(KDE_NO_DEPRECATED) && !defined(DOXYGEN_SHOULD_SKIP_THIS)
430 // KDE5: remove, as the signal has been replaced by
431 // urlsDropped(const KUrl& destination, QDropEvent* event)
432 KDE_DEPRECATED void urlsDropped(const KUrl::List& urls,
433 const KUrl& destination);
434#endif
435
436protected:
437#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
443 virtual void keyPressEvent(QKeyEvent* event);
444
448 virtual void keyReleaseEvent(QKeyEvent* event);
449
455 virtual void mouseReleaseEvent(QMouseEvent* event);
456
457 virtual void resizeEvent(QResizeEvent* event);
458
459 virtual void wheelEvent(QWheelEvent* event);
460
461 virtual bool eventFilter(QObject* watched, QEvent* event);
462#endif
463
464private:
465 Q_PRIVATE_SLOT(d, void slotReturnPressed())
466 Q_PRIVATE_SLOT(d, void slotProtocolChanged(const QString& protocol))
467 Q_PRIVATE_SLOT(d, void switchView())
468 Q_PRIVATE_SLOT(d, void dropUrls(const KUrl& destination, QDropEvent*))
469 Q_PRIVATE_SLOT(d, void slotNavigatorButtonClicked(const KUrl& url, Qt::MouseButton button))
470 Q_PRIVATE_SLOT(d, void openContextMenu())
471 Q_PRIVATE_SLOT(d, void openPathSelectorMenu())
472 Q_PRIVATE_SLOT(d, void updateButtonVisibility())
473 Q_PRIVATE_SLOT(d, void switchToBreadcrumbMode())
474 Q_PRIVATE_SLOT(d, void slotPathBoxChanged(const QString& text))
475 Q_PRIVATE_SLOT(d, void updateContent())
476
477private:
478 class Private;
479 Private* const d;
480
481 Q_DISABLE_COPY(KUrlNavigator)
482};
483
484#endif
KFilePlacesModel
This class is a list view model.
Definition: kfileplacesmodel.h:41
KUrlComboBox
KUrlNavigator
Widget that allows to navigate through the paths of an URL.
Definition: kurlnavigator.h:76
KUrlNavigator::urlChanged
void urlChanged(const KUrl &url)
Is emitted, if the location URL has been changed e.
KUrlNavigator::tabRequested
void tabRequested(const KUrl &url)
Is emitted if the URL url should be opened in a new tab because the user clicked on a breadcrumb with...
KUrlNavigator::editableStateChanged
void editableStateChanged(bool editable)
Is emitted, if the editable state for the URL has been changed (see KUrlNavigator::setUrlEditable()).
KUrlNavigator::urlAboutToBeChanged
void urlAboutToBeChanged(const KUrl &newUrl)
Is emitted, before the location URL is going to be changed to newUrl.
KUrlNavigator::historyChanged
void historyChanged()
Is emitted, if the history has been changed.
KUrlNavigator::urlsDropped
void urlsDropped(const KUrl &destination, QDropEvent *event)
Is emitted if a dropping has been done above the destination destination.
KUrlNavigator::activated
void activated()
Is emitted, if the URL navigator has been activated by an user interaction.
KUrlNavigator::returnPressed
void returnPressed()
This signal is emitted when the Return or Enter key is pressed.
KUrl::List
KUrl
QObject
QWidget
kfile_export.h
kurl.h
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.

KFile

Skip menu "KFile"
  • Main Page
  • 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