• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Applets

notifierdialog.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Alexis Ménard <darktears31@gmail.com>           *
00003  *                                                                         *
00004  *   This program is free software; you can redistribute it and/or modify  *
00005  *   it under the terms of the GNU General Public License as published by  *
00006  *   the Free Software Foundation; either version 2 of the License, or     *
00007  *   (at your option) any later version.                                   *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU General Public License     *
00015  *   along with this program; if not, write to the                         *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA .        *
00018  ***************************************************************************/
00019 
00020 #ifndef NOTIFIERDIALOG_H
00021 #define NOTIFIERDIALOG_H
00022 
00023 //Qt
00024 #include <QWidget>
00025 #include <QStringList>
00026 
00027 //solid
00028 #include <solid/solidnamespace.h>
00029 
00030 
00031 //to remove
00032 #include <QTreeView>
00033 
00034 class QModelIndex;
00035 class QStandardItemModel;
00036 class QStandardItem;
00037 class QLabel;
00038 
00039 //own
00040 class DeviceNotifier;
00041 
00042 //desktop view
00043 namespace Plasma
00044 {
00045     class Icon;
00046     class Dialog;
00047 }
00048 namespace Solid
00049 {
00050     class Device;
00051 }
00052 namespace Notifier
00053 {
00054   class NotifierView;
00055 
00060   class NotifierDialog : public QObject
00061   {
00062   Q_OBJECT
00063   
00064       public:
00065 
00066           
00068           enum SpecificRoles {
00069               SolidUdiRole = Qt::UserRole + 1,
00070               PredicateFilesRole = Qt::UserRole + 2,
00071               ActionRole = Qt::UserRole + 3,
00072               IconNameRole = Qt::UserRole + 4,
00073               ScopeRole = Qt::UserRole + 5,
00074               SubTitleMandatoryRole = Qt::UserRole + 6
00075           };
00076   
00083           NotifierDialog(DeviceNotifier * notifier,QObject *parent = 0);
00084  
00088           virtual ~NotifierDialog();
00089 
00093           QWidget * dialog();
00094          
00098           void hide();
00099 
00103           void show();
00104 
00109           void insertDevice(const QString &name);
00110 
00111           void setUnMount(bool unmount,const QString &name);
00112   
00119           void setDeviceData(const QString &name, QVariant data, int role);
00120           
00126           QVariant getDeviceData(const QString &name, int role);
00127 
00132           void removeDevice(const QString &name);
00133   
00138           void removeDevice(int index);
00139 
00144           int countDevices();
00145 
00150           QString getDeviceUdi(int index);
00151 
00152       signals :
00153 
00154           void itemSelected();
00155 
00156       private slots:
00161           void slotOnItemClicked(const QModelIndex & index);
00162 
00168           void storageEjectDone(Solid::ErrorType error, QVariant errorData);
00169           
00175           void storageTeardownDone(Solid::ErrorType error, QVariant errorData);
00176  
00180           void resetNotifierIcon();
00181 
00186           void updateColors();
00187 
00188 
00189       private :
00193           void buildDialog();
00194 
00199           QModelIndex indexForUdi(const QString &udi) const;
00200 
00202           QStandardItemModel *m_hotplugModel;
00203 
00204           // The widget which display the panel
00205           QWidget *m_widget;
00207           NotifierView *m_notifierView;
00208 
00210           QLabel * m_label;
00211 
00213           DeviceNotifier * m_notifier;
00214 
00216           QStandardItem *m_rootItem;
00217 
00222           QStandardItem* searchOrCreateDeviceCategory(const QString &categoryName);
00223 
00228           QString getCategoryNameOfDevice(const Solid::Device& device);
00229   };
00230 
00231 }
00232 
00233 #endif
00234 

Applets

Skip menu "Applets"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal