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

KFile

kurlnavigator.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (C) 2006 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 
00030 class KFilePlacesModel;
00031 class KUrlComboBox;
00032 class QMouseEvent;
00033 
00065 class KFILE_EXPORT KUrlNavigator : public QWidget
00066 {
00067     Q_OBJECT
00068 
00069 public:
00077     KUrlNavigator(KFilePlacesModel* placesModel, const KUrl& url, QWidget* parent);
00078     virtual ~KUrlNavigator();
00079 
00081     // KDE5: return 'KUrl' instead of 'const KUrl&'
00082     const KUrl& url() const;
00083 
00088     KUrl uncommittedUrl() const;
00089 
00099     KUrl url(int index) const;
00100 
00109     bool goBack();
00110 
00119     bool goForward();
00120 
00128     bool goUp();
00129 
00137     void goHome();
00138 
00143     void setHomeUrl(const QString& homeUrl);
00144 
00151     void setUrlEditable(bool editable);
00152 
00158     bool isUrlEditable() const;
00159 
00169     void setShowFullPath(bool show);
00170     
00175     bool showFullPath() const;
00176     
00186     void setActive(bool active);
00187 
00192     bool isActive() const;
00193 
00200     void setPlacesSelectorVisible(bool visible);
00201 
00203     bool isPlacesSelectorVisible() const;
00204 
00206     int historySize() const;
00207 
00214     int historyIndex() const;
00215     
00221     KUrl historyUrl(int historyIndex) const;
00222 
00227     // KDE5: return 'KUrl' instead of 'const KUrl&'    
00228     const KUrl& savedRootUrl() const;
00229 
00234     QPoint savedPosition() const;
00235 
00240     KUrlComboBox* editor() const;
00241 
00246     void setCustomProtocols(const QStringList &protocols);
00247 
00251     QStringList customProtocols() const;
00252 
00253 public Q_SLOTS:
00259     void setUrl(const KUrl& url);
00260 
00265     void requestActivation();
00266 
00273     void saveRootUrl(const KUrl& url);
00274 
00284     void savePosition(int x, int y);
00285 
00286     /* @see QWidget::setFocus() */
00287     void setFocus();
00288 
00289 Q_SIGNALS:
00294     void activated();
00295 
00301     void urlChanged(const KUrl& url);
00302 
00307     void editableStateChanged(bool editable);
00308 
00313     void historyChanged();
00314 
00319     // KDE5: remove, as the signal has been replaced by
00320     // urlsDropped(const KUrl& destination, QDropEvent* event)
00321     void urlsDropped(const KUrl::List& urls,
00322                      const KUrl& destination);
00323                      
00331     void urlsDropped(const KUrl& destination, QDropEvent* event);
00332 
00336     void returnPressed();
00337 
00338 protected:
00339     /*
00340      * If the Escape key is pressed, the navigation bar should switch
00341      * to the breadcrumb view.
00342      * @see QWidget::keyReleaseEvent()
00343      */
00344     virtual void keyReleaseEvent(QKeyEvent* event);
00345 
00346     /*
00347      * Paste the clipboard content as URL, if the middle mouse
00348      * button has been clicked.
00349      * @see QWidget::mouseReleaseEvent()
00350      */
00351     virtual void mouseReleaseEvent(QMouseEvent* event);
00352 
00353     /* @see QWidget::resizeEvent() */
00354     virtual void resizeEvent(QResizeEvent* event);
00355     
00356     virtual bool eventFilter(QObject* watched, QEvent* event);
00357 
00358 private:
00359     Q_PRIVATE_SLOT(d, void slotReturnPressed())
00360     Q_PRIVATE_SLOT(d, void slotRemoteHostActivated())
00361     Q_PRIVATE_SLOT(d, void slotProtocolChanged(const QString& protocol))
00362     Q_PRIVATE_SLOT(d, void switchView())
00363     Q_PRIVATE_SLOT(d, void dropUrls(const KUrl& destination, QDropEvent*))
00364     Q_PRIVATE_SLOT(d, void openPathSelectorMenu())
00365     Q_PRIVATE_SLOT(d, void updateButtonVisibility())
00366     Q_PRIVATE_SLOT(d, void switchToBreadcrumbMode())
00367     Q_PRIVATE_SLOT(d, void updateContent())
00368 
00369 private:
00370     class Private;
00371     Private* const d;
00372 
00373     Q_DISABLE_COPY(KUrlNavigator)
00374 };
00375 
00376 #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
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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