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

KFile

  • sources
  • kde-4.14
  • kdelibs
  • 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 
32 class KFilePlacesModel;
33 class KUrlComboBox;
34 class QMouseEvent;
35 
75 class KFILE_EXPORT KUrlNavigator : public QWidget
76 {
77  Q_OBJECT
78 
79 public:
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)
281 
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 
324 public 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)
347 
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 
366 Q_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)
423 
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 
436 protected:
437 #if !defined(DOXYGEN_SHOULD_SKIP_THIS)
438 
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 
464 private:
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 
477 private:
478  class Private;
479  Private* const d;
480 
481  Q_DISABLE_COPY(KUrlNavigator)
482 };
483 
484 #endif
QEvent
QResizeEvent
QWidget
kurl.h
QWidget::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *event)
QByteArray
QWheelEvent
QPoint
QMouseEvent
QWidget::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *event)
KUrl
KUrlComboBox
QObject
QWidget::setFocus
void setFocus()
QDropEvent
QObject::eventFilter
virtual bool eventFilter(QObject *watched, QEvent *event)
QString
QStringList
QWidget::wheelEvent
virtual void wheelEvent(QWheelEvent *event)
KUrl::List
QKeyEvent
QWidget::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event)
KUrlNavigator
Widget that allows to navigate through the paths of an URL.
Definition: kurlnavigator.h:75
QWidget::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
kfile_export.h
KFilePlacesModel
This class is a list view model.
Definition: kfileplacesmodel.h:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:27 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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