1
/***************************************************************************
2
* Copyright 2008-2009 by Sebastian Kügler <sebas@kde.org> *
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 CONTACTWIDGET_H
21
#define CONTACTWIDGET_H
24
#include <QGraphicsGridLayout>
25
#include <QGraphicsLinearLayout>
26
#include <QGraphicsWidget>
28
#include <Plasma/PopupApplet>
29
#include <Plasma/Frame>
30
#include <Plasma/DataEngine>
41
class ContactWidget : public Plasma::Frame
46
explicit ContactWidget(Plasma::DataEngine* engine, QGraphicsWidget *parent = 0);
47
virtual ~ContactWidget();
51
QString provider() const;
54
void setName(const QString &name);
55
void setInfo(const QString &name);
56
void setIsFriend(bool isFriend);
57
void setId(const QString& id);
58
void setProvider(const QString& provider);
60
Plasma::PopupApplet* m_applet;
71
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
72
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
73
void mousePressEvent(QGraphicsSceneMouseEvent* event);
74
void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
75
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
78
void slotShowDetails();
79
void dataUpdated(const QString& source, const Plasma::DataEngine::Data& data);
85
Plasma::DataEngine::Data m_ocsData;
89
// The applet attached to this item
90
QGraphicsGridLayout* m_layout;
91
QGraphicsLinearLayout* m_actions;
92
ContactImage* m_image;
93
Plasma::Label* m_nameLabel;
94
Plasma::Label* m_infoLabel;
95
Plasma::IconWidget* m_sendMessage;
96
Plasma::IconWidget* m_addFriend;
97
Plasma::IconWidget* m_showDetails;
98
Plasma::DataEngine* m_engine;