phoneuis/bubblemanager2/bubblestyle/src/bubbleanimiconitem.h
changeset 30 ebdbd102c78a
parent 27 2f8f8080a020
child 32 14cdbae33453
child 36 2eacb6118286
equal deleted inserted replaced
27:2f8f8080a020 30:ebdbd102c78a
     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:  Animated icon.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef BUBBLEANIMICONITEM_H_
       
    19 #define BUBBLEANIMICONITEM_H_
       
    20 
       
    21 #include <QObject>
       
    22 #include <hbiconitem.h>
       
    23 
       
    24 class BubbleAnimIconItem : public HbIconItem
       
    25     {
       
    26     Q_OBJECT // for timer
       
    27     
       
    28 public:
       
    29     explicit BubbleAnimIconItem( int interval, QGraphicsItem* parent = 0 );
       
    30     virtual ~BubbleAnimIconItem();
       
    31     
       
    32     void appendIcon( const QString& iconName );
       
    33     void reset();
       
    34 
       
    35 protected:
       
    36     void startAnimation(int interval);
       
    37     void stopAnimation();
       
    38     void timerEvent(QTimerEvent *event);
       
    39     void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
       
    40     QVariant itemChange ( GraphicsItemChange change, const QVariant & value ); 
       
    41     void resizeEvent( QGraphicsSceneResizeEvent * event );
       
    42     
       
    43 protected:
       
    44     int     mInterval;
       
    45     int     mAnimationTimerId;
       
    46     int     mCurrentFrame;
       
    47     QList<HbIcon*> mFrames;
       
    48     };
       
    49 
       
    50 #endif /* BUBBLEANIMICONITEM_H_ */