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

KFile

  • kfile
kfileplacesitem_p.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 
18 */
19 
20 #ifndef KFILEPLACESITEM_P_H
21 #define KFILEPLACESITEM_P_H
22 
23 
24 #include <QtCore/QObject>
25 #include <QtCore/QPointer>
26 #include <QtCore/QModelIndex>
27 #include <kbookmark.h>
28 #include <solid/device.h>
29 
30 class KDirLister;
31 namespace Solid
32 {
33 class StorageAccess;
34 class StorageVolume;
35 class OpticalDisc;
36 }
37 
38 class KFilePlacesItem : public QObject
39 {
40  Q_OBJECT
41 public:
42  KFilePlacesItem(KBookmarkManager *manager,
43  const QString &address,
44  const QString &udi = QString());
45  ~KFilePlacesItem();
46 
47  QString id() const;
48 
49  bool isDevice() const;
50  KBookmark bookmark() const;
51  void setBookmark(const KBookmark &bookmark);
52  Solid::Device device() const;
53  QVariant data(int role) const;
54 
55  static KBookmark createBookmark(KBookmarkManager *manager,
56  const QString &label,
57  const KUrl &url,
58  const QString &iconName,
59  KFilePlacesItem *after = 0);
60  static KBookmark createSystemBookmark(KBookmarkManager *manager,
61  const QString &untranslatedLabel,
62  const QString &translatedLabel,
63  const KUrl &url,
64  const QString &iconName);
65  static KBookmark createDeviceBookmark(KBookmarkManager *manager,
66  const QString &udi);
67 
68 Q_SIGNALS:
69  void itemChanged(const QString &id);
70 
71 private Q_SLOTS:
72  void onAccessibilityChanged();
73  void onListerCompleted();
74 
75 private:
76  QVariant bookmarkData(int role) const;
77  QVariant deviceData(int role) const;
78 
79  bool hasFullIcon(const KBookmark &bookmark) const;
80  QString iconNameForBookmark(const KBookmark &bookmark) const;
81 
82  static QString generateNewId();
83 
84  KBookmarkManager *m_manager;
85  KBookmark m_bookmark;
86  KDirLister *m_lister;
87  bool m_folderIsEmpty;
88  QString m_text;
89  mutable Solid::Device m_device;
90  mutable QPointer<Solid::StorageAccess> m_access;
91  mutable QPointer<Solid::StorageVolume> m_volume;
92  mutable QPointer<Solid::OpticalDisc> m_disc;
93 };
94 
95 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Fri Dec 7 2012 16:21:06 by doxygen 1.8.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.8.5 API Reference

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