• Skip to content
  • Skip to link menu
KDE 4.2 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     const KUrl& url() const;
00082 
00087     KUrl uncommittedUrl() const;
00088 
00098     KUrl url(int index) const;
00099 
00108     bool goBack();
00109 
00118     bool goForward();
00119 
00127     bool goUp();
00128 
00136     void goHome();
00137 
00142     void setHomeUrl(const QString& homeUrl);
00143 
00150     void setUrlEditable(bool editable);
00151 
00157     bool isUrlEditable() const;
00158 
00168     void setShowFullPath(bool show);
00169     
00174     bool showFullPath() const;
00175     
00185     void setActive(bool active);
00186 
00191     bool isActive() const;
00192 
00199     void setPlacesSelectorVisible(bool visible);
00200 
00202     bool isPlacesSelectorVisible() const;
00203 
00205     int historySize() const;
00206 
00213     int historyIndex() const;
00214 
00219     const KUrl& savedRootUrl() const;
00220 
00225     QPoint savedPosition() const;
00226 
00231     KUrlComboBox* editor() const;
00232 
00237     void setCustomProtocols(const QStringList &protocols);
00238 
00242     QStringList customProtocols() const;
00243 
00244 public Q_SLOTS:
00250     void setUrl(const KUrl& url);
00251 
00256     void requestActivation();
00257 
00264     void saveRootUrl(const KUrl& url);
00265 
00275     void savePosition(int x, int y);
00276 
00277     /* @see QWidget::setFocus() */
00278     void setFocus();
00279 
00280 Q_SIGNALS:
00285     void activated();
00286 
00292     void urlChanged(const KUrl& url);
00293 
00298     void editableStateChanged(bool editable);
00299 
00304     void historyChanged();
00305 
00310     // KDE5: remove, as the signal has been replaced by
00311     // urlsDropped(const KUrl& destination, QDropEvent* event)
00312     void urlsDropped(const KUrl::List& urls,
00313                      const KUrl& destination);
00314                      
00322     void urlsDropped(const KUrl& destination, QDropEvent* event);
00323 
00327     void returnPressed();
00328 
00329 protected:
00330     /*
00331      * If the Escape key is pressed, the navigation bar should switch
00332      * to the breadcrumb view.
00333      * @see QWidget::keyReleaseEvent()
00334      */
00335     virtual void keyReleaseEvent(QKeyEvent* event);
00336 
00337     /*
00338      * Paste the clipboard content as URL, if the middle mouse
00339      * button has been clicked.
00340      * @see QWidget::mouseReleaseEvent()
00341      */
00342     virtual void mouseReleaseEvent(QMouseEvent* event);
00343 
00344     /* @see QWidget::resizeEvent() */
00345     virtual void resizeEvent(QResizeEvent* event);
00346     
00347     virtual bool eventFilter(QObject* watched, QEvent* event);
00348 
00349 private:
00350     Q_PRIVATE_SLOT(d, void slotReturnPressed(const QString& text))
00351     Q_PRIVATE_SLOT(d, void slotReturnPressed())
00352     Q_PRIVATE_SLOT(d, void slotRemoteHostActivated())
00353     Q_PRIVATE_SLOT(d, void slotProtocolChanged(const QString& protocol))
00354     Q_PRIVATE_SLOT(d, void switchView())
00355     Q_PRIVATE_SLOT(d, void dropUrls(const KUrl& destination, QDropEvent*))
00356     Q_PRIVATE_SLOT(d, void openPathSelectorMenu())
00357     Q_PRIVATE_SLOT(d, void updateButtonVisibility())
00358     Q_PRIVATE_SLOT(d, void switchToBreadcrumbMode())
00359     Q_PRIVATE_SLOT(d, void updateContent())
00360 
00361 private:
00362     class Private;
00363     Private* const d;
00364 
00365     Q_DISABLE_COPY(KUrlNavigator)
00366 };
00367 
00368 #endif

KFile

Skip menu "KFile"
  • Main Page
  • Namespace List
  • 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
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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