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

KFile

  • kfile
kurlnavigatorbutton_p.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (C) 2006 by Peter Penz <peter.penz@gmx.at> *
3  * Copyright (C) 2006 by Aaron J. Seigo <aseigo@kde.org> *
4  * *
5  * This library is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Library General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2 of the License, or (at your option) any later version. *
9  * *
10  * This library is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13  * Library General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU Library General Public License *
16  * along with this library; see the file COPYING.LIB. If not, write to *
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
18  * Boston, MA 02110-1301, USA. *
19  *****************************************************************************/
20 
21 #ifndef KURLNAVIGATORBUTTON_P_H
22 #define KURLNAVIGATORBUTTON_P_H
23 
24 #include "kurlnavigatorbuttonbase_p.h"
25 #include "kurlnavigatormenu_p.h"
26 
27 #include <kio/global.h>
28 #include <kio/udsentry.h>
29 #include <kurl.h>
30 
31 #include <QPointer>
32 
33 class KJob;
34 class QDropEvent;
35 class QPaintEvent;
36 
37 namespace KIO
38 {
39  class Job;
40 }
41 
42 namespace KDEPrivate
43 {
44 
53 class KUrlNavigatorButton : public KUrlNavigatorButtonBase
54 {
55  Q_OBJECT
56 
57 public:
58  explicit KUrlNavigatorButton(const KUrl& url, QWidget* parent);
59  virtual ~KUrlNavigatorButton();
60 
61  void setUrl(const KUrl& url);
62  KUrl url() const;
63 
64  /* Implementation note: QAbstractButton::setText() is not virtual,
65  * but KUrlNavigatorButton needs to adjust the minimum size when
66  * the text has been changed. KUrlNavigatorButton::setText() hides
67  * QAbstractButton::setText() which is not nice, but sufficient for
68  * the usage in KUrlNavigator.
69  */
70  void setText(const QString& text);
71 
76  void setActiveSubDirectory(const QString& subDir);
77  QString activeSubDirectory() const;
78 
80  virtual QSize sizeHint() const;
81 
82  void setShowMnemonic(bool show);
83  bool showMnemonic() const;
84 
85 Q_SIGNALS:
90  void urlsDropped(const KUrl& destination, QDropEvent* event);
91 
92  void clicked(const KUrl& url, Qt::MouseButton button);
93 
100  void startedTextResolving();
101 
107  void finishedTextResolving();
108 
109 protected:
110  virtual void paintEvent(QPaintEvent* event);
111  virtual void enterEvent(QEvent* event);
112  virtual void leaveEvent(QEvent* event);
113  virtual void keyPressEvent(QKeyEvent* event);
114  virtual void dropEvent(QDropEvent* event);
115  virtual void dragEnterEvent(QDragEnterEvent* event);
116  virtual void dragMoveEvent(QDragMoveEvent* event);
117  virtual void dragLeaveEvent(QDragLeaveEvent* event);
118  virtual void mousePressEvent(QMouseEvent* event);
119  virtual void mouseReleaseEvent(QMouseEvent* event);
120  virtual void mouseMoveEvent(QMouseEvent* event);
121  virtual void wheelEvent(QWheelEvent* event);
122 
123 private Q_SLOTS:
128  void requestSubDirs();
129 
134  void startSubDirsJob();
135 
141  void addEntriesToSubDirs(KIO::Job* job, const KIO::UDSEntryList& entries);
142 
147  void openSubDirsMenu(KJob* job);
148 
154  void replaceButton(KJob* job);
155 
156  void urlsDropped(QAction* action, QDropEvent* event);
157 
162  void slotMenuActionClicked(QAction* action);
163 
164  void statFinished(KJob*);
165 
166 private:
170  void cancelSubDirsRequest();
171 
175  QString plainText() const;
176 
177  int arrowWidth() const;
178  bool isAboveArrow(int x) const;
179  bool isTextClipped() const;
180  void updateMinimumWidth();
181  void initMenu(KUrlNavigatorMenu* menu, int startIndex);
182 
183 private:
184  bool m_hoverArrow;
185  bool m_pendingTextChange;
186  bool m_replaceButton;
187  bool m_showMnemonic;
188  int m_wheelSteps;
189  KUrl m_url;
190 
191  QString m_subDir;
192  QTimer* m_openSubDirsTimer;
193  KIO::Job* m_subDirsJob;
194 
196  QList<QPair<QString,QString> > m_subDirs;
197 
198  static QPointer<KUrlNavigatorMenu> m_subDirsMenu;
199 };
200 
201 } // namespace KDEPrivate
202 
203 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 20:50:11 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KFile

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

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • 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
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal