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

KFile

  • sources
  • kde-4.14
  • kdelibs
  • kfile
kurlnavigatorplacesselector_p.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) *
3  * Copyright (C) 2007 by Kevin Ottens (ervin@kde.org) *
4  * *
5  * This library is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser 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  * Lesser General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU Lesser General Public *
16  * License along with this library; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19  ***************************************************************************/
20 
21 #ifndef KURLNAVIGATORPLACESSELECTOR_P_H
22 #define KURLNAVIGATORPLACESSELECTOR_P_H
23 
24 #include "kurlnavigatorbuttonbase_p.h"
25 #include <kurl.h>
26 
27 #include <QtCore/QPersistentModelIndex>
28 
29 class KFilePlacesModel;
30 class KMenu;
31 
32 namespace KDEPrivate
33 {
34 
44 class KUrlNavigatorPlacesSelector : public KUrlNavigatorButtonBase
45 {
46  Q_OBJECT
47 
48 public:
53  KUrlNavigatorPlacesSelector(QWidget* parent, KFilePlacesModel* placesModel);
54 
55  virtual ~KUrlNavigatorPlacesSelector();
56 
64  void updateSelection(const KUrl& url);
65 
67  KUrl selectedPlaceUrl() const;
69  QString selectedPlaceText() const;
70 
72  virtual QSize sizeHint() const;
73 
74 Q_SIGNALS:
79  void placeActivated(const KUrl& url);
80 
81 protected:
86  virtual void paintEvent(QPaintEvent* event);
87 
88  virtual void dragEnterEvent(QDragEnterEvent* event);
89  virtual void dragLeaveEvent(QDragLeaveEvent* event);
90  virtual void dropEvent(QDropEvent* event);
91 
92 private Q_SLOTS:
97  void activatePlace(QAction* action);
98 
99  void updateMenu();
100  void updateTeardownAction();
101 
102  void onStorageSetupDone(const QModelIndex &index, bool success);
103 
104 private:
105  int m_selectedItem;
106  QPersistentModelIndex m_lastClickedIndex;
107  KMenu* m_placesMenu;
108  KFilePlacesModel* m_placesModel;
109  KUrl m_selectedUrl;
110 };
111 
112 } // namespace KDEPrivate
113 
114 #endif
QModelIndex
QWidget
KDEPrivate::KUrlNavigatorPlacesSelector::dragEnterEvent
virtual void dragEnterEvent(QDragEnterEvent *event)
Definition: kurlnavigatorplacesselector.cpp:163
kurl.h
KDEPrivate::KUrlNavigatorPlacesSelector::updateSelection
void updateSelection(const KUrl &url)
Updates the selection dependent from the given URL url.
Definition: kurlnavigatorplacesselector.cpp:116
KDEPrivate::KUrlNavigatorPlacesSelector::selectedPlaceUrl
KUrl selectedPlaceUrl() const
Returns the selected bookmark.
Definition: kurlnavigatorplacesselector.cpp:132
KMenu
KDEPrivate::KUrlNavigatorButtonBase
Base class for buttons of the URL navigator.
Definition: kurlnavigatorbuttonbase_p.h:39
KDEPrivate::KUrlNavigatorPlacesSelector::KUrlNavigatorPlacesSelector
KUrlNavigatorPlacesSelector(QWidget *parent, KFilePlacesModel *placesModel)
Definition: kurlnavigatorplacesselector.cpp:40
KUrl
KDEPrivate::KUrlNavigatorPlacesSelector
Allows to select a bookmark from a popup menu.
Definition: kurlnavigatorplacesselector_p.h:44
KDEPrivate::KUrlNavigatorPlacesSelector::placeActivated
void placeActivated(const KUrl &url)
Is send when a bookmark has been activated by the user.
KDEPrivate::KUrlNavigatorPlacesSelector::~KUrlNavigatorPlacesSelector
virtual ~KUrlNavigatorPlacesSelector()
Definition: kurlnavigatorplacesselector.cpp:65
kurlnavigatorbuttonbase_p.h
KDEPrivate::KUrlNavigatorPlacesSelector::selectedPlaceText
QString selectedPlaceText() const
Returns the selected bookmark.
Definition: kurlnavigatorplacesselector.cpp:138
KDEPrivate::KUrlNavigatorPlacesSelector::dropEvent
virtual void dropEvent(QDropEvent *event)
Definition: kurlnavigatorplacesselector.cpp:181
QDropEvent
QString
KDEPrivate::KUrlNavigatorPlacesSelector::sizeHint
virtual QSize sizeHint() const
Definition: kurlnavigatorplacesselector.cpp:144
KDEPrivate::KUrlNavigatorPlacesSelector::paintEvent
virtual void paintEvent(QPaintEvent *event)
Draws the icon of the selected Url as content of the Url selector.
Definition: kurlnavigatorplacesselector.cpp:150
QSize
QDragLeaveEvent
QPersistentModelIndex
KDEPrivate::KUrlNavigatorPlacesSelector::dragLeaveEvent
virtual void dragLeaveEvent(QDragLeaveEvent *event)
Definition: kurlnavigatorplacesselector.cpp:173
QDragEnterEvent
QAction
QPushButton::event
virtual bool event(QEvent *e)
QPaintEvent
QObject::parent
QObject * parent() const
KFilePlacesModel
This class is a list view model.
Definition: kfileplacesmodel.h:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:27:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KFile

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

kdelibs API Reference

Skip menu "kdelibs 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

Search



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