javauis/lcdui_akn/lcdui/inc/CMIDGaugeItem.h
branchRCL_3
changeset 17 0fd27995241b
parent 14 04becd199f91
child 24 6c158198356e
equal deleted inserted replaced
15:f9bb0fca356a 17:0fd27995241b
   114     *
   114     *
   115     * @param aForeground ETrue to switch to the foreground. EFalse to switch
   115     * @param aForeground ETrue to switch to the foreground. EFalse to switch
   116     *   from the foreground.
   116     *   from the foreground.
   117     * @note Animation of non-interactive gauges is started/stopped.
   117     * @note Animation of non-interactive gauges is started/stopped.
   118     */
   118     */
   119     void HandleForegroundL(TBool aForeground);
   119     virtual void HandleForegroundL(TBool aForeground);
   120 
   120 
   121 protected:
   121 protected:
   122     /**
   122     /**
   123      * Ctor
   123      * Ctor
   124      * @param aUIManager UI manager
   124      * @param aUIManager UI manager
   128     CMIDGaugeItem(CMIDUIManager* aUIManager);
   128     CMIDGaugeItem(CMIDUIManager* aUIManager);
   129 
   129 
   130     void BaseConstructL(const TDesC& aLabel,TInt aMaxValue,
   130     void BaseConstructL(const TDesC& aLabel,TInt aMaxValue,
   131                         TInt aInitialValue);
   131                         TInt aInitialValue);
   132 
   132 
   133     void SetStateL(TInt aMaxValue,TInt aValue);
       
   134 
       
   135     void DisposeTimer();
       
   136     void FocusChanged(TDrawNow aDrawNow);
   133     void FocusChanged(TDrawNow aDrawNow);
   137 
       
   138     virtual void DoSafeDraw() = 0;
       
   139 
   134 
   140     void CreateBitmapsIfNeededL();
   135     void CreateBitmapsIfNeededL();
   141 
   136 
   142     /**
   137     /**
   143     * Creates bitmaps in thread-local bitmap storage.
   138     * Creates bitmaps in thread-local bitmap storage.
   224     };
   219     };
   225 
   220 
   226     /** An array of SVG bitmaps stored in the TLS so that it can be shared amongst gauge items*/
   221     /** An array of SVG bitmaps stored in the TLS so that it can be shared amongst gauge items*/
   227     TGaugeFrameData* iGaugeFrameData;
   222     TGaugeFrameData* iGaugeFrameData;
   228 
   223 
   229     CGaugeTimer* iTimer;
       
   230 
       
   231     TBool iIsInForeground; // is application in foreground?
       
   232 
       
   233     friend class CGaugeTimer;
   224     friend class CGaugeTimer;
   234 };
   225 };
   235 
   226 
   236 
   227 
   237 
   228 
   273     //
   264     //
   274     TInt ItemPreferredHeightWithoutLabel();
   265     TInt ItemPreferredHeightWithoutLabel();
   275     //
   266     //
   276     // From CMIDControlItem
   267     // From CMIDControlItem
   277     //
   268     //
       
   269     /**
       
   270     * Handles event when application switches to/from the foreground.
       
   271     *
       
   272     * @param aForeground ETrue to switch to the foreground. EFalse to switch
       
   273     *   from the foreground.
       
   274     * @note Animation of non-interactive gauges is started/stopped.
       
   275     */
       
   276     void HandleForegroundL(TBool aForeground);
   278     void ResolutionChange(TInt aType);
   277     void ResolutionChange(TInt aType);
   279 
   278 
   280     /**
   279     /**
   281     * Handles addition of ni-gauge to form.
   280     * Handles addition of ni-gauge to form.
   282     */
   281     */
   293     * @param aType Type of change.
   292     * @param aType Type of change.
   294     */
   293     */
   295     void ColorChange(TInt aType);
   294     void ColorChange(TInt aType);
   296 
   295 
   297     void SetGaugeListenerFromAlert(MMIDGaugeToAlertListner* aGaugeToAlertListner);
   296     void SetGaugeListenerFromAlert(MMIDGaugeToAlertListner* aGaugeToAlertListner);
       
   297 
   298 private:
   298 private:
   299     /**
   299     /**
   300      * Ctor
   300      * Ctor
   301      * @param aUIManager UI manager
   301      * @param aUIManager UI manager
   302      *
   302      *
   312     friend class CMIDAlertDialog;
   312     friend class CMIDAlertDialog;
   313     void UpdateProgressInfo(CEikProgressInfo* aProgressInfo) const;
   313     void UpdateProgressInfo(CEikProgressInfo* aProgressInfo) const;
   314     void UpdateMemberVariables();
   314     void UpdateMemberVariables();
   315 
   315 
   316     /**
   316     /**
       
   317      * Creats new instance of CAknBitmapAnimation for Gauge animation
       
   318      * and sets it to iBitmapAnimation
       
   319      */
       
   320     void CreateNewBitmapAnimationIfNeededL();
       
   321 
       
   322     /**
   317      * setting of size of iBitmapAnimation
   323      * setting of size of iBitmapAnimation
   318      */
   324      */
   319     void SetAnimationSize();
   325     void SetAnimationSize();
   320 
   326 
   321     /**
   327     /**
   327      * @return correct TAknsItemID
   333      * @return correct TAknsItemID
   328      */
   334      */
   329     TAknsItemID GetAknsItemID();
   335     TAknsItemID GetAknsItemID();
   330 
   336 
   331     void ColorChangeL(TInt aType);
   337     void ColorChangeL(TInt aType);
       
   338 
       
   339     void DisposeTimer();
       
   340 
       
   341     /**
       
   342      * From CMIDGaugeItem.
       
   343      * Starts animation timer (see iTimer) when needed.
       
   344      * In case that timer is not needed, but has been created,
       
   345      * it's disposed by this method.
       
   346      *
       
   347      * @since  S60 v5.0
       
   348      */
       
   349     void InstallGaugeTimerWhenNeededL();
       
   350 
       
   351     /**
       
   352      * Indicates that the current skin contains the animation and
       
   353      * the animation has been instantiated to iBitmapAnimation.
       
   354      *
       
   355      * @return ETrue iBitmapAnimation has been created
       
   356      *               and the animation is useful.
       
   357      * @since  S60 v5.0
       
   358      */
       
   359     TBool BitmapAnimationUsed() const;
   332 
   360 
   333 private:
   361 private:
   334     CEikProgressInfo* iProgressInfo;
   362     CEikProgressInfo* iProgressInfo;
   335     MMIDGaugeToAlertListner* iGaugeToAlertListner;
   363     MMIDGaugeToAlertListner* iGaugeToAlertListner;
   336     TAknLayoutRect iWaitGaugeRect; // form2_midp_gauge_wait_pane
   364     TAknLayoutRect iWaitGaugeRect; // form2_midp_gauge_wait_pane
   340 
   368 
   341     // WaitBar position in relation to CCoeControl (CMIDControlItem Rect) area
   369     // WaitBar position in relation to CCoeControl (CMIDControlItem Rect) area
   342     // Note that label height has to be added to the y coordinate
   370     // Note that label height has to be added to the y coordinate
   343     TPoint iProgressInfoWithLabelHeightTl; // Top left point of the progress info
   371     TPoint iProgressInfoWithLabelHeightTl; // Top left point of the progress info
   344     CAknBitmapAnimation* iBitmapAnimation; // Animation for animated Gauge
   372     CAknBitmapAnimation* iBitmapAnimation; // Animation for animated Gauge
       
   373     CGaugeTimer* iTimer;
       
   374     // Indicates that the application is in foreground
       
   375     TBool iIsInForeground;
   345 };
   376 };
   346 
   377 
   347 NONSHARABLE_CLASS(CMIDInteractiveGauge) : public CMIDGaugeItem
   378 NONSHARABLE_CLASS(CMIDInteractiveGauge) : public CMIDGaugeItem
   348 {
   379 {
   349 public:
   380 public:
   408     TPoint iSliderPositionTl; // Top left point of the slider control
   439     TPoint iSliderPositionTl; // Top left point of the slider control
   409     TInt iOriginalSliderValue;
   440     TInt iOriginalSliderValue;
   410     TBool iPhysicsScrollingTriggered;
   441     TBool iPhysicsScrollingTriggered;
   411 };
   442 };
   412 
   443 
       
   444 
   413 #endif // CMIDGAUGEITEM_H
   445 #endif // CMIDGAUGEITEM_H
   414 
   446 
   415 // End of File
   447 // End of File