• Skip to content
  • Skip to link menu
KDE 4.1 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 
00061 class KFILE_EXPORT KUrlNavigator : public QWidget
00062 {
00063     Q_OBJECT
00064 
00065 public:
00073     KUrlNavigator(KFilePlacesModel* placesModel, const KUrl& url, QWidget* parent);
00074     virtual ~KUrlNavigator();
00075 
00077     const KUrl& url() const;
00078 
00083     KUrl uncommittedUrl() const;
00084 
00094     KUrl url(int index) const;
00095 
00104     bool goBack();
00105 
00114     bool goForward();
00115 
00123     bool goUp();
00124 
00132     void goHome();
00133 
00138     void setHomeUrl(const QString& homeUrl);
00139 
00146     void setUrlEditable(bool editable);
00147 
00153     bool isUrlEditable() const;
00154 
00164     void setActive(bool active);
00165 
00170     bool isActive() const;
00171 
00178     void setPlacesSelectorVisible(bool visible);
00179 
00181     bool isPlacesSelectorVisible() const;
00182 
00184     int historySize() const;
00185 
00192     int historyIndex() const;
00193 
00198     const KUrl& savedRootUrl() const;
00199 
00204     QPoint savedPosition() const;
00205 
00210     KUrlComboBox* editor() const;
00211 
00216     void setCustomProtocols(const QStringList &protocols);
00217 
00221     QStringList customProtocols() const;
00222 
00223 public Q_SLOTS:
00229     void setUrl(const KUrl& url);
00230 
00235     void requestActivation();
00236 
00243     void saveRootUrl(const KUrl& url);
00244 
00254     void savePosition(int x, int y);
00255 
00256     /* @see QWidget::setFocus() */
00257     void setFocus();
00258 
00259 Q_SIGNALS:
00264     void activated();
00265 
00271     void urlChanged(const KUrl& url);
00272 
00277     void editableStateChanged(bool editable);
00278 
00283     void historyChanged();
00284 
00289     void urlsDropped(const KUrl::List& urls,
00290                      const KUrl& destination);
00291 
00295     void returnPressed();
00296 
00297 protected:
00298     /*
00299      * If the Escape key is pressed, the navigation bar should switch
00300      * to the breadcrumb view.
00301      * @see QWidget::keyReleaseEvent()
00302      */
00303     virtual void keyReleaseEvent(QKeyEvent* event);
00304 
00305     /*
00306      * Paste the clipboard content as URL, if the middle mouse
00307      * button has been clicked.
00308      * @see QWidget::mouseReleaseEvent()
00309      */
00310     virtual void mouseReleaseEvent(QMouseEvent* event);
00311 
00312     /* @see QWidget::resizeEvent() */
00313     virtual void resizeEvent(QResizeEvent* event);
00314 
00315 private:
00316     Q_PRIVATE_SLOT(d, void slotReturnPressed(const QString& text))
00317     Q_PRIVATE_SLOT(d, void slotReturnPressed())
00318     Q_PRIVATE_SLOT(d, void slotRemoteHostActivated())
00319     Q_PRIVATE_SLOT(d, void slotProtocolChanged(const QString& protocol))
00320     Q_PRIVATE_SLOT(d, void switchView())
00321     Q_PRIVATE_SLOT(d, void dropUrls(const KUrl::List& list, const KUrl& destination))
00322     Q_PRIVATE_SLOT(d, void openPathSelectorMenu())
00323     Q_PRIVATE_SLOT(d, void updateButtonVisibility())
00324     Q_PRIVATE_SLOT(d, void switchToBreadcrumbMode())
00325     Q_PRIVATE_SLOT(d, void updateContent())
00326 
00327 private:
00328     class Private;
00329     Private* const d;
00330 
00331     Q_DISABLE_COPY(KUrlNavigator)
00332 };
00333 
00334 #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
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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