/* * Qt UI * * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: * GiWoong Kim * Sangho Park * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * Contributors: * - S-Core Co., Ltd * */ #ifndef SKINKEYITEM_H #define SKINKEYITEM_H #include #include #include #include "skinbezelitem.h" #include "layout/hardwarekey.h" #include "layout/hovertype.h" class SkinView; class SkinKeyItem : public QObject, public QGraphicsRectItem { Q_OBJECT public: SkinKeyItem(QGraphicsItem *parent, HardwareKey *hwKey, QImage *pressedImg, bool reMasking, HoverType &hover); ~SkinKeyItem(); protected: void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void hoverEnterEvent(QGraphicsSceneHoverEvent *event); void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); protected slots: void longPressHook(); private: SkinView *viewer; SkinBezelItem *bezelParent; HardwareKey *hwKey; QImage *pressedKeyImg; bool reMasking; bool isPressed; QTimer *longPressTimer; bool isHovered; QPen hoverOutline; QBrush hoverFill; }; #endif // SKINKEYITEM_H