uifw/AvKon/inc/AknSmileyImage.h
branchRCL_3
changeset 19 aecbbf00d063
parent 5 aabf2c525e0f
child 20 d48ab3b357f1
equal deleted inserted replaced
18:fcdfafb36fe7 19:aecbbf00d063
    48     virtual void BitmapChanged(CSmileyImage* aSmileyImage, CFbsBitmap* aBitmap)=0;
    48     virtual void BitmapChanged(CSmileyImage* aSmileyImage, CFbsBitmap* aBitmap)=0;
    49     };
    49     };
    50 
    50 
    51 ////////////////////////////////////////////////////////////////////
    51 ////////////////////////////////////////////////////////////////////
    52 
    52 
    53 // CSmileyImage can be a still or animated svg image
       
    54 
       
    55 class CSmileyImage : public CBase, public MAknIconObserver
    53 class CSmileyImage : public CBase, public MAknIconObserver
    56     {
    54     {
    57 public:
    55 public:
    58     static CSmileyImage* NewL(const TAknsItemID& aSkinImage, TInt aPkgImage, TBool aIsAnimation, MSmileyImageObserver* aObserver);
    56     static CSmileyImage* NewL(const TAknsItemID& aSkinImage, TInt aPkgImage, TBool aIsAnimation, MSmileyImageObserver* aObserver);
    59     virtual ~CSmileyImage();
    57     virtual ~CSmileyImage();
    71 public:
    69 public:
    72     TBool ReadyToDraw() const;
    70     TBool ReadyToDraw() const;
    73     const CFbsBitmap* Image() const;
    71     const CFbsBitmap* Image() const;
    74     const CFbsBitmap* Mask() const;
    72     const CFbsBitmap* Mask() const;
    75 
    73 
    76 private:
    74 private: // from MAknIconObserver
    77     void BitmapChanged(CFbsBitmap* aBitmap); // from MAknIconObserver
    75     void BitmapChanged(CFbsBitmap* aBitmap);
    78     void MonitorAnimationEndedL();
       
    79 
    76 
    80 private:
    77 private:
    81     void DoLoadL();
    78     void DoLoadL();
    82     void DoRelease();
    79     void DoRelease();
    83     void DoHandleEndedL();
    80     void StopAnyAsynchronousTask();
       
    81 
       
    82     void MonitorAnimationEndedL();
       
    83     void HandleAnimationEndedL();
    84 
    84 
    85 private:
    85 private:
    86     inline void StopAsynchronousTaskTimer();
    86     void StartLoadAsynchronousL(TInt aRepeat, TInt aDelayMicroSeconds=0);
    87  
       
    88     void StartLoadAsynchronousL(TInt aDelayMicroSeconds=0);
       
    89     static TInt StartLoadAsynchronousCallBackL(TAny* aPtr);
    87     static TInt StartLoadAsynchronousCallBackL(TAny* aPtr);
    90 
    88     
       
    89 private:
    91     void StopAnimationAsynchronousL(TInt aDelayMicroSeconds=0);
    90     void StopAnimationAsynchronousL(TInt aDelayMicroSeconds=0);
    92     static TInt StopAnimationAsynchronousCallBackL(TAny* aPtr);
    91     static TInt StopAnimationAsynchronousCallBackL(TAny* aPtr);
    93 
    92 
    94 private:
    93 private:
    95     TAknsItemID             iImageSkinItemId;
    94     TAknsItemID             iImageSkinItem;
    96     const TInt              iImageMifPkgItemId;
    95     TInt                    iImagePkgItem;
    97     const TBool             iIsAnimation;
    96     const TBool             iIsAnimation;
    98 
    97     TSize                   iSize;
    99 private:
       
   100     MSmileyImageObserver*   iImageObserver;
    98     MSmileyImageObserver*   iImageObserver;
   101     CPeriodic*              iAsynchronousTaskTimer;
    99     CPeriodic*              iAsynchronousTaskTimer;
   102 
   100 
   103 private:
   101 private:
   104     TSize                   iSize;
       
   105     CFbsBitmap*             iFrame;
   102     CFbsBitmap*             iFrame;
   106     CFbsBitmap*             iFrameMask;
   103     CFbsBitmap*             iFrameMask;
   107     TBool                   iReadyToDraw;
   104     
   108 
   105 private:
   109 private: // for animation
       
   110     TInt                    iRepeatCount;
       
   111     CFbsBitmap*             iFrameSnap;
   106     CFbsBitmap*             iFrameSnap;
   112     TInt                    iFrameCounter;
   107     TInt                    iFrameCounter;
   113     TInt                    iSameFrameCounter;
   108     TInt                    iSameFrameCounter;
       
   109 
       
   110 private:
       
   111     TBool                   iReadyToDraw;
       
   112     TInt                    iRepeatCount;
   114 
   113 
   115     };
   114     };
   116 
   115 
   117 
   116 
   118 #endif // AKNSMILEYSVGRES_H
   117 #endif // AKNSMILEYSVGRES_H