ginebra/visibilityanimator.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_VISIBILITY_ANIMATOR_H_
       
    20 #define _GINEBRA_VISIBILITY_ANIMATOR_H_
       
    21 
       
    22 #include <QObject>
       
    23 
       
    24 class ChromeSnippet;
       
    25 class QTimeLine;
       
    26 
       
    27 
       
    28 /**
       
    29  * \brief Base class for attention visibility delegates
       
    30  * 
       
    31  * \sa ChromeSnippet::setVisibilityAnimator()
       
    32  */
       
    33 class VisibilityAnimator : public QObject
       
    34 {
       
    35    Q_OBJECT
       
    36 
       
    37  public:
       
    38   VisibilityAnimator(ChromeSnippet* snippet):m_snippet(snippet), m_visible(true), m_timeLine(0){}
       
    39   virtual ~VisibilityAnimator();
       
    40   static VisibilityAnimator * create(const QString & name, ChromeSnippet* snippet);
       
    41   void toggleVisibility();
       
    42   void setTimeline(QTimeLine * timeline){m_timeLine = timeline;}
       
    43  public slots:
       
    44   virtual void updateVisibility(qreal step) = 0;
       
    45   
       
    46  protected:
       
    47   ChromeSnippet* m_snippet;
       
    48   bool m_visible;
       
    49   QTimeLine *m_timeLine;
       
    50 
       
    51 };
       
    52 
       
    53 #endif