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

KFile

kurlnavigator.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (C) 2006-2010 by Peter Penz <peter.penz@gmx.at>                 *
00003  * Copyright (C) 2006 by Aaron J. Seigo <aseigo@kde.org>                     *
00004  * Copyright (C) 2007 by Kevin Ottens <ervin@kde.org>                        *
00005  * Copyright (C) 2007 by Urs Wolfer <uwolfer @ kde.org>                      *
00006  *                                                                           *
00007  * This library is free software; you can redistribute it and/or             *
00008  * modify it under the terms of the GNU Library General Public               *
00009  * License version 2 as published by the Free Software Foundation.           *
00010  *                                                                           *
00011  * This library is distributed in the hope that it will be useful,           *
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00014  * Library General Public License for more details.                          *
00015  *                                                                           *
00016  * You should have received a copy of the GNU Library General Public License *
00017  * along with this library; see the file COPYING.LIB.  If not, write to      *
00018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,      *
00019  * Boston, MA 02110-1301, USA.                                               *
00020  *****************************************************************************/
00021 
00022 #ifndef KURLNAVIGATOR_H
00023 #define KURLNAVIGATOR_H
00024 
00025 #include <kfile_export.h>
00026 
00027 #include <kurl.h>
00028 #include <QtGui/QWidget>
00029 #include <QtCore/QByteArray>
00030 
00031 class KFilePlacesModel;
00032 class KUrlComboBox;
00033 class QMouseEvent;
00034 
00075 class KFILE_EXPORT KUrlNavigator : public QWidget
00076 {
00077     Q_OBJECT
00078 
00079 public:
00081     KUrlNavigator(QWidget* parent = 0);
00082 
00090     KUrlNavigator(KFilePlacesModel* placesModel, const KUrl& url, QWidget* parent);
00091     virtual ~KUrlNavigator();
00092 
00098     KUrl locationUrl(int historyIndex = -1) const;
00099 
00120     void saveLocationState(const QByteArray& state);
00121 
00128     QByteArray locationState(int historyIndex = -1) const;
00129 
00138     bool goBack();
00139 
00148     bool goForward();
00149 
00157     bool goUp();
00158 
00166     void goHome();
00167 
00173     void setHomeUrl(const KUrl& url);
00174 
00175     KUrl homeUrl() const;
00176 
00183     void setUrlEditable(bool editable);
00184 
00190     bool isUrlEditable() const;
00191 
00201     void setShowFullPath(bool show);
00202     
00207     bool showFullPath() const;
00208     
00218     void setActive(bool active);
00219 
00224     bool isActive() const;
00225 
00232     void setPlacesSelectorVisible(bool visible);
00233 
00235     bool isPlacesSelectorVisible() const;
00236 
00241     KUrl uncommittedUrl() const;
00242 
00248     int historySize() const;
00249 
00255     int historyIndex() const;
00256     
00261     KUrlComboBox* editor() const;
00262 
00267     void setCustomProtocols(const QStringList& protocols);
00268 
00272     QStringList customProtocols() const;
00273 
00278     KDE_DEPRECATED const KUrl& url() const;
00279 
00290     KDE_DEPRECATED KUrl url(int index) const;
00291 
00298     KDE_DEPRECATED KUrl historyUrl(int historyIndex) const;
00299 
00304     KDE_DEPRECATED const KUrl& savedRootUrl() const;
00305 
00311     KDE_DEPRECATED QPoint savedPosition() const;
00312 
00314     KDE_DEPRECATED void setHomeUrl(const QString& homeUrl);
00315 
00316 public Q_SLOTS:
00324     void setLocationUrl(const KUrl& url);
00325 
00331     void requestActivation();
00332 
00333     /* @see QWidget::setFocus() */
00334     void setFocus();
00335 
00340     KDE_DEPRECATED void setUrl(const KUrl& url);
00341 
00346     KDE_DEPRECATED void saveRootUrl(const KUrl& url);
00347 
00352     KDE_DEPRECATED void savePosition(int x, int y);
00353 
00354 Q_SIGNALS:
00360     void activated();
00361 
00367     void urlChanged(const KUrl& url);
00368     
00376     void urlAboutToBeChanged(const KUrl& newUrl);
00377 
00382     void editableStateChanged(bool editable);
00383 
00388     void historyChanged();
00389                      
00396     void urlsDropped(const KUrl& destination, QDropEvent* event);
00397 
00401     void returnPressed();
00402 
00408     void tabRequested(const KUrl& url);
00409 
00417     // KDE5: remove, as the signal has been replaced by
00418     // urlsDropped(const KUrl& destination, QDropEvent* event)
00419     KDE_DEPRECATED void urlsDropped(const KUrl::List& urls,
00420                                     const KUrl& destination);
00421 
00422 protected:
00423     /*
00424      * If the Escape key is pressed, the navigation bar should switch
00425      * to the breadcrumb view.
00426      * @see QWidget::keyReleaseEvent()
00427      */
00428     virtual void keyReleaseEvent(QKeyEvent* event);
00429 
00430     /*
00431      * Paste the clipboard content as URL, if the middle mouse
00432      * button has been clicked.
00433      * @see QWidget::mouseReleaseEvent()
00434      */
00435     virtual void mouseReleaseEvent(QMouseEvent* event);
00436 
00437     /* @see QWidget::resizeEvent() */
00438     virtual void resizeEvent(QResizeEvent* event);
00439     
00440     virtual bool eventFilter(QObject* watched, QEvent* event);
00441 
00442 private:
00443     Q_PRIVATE_SLOT(d, void slotReturnPressed())
00444     Q_PRIVATE_SLOT(d, void slotRemoteHostActivated())
00445     Q_PRIVATE_SLOT(d, void slotProtocolChanged(const QString& protocol))
00446     Q_PRIVATE_SLOT(d, void switchView())
00447     Q_PRIVATE_SLOT(d, void dropUrls(const KUrl& destination, QDropEvent*))
00448     Q_PRIVATE_SLOT(d, void slotNavigatorButtonClicked(const KUrl& url, Qt::MouseButton button))
00449     Q_PRIVATE_SLOT(d, void openContextMenu(const QPoint& pos))
00450     Q_PRIVATE_SLOT(d, void openPathSelectorMenu())
00451     Q_PRIVATE_SLOT(d, void updateButtonVisibility())
00452     Q_PRIVATE_SLOT(d, void switchToBreadcrumbMode())
00453     Q_PRIVATE_SLOT(d, void updateContent())
00454 
00455 private:
00456     class Private;
00457     Private* const d;
00458 
00459     Q_DISABLE_COPY(KUrlNavigator)
00460 };
00461 
00462 #endif

KFile

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • 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
  • KUtils
  • Nepomuk
  • Plasma
  •     Sodep
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal