KFile
kurlnavigator.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 #include <QtCore/QByteArray>
00030
00031 class KFilePlacesModel;
00032 class KUrlComboBox;
00033 class QMouseEvent;
00034
00075 class KFILE_EXPORT KUrlNavigator : public QWidget
00076 {
00077 Q_OBJECT
00078
00079 public:
00081 KUrlNavigator(QWidget* parent = 0);
00082
00090 KUrlNavigator(KFilePlacesModel* placesModel, const KUrl& url, QWidget* parent);
00091 virtual ~KUrlNavigator();
00092
00098 KUrl locationUrl(int historyIndex = -1) const;
00099
00120 void saveLocationState(const QByteArray& state);
00121
00128 QByteArray locationState(int historyIndex = -1) const;
00129
00138 bool goBack();
00139
00148 bool goForward();
00149
00157 bool goUp();
00158
00166 void goHome();
00167
00173 void setHomeUrl(const KUrl& url);
00174
00175 KUrl homeUrl() const;
00176
00183 void setUrlEditable(bool editable);
00184
00190 bool isUrlEditable() const;
00191
00201 void setShowFullPath(bool show);
00202
00207 bool showFullPath() const;
00208
00218 void setActive(bool active);
00219
00224 bool isActive() const;
00225
00232 void setPlacesSelectorVisible(bool visible);
00233
00235 bool isPlacesSelectorVisible() const;
00236
00241 KUrl uncommittedUrl() const;
00242
00248 int historySize() const;
00249
00255 int historyIndex() const;
00256
00261 KUrlComboBox* editor() const;
00262
00267 void setCustomProtocols(const QStringList& protocols);
00268
00272 QStringList customProtocols() const;
00273
00278 KDE_DEPRECATED const KUrl& url() const;
00279
00290 KDE_DEPRECATED KUrl url(int index) const;
00291
00298 KDE_DEPRECATED KUrl historyUrl(int historyIndex) const;
00299
00304 KDE_DEPRECATED const KUrl& savedRootUrl() const;
00305
00311 KDE_DEPRECATED QPoint savedPosition() const;
00312
00314 KDE_DEPRECATED void setHomeUrl(const QString& homeUrl);
00315
00316 public Q_SLOTS:
00324 void setLocationUrl(const KUrl& url);
00325
00331 void requestActivation();
00332
00333
00334 void setFocus();
00335
00340 KDE_DEPRECATED void setUrl(const KUrl& url);
00341
00346 KDE_DEPRECATED void saveRootUrl(const KUrl& url);
00347
00352 KDE_DEPRECATED void savePosition(int x, int y);
00353
00354 Q_SIGNALS:
00360 void activated();
00361
00367 void urlChanged(const KUrl& url);
00368
00376 void urlAboutToBeChanged(const KUrl& newUrl);
00377
00382 void editableStateChanged(bool editable);
00383
00388 void historyChanged();
00389
00396 void urlsDropped(const KUrl& destination, QDropEvent* event);
00397
00401 void returnPressed();
00402
00408 void tabRequested(const KUrl& url);
00409
00417
00418
00419 KDE_DEPRECATED void urlsDropped(const KUrl::List& urls,
00420 const KUrl& destination);
00421
00422 protected:
00423
00424
00425
00426
00427
00428 virtual void keyReleaseEvent(QKeyEvent* event);
00429
00430
00431
00432
00433
00434
00435 virtual void mouseReleaseEvent(QMouseEvent* event);
00436
00437
00438 virtual void resizeEvent(QResizeEvent* event);
00439
00440 virtual bool eventFilter(QObject* watched, QEvent* event);
00441
00442 private:
00443 Q_PRIVATE_SLOT(d, void slotReturnPressed())
00444 Q_PRIVATE_SLOT(d, void slotRemoteHostActivated())
00445 Q_PRIVATE_SLOT(d, void slotProtocolChanged(const QString& protocol))
00446 Q_PRIVATE_SLOT(d, void switchView())
00447 Q_PRIVATE_SLOT(d, void dropUrls(const KUrl& destination, QDropEvent*))
00448 Q_PRIVATE_SLOT(d, void slotNavigatorButtonClicked(const KUrl& url, Qt::MouseButton button))
00449 Q_PRIVATE_SLOT(d, void openContextMenu(const QPoint& pos))
00450 Q_PRIVATE_SLOT(d, void openPathSelectorMenu())
00451 Q_PRIVATE_SLOT(d, void updateButtonVisibility())
00452 Q_PRIVATE_SLOT(d, void switchToBreadcrumbMode())
00453 Q_PRIVATE_SLOT(d, void updateContent())
00454
00455 private:
00456 class Private;
00457 Private* const d;
00458
00459 Q_DISABLE_COPY(KUrlNavigator)
00460 };
00461
00462 #endif