radioapp/radiowidgets/inc/radiocarouselanimator.h
branchGCC_SURGE
changeset 37 451b2e1545b2
parent 28 075425b8d9a4
child 57 21be958eb3ce
equal deleted inserted replaced
26:6bcf277166c1 37:451b2e1545b2
       
     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 RADIOCAROUSELANIMATOR_H
       
    19 #define RADIOCAROUSELANIMATOR_H
       
    20 
       
    21 // System includes
       
    22 #include <QObject>
       
    23 
       
    24 // User includes
       
    25 
       
    26 // Forward declarations
       
    27 class RadioStationCarousel;
       
    28 class QTimeLine;
       
    29 class QTimer;
       
    30 
       
    31 // Class declaration
       
    32 class RadioCarouselAnimator : public QObject
       
    33 {
       
    34     Q_OBJECT
       
    35 
       
    36     enum AnimationFlag
       
    37     {
       
    38         NoAnimation         = 0,
       
    39         ScrollingNumbers    = 1 << 0,
       
    40         TimerItem           = 1 << 1,
       
    41         IconItem            = 1 << 2,
       
    42         TextItem            = 1 << 3,
       
    43 
       
    44         FlashingIcon        = TimerItem | IconItem,
       
    45         FlashingText        = TimerItem | TextItem
       
    46     };
       
    47     Q_DECLARE_FLAGS( AnimationMode, AnimationFlag )
       
    48 
       
    49 public:
       
    50 
       
    51     RadioCarouselAnimator( RadioStationCarousel& carousel );
       
    52     ~RadioCarouselAnimator();
       
    53 
       
    54     void startNumberScroll( const uint startFrequency, const uint stopFrequency );
       
    55 
       
    56     void startFlashingIcon();
       
    57     void stopFlashingIcon();
       
    58 
       
    59     void startFlashingText();
       
    60     void stopFlashingText();
       
    61 
       
    62     void stopAll();
       
    63 
       
    64 private slots:
       
    65 
       
    66     void handleTimeout();
       
    67     void updateNumberScroll( int value );
       
    68     void finalizeNumberScroll();
       
    69 
       
    70 private:
       
    71 
       
    72     void addMode( AnimationMode mode );
       
    73     void removeMode( AnimationMode mode );
       
    74 
       
    75 private:
       
    76 
       
    77     RadioStationCarousel&   mCarousel;
       
    78     QTimeLine*              mAnimationTimeLine;
       
    79     QTimer*                 mTimer;
       
    80     bool                    mCanceled;
       
    81     AnimationMode           mMode;
       
    82     bool                    mStationIsFavorite;
       
    83     bool                    mFlashingToggle;
       
    84 
       
    85 };
       
    86 
       
    87 #endif // RADIOCAROUSELANIMATOR_H