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
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
00082 const KUrl& url() const;
00083
00088 KUrl uncommittedUrl() const;
00089
00099 KUrl url(int index) const;
00100
00109 bool goBack();
00110
00119 bool goForward();
00120
00128 bool goUp();
00129
00137 void goHome();
00138
00143 void setHomeUrl(const QString& homeUrl);
00144
00151 void setUrlEditable(bool editable);
00152
00158 bool isUrlEditable() const;
00159
00169 void setShowFullPath(bool show);
00170
00175 bool showFullPath() const;
00176
00186 void setActive(bool active);
00187
00192 bool isActive() const;
00193
00200 void setPlacesSelectorVisible(bool visible);
00201
00203 bool isPlacesSelectorVisible() const;
00204
00206 int historySize() const;
00207
00214 int historyIndex() const;
00215
00221 KUrl historyUrl(int historyIndex) const;
00222
00227
00228 const KUrl& savedRootUrl() const;
00229
00234 QPoint savedPosition() const;
00235
00240 KUrlComboBox* editor() const;
00241
00246 void setCustomProtocols(const QStringList &protocols);
00247
00251 QStringList customProtocols() const;
00252
00253 public Q_SLOTS:
00259 void setUrl(const KUrl& url);
00260
00265 void requestActivation();
00266
00273 void saveRootUrl(const KUrl& url);
00274
00284 void savePosition(int x, int y);
00285
00286
00287 void setFocus();
00288
00289 Q_SIGNALS:
00294 void activated();
00295
00301 void urlChanged(const KUrl& url);
00302
00307 void editableStateChanged(bool editable);
00308
00313 void historyChanged();
00314
00319
00320
00321 void urlsDropped(const KUrl::List& urls,
00322 const KUrl& destination);
00323
00331 void urlsDropped(const KUrl& destination, QDropEvent* event);
00332
00336 void returnPressed();
00337
00338 protected:
00339
00340
00341
00342
00343
00344 virtual void keyReleaseEvent(QKeyEvent* event);
00345
00346
00347
00348
00349
00350
00351 virtual void mouseReleaseEvent(QMouseEvent* event);
00352
00353
00354 virtual void resizeEvent(QResizeEvent* event);
00355
00356 virtual bool eventFilter(QObject* watched, QEvent* event);
00357
00358 private:
00359 Q_PRIVATE_SLOT(d, void slotReturnPressed())
00360 Q_PRIVATE_SLOT(d, void slotRemoteHostActivated())
00361 Q_PRIVATE_SLOT(d, void slotProtocolChanged(const QString& protocol))
00362 Q_PRIVATE_SLOT(d, void switchView())
00363 Q_PRIVATE_SLOT(d, void dropUrls(const KUrl& destination, QDropEvent*))
00364 Q_PRIVATE_SLOT(d, void openPathSelectorMenu())
00365 Q_PRIVATE_SLOT(d, void updateButtonVisibility())
00366 Q_PRIVATE_SLOT(d, void switchToBreadcrumbMode())
00367 Q_PRIVATE_SLOT(d, void updateContent())
00368
00369 private:
00370 class Private;
00371 Private* const d;
00372
00373 Q_DISABLE_COPY(KUrlNavigator)
00374 };
00375
00376 #endif