1 /***************************************************************************
2 * Copyright (C) 2007 by Alexis Ménard <darktears31@gmail.com> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18 ***************************************************************************/
20 #ifndef DEVICENOTIFIER_H
21 #define DEVICENOTIFIER_H
23 #include <plasma/applet.h>
24 #include <plasma/dataengine.h>
25 #include <plasma/phase.h>
26 #include <plasma/dialog.h>
28 #include <QModelIndex>
29 #include <QGraphicsProxyWidget>
30 #include <QGraphicsGridLayout>
34 #include "ui_deviceNotifierConfig.h"
36 class QStandardItemModel
;
46 class DeviceNotifier
: public Plasma::Applet
54 QStringList predicateFiles
;
59 DeviceNotifier(QObject
*parent
, const QVariantList
&args
);
63 Qt::Orientations
expandingDirections() const;
64 QSizeF
contentSizeHint() const;
65 void hoverEnterEvent (QGraphicsSceneHoverEvent
*event
);
66 void paintInterface(QPainter
*p
, const QStyleOptionGraphicsItem
*option
, const QRect
&rect
);
68 void onSourceAdded(const QString
&name
);
69 void onSourceRemoved(const QString
&name
);
70 void dataUpdated(const QString
&source
, Plasma::DataEngine::Data data
);
71 void showConfigurationInterface();
72 void configAccepted();
73 void slotOnItemClicked(const QModelIndex
&);
74 void onTimerExpired();
75 void onClickNotifier();
78 QModelIndex
indexForUdi(const QString
&udi
) const;
82 Plasma::DataEngine
*m_solidEngine
;
83 QStandardItemModel
*m_hotplugModel
;
85 Plasma::Dialog
*m_widget
;
87 //QGraphicsGridLayout *m_layout;
88 Plasma::BoxLayout
*m_layout
;
89 QGraphicsProxyWidget
* m_proxy
;
96 bool isNotificationEnabled
;
98 /// Designer Config file
99 Ui::solidNotifierConfig ui
;
103 K_EXPORT_PLASMA_APPLET(devicenotifier
, DeviceNotifier
)