ginebra/attentionanimator.h
branchGCC_SURGE
changeset 8 2e16851ffecd
parent 2 bf4420e9fa4d
parent 6 1c3b8676e58c
equal deleted inserted replaced
2:bf4420e9fa4d 8:2e16851ffecd
     1 /*
       
     2 * Copyright (c) 2010 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 
       
    19 #ifndef _GINEBRA_ATTENTION_ANIMATOR_H_
       
    20 #define _GINEBRA_ATTENTION_ANIMATOR_H_
       
    21 
       
    22 #include <QObject>
       
    23 
       
    24 class ChromeSnippet;
       
    25 class QTimeLine;
       
    26 
       
    27 /**
       
    28  * \brief Base class for attention animation delegates
       
    29  * 
       
    30  * \sa ChromeSnippet::setAttentionAnimator()
       
    31  */
       
    32 class AttentionAnimator : public QObject
       
    33 {
       
    34    Q_OBJECT
       
    35 
       
    36  public:
       
    37   AttentionAnimator(ChromeSnippet* snippet):m_snippet(snippet), m_active(false), m_timeLine(0){}
       
    38   static AttentionAnimator * create(const QString & name, ChromeSnippet* snippet); //Factory method
       
    39   void toggleActive(); //NB: make this a slot?
       
    40   virtual ~AttentionAnimator();
       
    41   void setTimeline(QTimeLine * timeline){m_timeLine = timeline;}
       
    42  public slots:
       
    43   virtual void updateAttention(qreal step) = 0;
       
    44   
       
    45  protected:
       
    46   ChromeSnippet* m_snippet;
       
    47   bool m_active;
       
    48   QTimeLine *m_timeLine;
       
    49 
       
    50 };
       
    51 
       
    52 #endif