phonebookui/cntcommonui/widgets/cntimagelabel.h
changeset 72 6abfb1094884
parent 53 e6aff7b69165
child 81 640d30f4fb64
equal deleted inserted replaced
67:59984e68247d 72:6abfb1094884
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CNTIMAGELABEL_H
       
    19 #define CNTIMAGELABEL_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <hbwidget.h>
       
    23 
       
    24 class QGesture;
       
    25 class QPixmap;
       
    26 class HbIconItem;
       
    27 class HbIcon;
       
    28 
       
    29 class CntImageLabel : public HbWidget
       
    30 {
       
    31     Q_OBJECT
       
    32     Q_PROPERTY(HbIcon icon READ avatarIcon WRITE setAvatarIcon)
       
    33 
       
    34 public:
       
    35     CntImageLabel(QGraphicsItem *parent = 0);
       
    36     ~CntImageLabel();
       
    37 
       
    38     void setAvatarIcon(const HbIcon &icon);
       
    39     HbIcon avatarIcon() const;
       
    40     
       
    41     void setIcon(const QPixmap &pixmap);
       
    42     void clear();
       
    43 
       
    44 protected:
       
    45     void gestureEvent(QGestureEvent* event);
       
    46     void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
       
    47     
       
    48 signals:
       
    49     void iconClicked();
       
    50     void iconLongPressed(const QPointF&);
       
    51     
       
    52 private:
       
    53     HbIconItem*  mDefaultAvatar;
       
    54     HbIcon       mIcon;
       
    55     QPixmap      mPixmap;
       
    56     
       
    57 };
       
    58 
       
    59 #endif // CNTEDITVIEWHEADINGITEM_H