Applets
devicenotifier.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 #ifndef DEVICENOTIFIER_H
00021 #define DEVICENOTIFIER_H
00022
00023
00024 #include <solid/solidnamespace.h>
00025
00026
00027 #include <Plasma/PopupApplet>
00028 #include <Plasma/DataEngine>
00029 #include <Plasma/ToolTipManager>
00030
00031 class QStandardItemModel;
00032 class QGraphicsLinearLayout;
00033 class QGraphicsProxyWidget;
00034 class QTimer;
00035
00036 class KIcon;
00037
00038 namespace Notifier
00039 {
00040 class NotifierDialog;
00041 }
00042
00043
00044 namespace Plasma
00045 {
00046 class IconWidget;
00047 }
00048
00053 class DeviceNotifier : public Plasma::PopupApplet
00054 {
00055 Q_OBJECT
00056
00057 public:
00062 DeviceNotifier(QObject *parent, const QVariantList &args);
00063
00067 ~DeviceNotifier();
00068
00072 void init();
00073
00077 void changeNotifierIcon(const QString& name = QString());
00078
00082 QWidget *widget();
00083
00084 protected:
00085 void popupEvent(bool show);
00086
00087 public slots:
00091 void toolTipAboutToShow();
00092
00096 void toolTipHidden();
00097
00098 protected slots:
00103 void onSourceAdded(const QString &name);
00104
00109 void onSourceRemoved(const QString &name);
00110
00116 void dataUpdated(const QString &source, Plasma::DataEngine::Data data);
00117
00118 private:
00122 void fillPreviousDevices();
00123
00127 void notifyDevice(const QString &name);
00128
00132 void removeLastDeviceNotification(const QString &name);
00133
00135 Plasma::DataEngine *m_solidEngine;
00136
00138 Plasma::DataEngine *m_solidDeviceEngine;
00139
00141 Plasma::IconWidget *m_icon;
00142
00144 QString m_iconName;
00145
00147 Notifier::NotifierDialog * m_dialog;
00148
00150 int m_displayTime;
00151
00153 int m_numberItems;
00154
00156 int m_itemsValidity;
00157
00159 QTimer *m_timer;
00160
00162 bool isNotificationEnabled;
00163
00165 QList<QString> m_lastPlugged;
00166
00168 bool m_fillingPreviousDevices;
00169 };
00170
00171 #endif