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

KFile

kurlnavigatorbutton_p.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  *                                                                           *
00005  * This library is free software; you can redistribute it and/or             *
00006  * modify it under the terms of the GNU Library General Public               *
00007  * License as published by the Free Software Foundation; either              *
00008  * version 2 of the License, or (at your option) any later version.          *
00009  *                                                                           *
00010  * This library is distributed in the hope that it will be useful,           *
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00013  * Library General Public License for more details.                          *
00014  *                                                                           *
00015  * You should have received a copy of the GNU Library General Public License *
00016  * along with this library; see the file COPYING.LIB.  If not, write to      *
00017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,      *
00018  * Boston, MA 02110-1301, USA.                                               *
00019  *****************************************************************************/
00020 
00021 #ifndef KURLNAVIGATORBUTTON_P_H
00022 #define KURLNAVIGATORBUTTON_P_H
00023 
00024 #include "kurlnavigatorbuttonbase_p.h"
00025 #include "kurlnavigatormenu_p.h"
00026 
00027 #include <kio/global.h>
00028 #include <kio/udsentry.h>
00029 #include <kurl.h>
00030 
00031 #include <QPointer>
00032 
00033 class KJob;
00034 class QDropEvent;
00035 class QPaintEvent;
00036 
00037 namespace KIO
00038 {
00039     class Job;
00040 }
00041 
00042 namespace KDEPrivate
00043 {
00044 
00053 class KUrlNavigatorButton : public KUrlNavigatorButtonBase
00054 {
00055     Q_OBJECT
00056 
00057 public:
00058     explicit KUrlNavigatorButton(const KUrl& url, QWidget* parent);
00059     virtual ~KUrlNavigatorButton();
00060 
00061     void setUrl(const KUrl& url);
00062     KUrl url() const;
00063 
00064     /* Implementation note: QAbstractButton::setText() is not virtual,
00065      * but KUrlNavigatorButton needs to adjust the minimum size when
00066      * the text has been changed. KUrlNavigatorButton::setText() hides
00067      * QAbstractButton::setText() which is not nice, but sufficient for
00068      * the usage in KUrlNavigator.
00069      */
00070     void setText(const QString& text);
00071 
00076     void setActiveSubDirectory(const QString& subDir);
00077     QString activeSubDirectory() const;
00078 
00080     virtual QSize sizeHint() const;
00081 
00082     void setShowMnemonic(bool show);
00083     bool showMnemonic() const;
00084 
00085 Q_SIGNALS:
00090     void urlsDropped(const KUrl& destination, QDropEvent* event);
00091 
00092     void clicked(const KUrl& url, Qt::MouseButton button);
00093 
00100     void startedTextResolving();
00101 
00107     void finishedTextResolving();
00108 
00109 protected:
00110     virtual void paintEvent(QPaintEvent* event);
00111     virtual void enterEvent(QEvent* event);
00112     virtual void leaveEvent(QEvent* event);
00113     virtual void keyPressEvent(QKeyEvent* event);
00114     virtual void dropEvent(QDropEvent* event);
00115     virtual void dragEnterEvent(QDragEnterEvent* event);
00116     virtual void dragMoveEvent(QDragMoveEvent* event);
00117     virtual void dragLeaveEvent(QDragLeaveEvent* event);
00118     virtual void mousePressEvent(QMouseEvent* event);
00119     virtual void mouseReleaseEvent(QMouseEvent* event);
00120     virtual void mouseMoveEvent(QMouseEvent* event);
00121     virtual void wheelEvent(QWheelEvent* event);
00122 
00123 private Q_SLOTS:
00128     void requestSubDirs();
00129 
00134     void startSubDirsJob();
00135 
00141     void addEntriesToSubDirs(KIO::Job* job, const KIO::UDSEntryList& entries);
00142 
00147     void openSubDirsMenu(KJob* job);
00148 
00154     void replaceButton(KJob* job);
00155 
00156     void urlsDropped(QAction* action, QDropEvent* event);
00157 
00162     void slotMenuActionClicked(QAction* action);
00163 
00164     void statFinished(KJob*);
00165 
00166 private:
00170     void cancelSubDirsRequest();
00171 
00175     QString plainText() const;
00176 
00177     int arrowWidth() const;
00178     bool isAboveArrow(int x) const;
00179     bool isTextClipped() const;
00180     void updateMinimumWidth();
00181     void initMenu(KUrlNavigatorMenu* menu, int startIndex);
00182 
00183 private:
00184     bool m_hoverArrow;
00185     bool m_pendingTextChange;
00186     bool m_replaceButton;
00187     bool m_showMnemonic;
00188     int m_wheelSteps;
00189     KUrl m_url;
00190 
00191     QString m_subDir;
00192     QTimer* m_openSubDirsTimer;
00193     KIO::Job* m_subDirsJob;
00194 
00196     QList<QPair<QString,QString> > m_subDirs;
00197 
00198     static QPointer<KUrlNavigatorMenu> m_subDirsMenu;
00199 };
00200 
00201 } // namespace KDEPrivate
00202 
00203 #endif

KFile

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

kdelibs

Skip menu "kdelibs"
  • 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
Generated for kdelibs by doxygen 1.7.5
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