classicui_plat/ganes_api/inc/ganes/HgVgMediaWall.h
branchRCL_3
changeset 56 d48ab3b357f1
child 72 a5e7a4f63858
equal deleted inserted replaced
55:aecbbf00d063 56:d48ab3b357f1
       
     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 HGVGMEDIAWALL_H_
       
    19 #define HGVGMEDIAWALL_H_
       
    20 
       
    21 // INCLUDES
       
    22 #include <coecntrl.h>
       
    23 #include <coemain.h>
       
    24 #include <EGL/egl.h>
       
    25 #include <VG/openvg.h>
       
    26 #include <ganes/HgBufferOwnerIface.h>
       
    27 #include <ganes/HgScrollbarObserverIface.h>
       
    28 #include <akntouchgesturefw.h>
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class MHgScrollBufferObserver;
       
    32 class MHgSelectionObserver;
       
    33 class CHgVgItem;
       
    34 class CGulIcon;
       
    35 class CHgScrollBufferManager;
       
    36 class CHgVgScrollBar;
       
    37 class CHgVgMediaWallRenderer;
       
    38 class CHgVgSkinRenderer;
       
    39 class CHgVgTimer;
       
    40 class CHgVgPopup;
       
    41 class CHgVgButton;
       
    42 class MHgVgMediaWallObserver;
       
    43 class CHgVgLabel;
       
    44 class CHgVgEGL;
       
    45 class THgVgSpring;
       
    46 class CAlfCompositionSource;
       
    47 class CFbsBitmap;
       
    48 
       
    49 // CLASS DECLARATION
       
    50 class CHgVgMediaWall : 
       
    51     public CCoeControl, 
       
    52     public MHgBufferOwner,
       
    53     public MHgScrollbarObserver,
       
    54     public MCoeForegroundObserver,
       
    55     public AknTouchGestureFw::MAknTouchGestureFwObserver
       
    56     {
       
    57 public:
       
    58     
       
    59     /**
       
    60      * Style of the media wall to use.
       
    61      */
       
    62     enum THgVgMediaWallStyle
       
    63         {
       
    64         EHgVgMediaWallStyleCoverflowFullScreen,
       
    65         EHgVgMediaWallStyleCoverflowTBonePortrait,
       
    66         EHgVgMediaWallStyleCoverflowTBoneLandscape,
       
    67         EHgVgMediaWallStyleGrid,
       
    68         EHgVgMediaWallStyleUnknown
       
    69         };
       
    70     
       
    71     /**
       
    72      * Media walls current animation state.
       
    73      */
       
    74     enum THgVgAnimationState
       
    75         {
       
    76         EHgVgMediaWallAnimationStateIdle,
       
    77         EHgVgMediaWallAnimationStateTransition,
       
    78         EHgVgMediaWallAnimationStateFastTransition,
       
    79         EHgVgMediaWallAnimationStateOpening,
       
    80         EHgVgMediaWallAnimationStateClosing,
       
    81         EHgVgMediaWallAnimationStateItemOpened
       
    82         };
       
    83     
       
    84     /**
       
    85      * Media walls selection animation type.
       
    86      * Default behaviour is EHgSelectionAnimationFlipToFront.
       
    87      */
       
    88     enum THgVgOpeningAnimationType
       
    89         {
       
    90         EHgVgOpeningAnimationNone, // no animation takes place when item is tapped
       
    91         EHgVgOpeningAnimationFlipToFront, // flips the opened item by flip angle and fits to set opened item rect.
       
    92         EHgVgOpeningAnimationZoomToFront, // zooms the opened item to set opened item rect.
       
    93         EHgVgOpeningAnimationZoomIn // zooms the item to the back of the camera.        
       
    94         };
       
    95     
       
    96     /**
       
    97      * Event types, CHgVgMediaWall may send through MHgVgMediaWallObserver interface.
       
    98      */
       
    99     enum THgVgMediaWallEvent
       
   100         {
       
   101         EHgVgMediaWallEventRequestHideSoftkeys,
       
   102         EHgVgMediaWallEventRequestShowSoftkeys,
       
   103         EHgVgMediaWallEventButtonGotoNowPlaying,
       
   104         EHgVgMediaWallEventButtonBack
       
   105         };
       
   106 
       
   107     /**
       
   108      * Flags that define possible mediawall modes
       
   109      */
       
   110     enum THgVgMediaWallMode
       
   111         {
       
   112         EHgVgMediaWallDrawToWindowGC = 0x0001,
       
   113         EHgVgMediaWallFaded = 0x0002,
       
   114         EHgVgMediaWallUninitialized = 0x0004
       
   115         };
       
   116         
       
   117 public: 
       
   118     
       
   119     /**
       
   120      * Creates new HgVgMediaWall.
       
   121      * 
       
   122      * @param aRect Rect that the control draws onto.
       
   123      * @param aItemCount Total count of items in the mediawall.
       
   124      * @param aStyle style of the mediawall.
       
   125      * @param aEnableScrollBar ETrue to enable scrollbar.
       
   126      * @param aDefaultIcon Default icon to be used.
       
   127      * 
       
   128      * @return HgVGMediaWall-object
       
   129      */
       
   130     IMPORT_C static CHgVgMediaWall* NewL ( const TRect& aRect, 
       
   131           TInt aItemCount,
       
   132           THgVgMediaWallStyle aStyle,
       
   133           TBool aEnableScrollBar,
       
   134           MObjectProvider* aParent,
       
   135           CGulIcon* aDefaultIcon = NULL); 
       
   136         
       
   137     // Destructor.
       
   138     IMPORT_C virtual ~CHgVgMediaWall();
       
   139     
       
   140 public: // CCoeControl
       
   141 
       
   142     void Draw(const TRect& aRect ) const;
       
   143     void SizeChanged();
       
   144     void HandlePointerEventL( const TPointerEvent& aEvent );
       
   145     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   146     void FocusChanged(TDrawNow aDrawNow);
       
   147     void HandleResourceChange(TInt aType);
       
   148     
       
   149 private: // MHgBufferOwner
       
   150     void Release(TInt aReleaseStart, TInt aReleaseEnd);
       
   151 
       
   152 private: // MHgScrollbarObserver
       
   153 
       
   154     void ScrollBarPositionChanged( const TPoint& aNewPosition );
       
   155 
       
   156     void HandleNaviStripChar( const TChar& aChar );
       
   157 
       
   158 public: //MCoeForegroundObserver
       
   159     void HandleGainingForeground();
       
   160     void HandleLosingForeground();
       
   161     
       
   162 private: // MAknTouchGestureFwObserver
       
   163     
       
   164     void HandleTouchGestureL( AknTouchGestureFw::MAknTouchGestureFwEvent& aEvent );    
       
   165     
       
   166 public: // NEW FUNCTIONS
       
   167     /**
       
   168      * Re-inits rendering for new window rectangle.
       
   169      * 
       
   170      * @param aRect New display rect
       
   171      */
       
   172     IMPORT_C void InitScreenL( const TRect& aRect );
       
   173     
       
   174     /**
       
   175      * Refreshes screen.
       
   176      */
       
   177     IMPORT_C void RefreshScreen( TInt aIndex );
       
   178 
       
   179     /**
       
   180      * Gives the first index on the screen.
       
   181      * 
       
   182      * Note: The index is not guaranteed to be in the range of the scroller items.
       
   183      * Index can be negative if the scroller is scrolled to the way up or 
       
   184      * over the count - 1 if scrolled way down.   
       
   185      * 
       
   186      * @return The index of the first item on the screen. 
       
   187      */
       
   188     IMPORT_C TInt FirstIndexOnScreen();
       
   189     
       
   190     /**
       
   191      * How many items fit on one screen. 
       
   192      * @return Item count.
       
   193      */
       
   194     IMPORT_C TInt ItemsOnScreen();
       
   195     
       
   196     /**
       
   197      * Get item at specified index.
       
   198      * 
       
   199      * @param aIndex Index of the item that is returned
       
   200      * @return Reference to item.
       
   201      */
       
   202     IMPORT_C CHgVgItem& ItemL( TInt aIndex );
       
   203     
       
   204     /**
       
   205      * Resets item at the index position. Old item is deleted.
       
   206      * 
       
   207      * @param aItem New item. Ownership transferred.
       
   208      * @param aIndex The index of the item.
       
   209      */
       
   210     IMPORT_C void SetItem(CHgVgItem* aItem, TInt aIndex);
       
   211 
       
   212     /**
       
   213      * Adds Item.
       
   214      * 
       
   215      * @param aItem New item. Ownership transferred.
       
   216      */
       
   217     IMPORT_C void AddItem(CHgVgItem* aItem);
       
   218 
       
   219     /**
       
   220      * Inserts item at index postion.
       
   221      * 
       
   222      * @param aItem New item. Ownership transferred.
       
   223      * @param aIndex The index of the item.
       
   224      */
       
   225     IMPORT_C void InsertItem(CHgVgItem* aItem, TInt aIndex);
       
   226 
       
   227     /**
       
   228      * Removes item at index position. Removed item is deleted.
       
   229      * 
       
   230      * @param aIndex The index of the item.
       
   231      */
       
   232     IMPORT_C void RemoveItem(TInt aIndex);
       
   233 
       
   234     /**
       
   235      * Returns index of currently selected item in MediaWall. 
       
   236      * In the case of EHgVgMediaWallStyleStyleGrid this method can only
       
   237      * return indices of the items at top row. The index of the item picked
       
   238      * by user is on grids case only passed through MHgSelectionObserver interface.
       
   239      * 
       
   240      * @return Selected index (KErrNotFound if nothing is selected)
       
   241      */
       
   242     IMPORT_C TInt SelectedIndex();
       
   243 
       
   244     /**
       
   245      * Sets selected index. Positions the mediwall into this index.
       
   246      * In case of a grid. The mediawall is positioned into row = aIndex / RowCount.
       
   247      * @param aIndex new selected index. Selection is also made visible.
       
   248      */
       
   249     IMPORT_C void SetSelectedIndex( TInt aIndex );
       
   250     
       
   251     /**
       
   252      * Enables Buffering.
       
   253      * @param aObserver Buffer change observer.
       
   254      * @param aBufferSize The size of the buffer.
       
   255      * @param aBufferTreshold The minimum change needed for buffer to be modified.
       
   256      */
       
   257     IMPORT_C void EnableScrollBufferL( MHgScrollBufferObserver& aObserver, 
       
   258             TInt aBufferSize,
       
   259             TInt aBufferTreshold );
       
   260     
       
   261     /**
       
   262      * Sets selection observer.
       
   263      * @param aObserver Selection observer.
       
   264      */
       
   265     IMPORT_C void SetSelectionObserver( MHgSelectionObserver& aObserver );
       
   266 
       
   267     /**
       
   268      * Removes all items and presents empty text
       
   269      * */
       
   270     IMPORT_C void Reset();
       
   271     
       
   272     /**
       
   273      * Resizes Grid/List.
       
   274      * @param aItemCount New Count of items.
       
   275      */
       
   276     IMPORT_C void ResizeL( TInt aItemCount );
       
   277 
       
   278     /**
       
   279      * Set text that is displayed when there are no items in the view.
       
   280      * @param aEmptyText Empty text.
       
   281      */
       
   282     IMPORT_C void SetEmptyTextL( const TDesC& aEmptyText );
       
   283     
       
   284     /**
       
   285      * Fetch item count.
       
   286      * @return Total number of items.
       
   287      */
       
   288     IMPORT_C TInt ItemCount() const;
       
   289                 
       
   290     /**
       
   291      * Sets new default icon.
       
   292      * @param aDefaultIcon New default icon to be used in scroller.
       
   293      */
       
   294     IMPORT_C void SetDefaultIconL( CGulIcon* aDefaultIcon );
       
   295     
       
   296     /**
       
   297      * Disables Scrollbuffer.
       
   298      */
       
   299     IMPORT_C void DisableScrollBuffer();
       
   300     
       
   301     /**
       
   302      *  Changes mediawalls style.
       
   303      *  
       
   304      *  @param aStyle style.
       
   305      *  @param aRect new window rectangle.
       
   306      *  @param aReuseSurface flag to indicate whether or not OpenVG surface should be reconstructed.
       
   307      */
       
   308     IMPORT_C void ChangeStyleL( THgVgMediaWallStyle aStyle, const TRect& aRect, TBool aReuseSurface );
       
   309     
       
   310     /**
       
   311      * Sets button observer. Client can use this to register it self to be 
       
   312      * notified when the user for example, presses hide softkeys button.
       
   313      * 
       
   314      * @param aObserver observer.
       
   315      */
       
   316     IMPORT_C void SetObserver(MHgVgMediaWallObserver* aObserver);
       
   317     
       
   318     /**
       
   319      * Sets type of selection animation to perform, when an item
       
   320      * is opened.
       
   321      * Default behaviour is EHgSelectionAnimationFlipToFront.
       
   322      * 
       
   323      * @param aType type of opening animation.
       
   324      */
       
   325     IMPORT_C void SetOpeningAnimationType(THgVgOpeningAnimationType aType);
       
   326     
       
   327     /**
       
   328      * Gets current MediaWall style.
       
   329      * 
       
   330      * @return THgVgMediaWallStyle.
       
   331      */
       
   332     IMPORT_C THgVgMediaWallStyle Style() const;
       
   333     
       
   334     /**
       
   335      * Gets current opening animation type
       
   336      * 
       
   337      * @return THgVgOpeningAnimationType.
       
   338      */
       
   339     IMPORT_C THgVgOpeningAnimationType OpeningAnimationType() const;
       
   340     
       
   341     /**
       
   342      * Starts opening animation to selected direction. After animation is complete,
       
   343      * Open event is sent to selection observer.
       
   344      * 
       
   345      * @param aOpening if this is true, the selected item is opened, otherwise closed.
       
   346      */
       
   347     IMPORT_C void StartOpeningAnimationL(TBool aOpening);
       
   348     
       
   349     /**
       
   350      * Set mode flags. Possible values are defined in THgVgMediaWallMode.
       
   351      * @param aFlags flags to bet set.
       
   352      */
       
   353     IMPORT_C void SetFlags( TInt aFlags );
       
   354     
       
   355     /**
       
   356      * Clear mode flags. Possible values are defined in THgVgMediaWallMode.
       
   357      * @param aFlags flags to be cleared.
       
   358      */
       
   359     IMPORT_C void ClearFlags( TInt aFlags );
       
   360     
       
   361     /**
       
   362      * Get flags. Possible values are defined in THgVgMediaWallMode.
       
   363      * @return Current flags.
       
   364      */
       
   365     IMPORT_C TInt Flags();
       
   366     
       
   367     /**
       
   368      * Sets item at index as selected and opened item. HandleOpenL not called for observers.
       
   369      * If index is out of range, does nothing. Using this function sets item at index
       
   370      * to the state where it is when it was selected and opened by the user.
       
   371      * One can use for example. StartOpeningAnimationL to togle animation backwards from
       
   372      * this state to normal. This can be useful for example. when returning from a 
       
   373      * a different view and there is a need to pop the item back to the wall from front.
       
   374      * 
       
   375      * @param aIndex of the item to open.  
       
   376      */
       
   377     IMPORT_C void SetItemToOpenedState(TInt aIndex);
       
   378     
       
   379     /**
       
   380      * Sets the rectangle where item fit at the end of opening animation.
       
   381      * 
       
   382      * @param aRect target rectangle where opened item is fitted at the end of opening animation.
       
   383      */
       
   384     IMPORT_C void SetOpenedItemRect(const TRect& aRect);
       
   385                         
       
   386 protected: // Constructors
       
   387     
       
   388     CHgVgMediaWall( TInt aItemCount, 
       
   389             CGulIcon* aDefaultIcon, THgVgMediaWallStyle aStyle, 
       
   390             TBool aEnableScrollBar );
       
   391 
       
   392     void ConstructL (const TRect& aRect, MObjectProvider* aParent );
       
   393     
       
   394 private:
       
   395 
       
   396     /**
       
   397      * Handles viewposition change.
       
   398      */
       
   399     void HandleViewPositionChanged(TBool aDontUpdateObserver=EFalse);
       
   400             
       
   401     /**
       
   402      * Initializes items.
       
   403      */
       
   404     void InitItemsL();
       
   405     
       
   406         
       
   407     /**
       
   408      * 
       
   409      */
       
   410     void HandleKeyDown();
       
   411 
       
   412     /**
       
   413      * Handles key events.
       
   414      * 
       
   415      * @param aKeyEvent TKeyEvent-object.
       
   416      */
       
   417     TKeyResponse HandleKeyEvent(const TKeyEvent& aKeyEvent);
       
   418     
       
   419     /**
       
   420      * 
       
   421      */
       
   422     void HandleKeyUp();
       
   423     
       
   424     /**
       
   425      * 
       
   426      */
       
   427     void StopKeyScrolling();
       
   428     
       
   429     /**
       
   430      * 
       
   431      */
       
   432     void DoKeyScrolling();
       
   433     
       
   434     /**
       
   435      * 
       
   436      */
       
   437     static TInt KeyScrollingTimerCallback( TAny* aPtr );
       
   438         
       
   439     /**
       
   440      * Handles items count change.
       
   441      */
       
   442     void HandleItemCountChanged();
       
   443                 
       
   444     /**
       
   445      * Initializes default icon and
       
   446      * creates VGImage for it.
       
   447      */
       
   448     void InitDefaultIconL();
       
   449         
       
   450     /**
       
   451      * Draws using OpenVG
       
   452      */
       
   453     void DrawOpenVG() const;
       
   454                                 
       
   455     /**
       
   456      * Called by callback to do actual animation.
       
   457      */
       
   458     void DoAnimation();
       
   459     
       
   460     /**
       
   461      * Does transition animation, called by DoAnimation.
       
   462      */
       
   463     TBool DoTransitionAnimation();
       
   464         
       
   465     /**
       
   466      * Does selection animation
       
   467      */
       
   468     TBool DoSelectionAnimation();
       
   469     
       
   470     /**
       
   471      * Callback method for animation
       
   472      *
       
   473      * @param aPtr Pointer to an instance of CHgVgMediaWall class.
       
   474      *
       
   475      * @return System wide error code.
       
   476      */
       
   477     static TInt AnimationTimerCallback( TAny* aPtr );
       
   478                     
       
   479     /**
       
   480      * Updates bitmaps used to render album and artist titles.
       
   481      */
       
   482     void UpdateLabelsAndPopup();
       
   483 
       
   484     /**
       
   485      * Draws album and artist titles.
       
   486      */
       
   487     void DrawTitles(TReal aAlpha);
       
   488         
       
   489     
       
   490     /**
       
   491      * Initializes scroll bar.
       
   492      */
       
   493     void InitScrollBarL(TBool aResize);
       
   494     
       
   495     /**
       
   496      * Initializes skin rendering.
       
   497      */
       
   498     void InitSkinRendererL();
       
   499     
       
   500     /**
       
   501      * Initializes whole rendering functionality.
       
   502      */
       
   503     void InitRenderingL(TBool aRecreateSurface);
       
   504     
       
   505     /**
       
   506      * Frees videomemory used by items.
       
   507      */
       
   508     void FreeItemsImages();
       
   509     
       
   510     /**
       
   511      * Reloads images to items.
       
   512      */
       
   513     void ReloadItemsImages();
       
   514     
       
   515     /**
       
   516      * 
       
   517      */
       
   518     void HandleTapEventL(const TPoint& aPosition);
       
   519         
       
   520     /**
       
   521      * 
       
   522      */
       
   523     void HandleFlick(const TPoint& aSpeed);
       
   524  
       
   525     /**
       
   526      *
       
   527      */ 
       
   528     void HandleDragging(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent);
       
   529     
       
   530     /**
       
   531      * 
       
   532      */
       
   533     TInt GetStepsFromSpeed(TInt aSpeed) const;
       
   534     
       
   535     /**
       
   536      * 
       
   537      */
       
   538     void StartAnimationTimer();
       
   539                        
       
   540     /**
       
   541      * 
       
   542      */
       
   543     TReal GetAsPercentageOfScreenWidth(TInt aPixels) const;
       
   544     
       
   545     /**
       
   546      * 
       
   547      */
       
   548     TReal GetAsPercentageOfScreenHeight(TInt aPixels) const;
       
   549         
       
   550     /**
       
   551      * 
       
   552      */
       
   553     void DrawScene();
       
   554             
       
   555     /**
       
   556      * 
       
   557      */
       
   558     void HandleDragStart(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent);
       
   559     
       
   560     /**
       
   561      * 
       
   562      */
       
   563     void HandleDragOn(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent);
       
   564     
       
   565     /**
       
   566      * 
       
   567      */
       
   568     void HandleDragStop(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent);
       
   569         
       
   570     /**
       
   571      * 
       
   572      */
       
   573     void HandleTransitionAnimationStop();
       
   574         
       
   575     /**
       
   576      * 
       
   577      */
       
   578     void DrawLetterStripAndTitles();
       
   579     
       
   580     /**
       
   581      * 
       
   582      */
       
   583     void DrawButtonsAndScrollbar();
       
   584        
       
   585     /**
       
   586      * 
       
   587      */
       
   588     void InitButtonsL();
       
   589            
       
   590     /**
       
   591      * 
       
   592      */
       
   593     CGulIcon* CreateIconL(TInt aId1, TInt aId2, const TSize& aSize);
       
   594 
       
   595     /**
       
   596      * 
       
   597      */
       
   598     TBool HandleButtons(const TPointerEvent& aEvent);
       
   599     
       
   600     /**
       
   601      * 
       
   602      */
       
   603     TInt MaxViewPosition() const;
       
   604     
       
   605     
       
   606     /**
       
   607      * 
       
   608      */
       
   609     TBool BeginSelection(TInt aIndex);
       
   610     
       
   611     /**
       
   612      * 
       
   613      */
       
   614     void EndSelection();
       
   615     
       
   616     /**
       
   617      * 
       
   618      */
       
   619     void DoStartOpeningAnimationL();
       
   620     
       
   621     /**
       
   622      * 
       
   623      */
       
   624     void StartAnimationToPosition(TReal aX, TBool aUpdateScrollBar);
       
   625        
       
   626     /**
       
   627      * 
       
   628      */
       
   629     void StartAnimationToPosition(TReal aX, TReal aY, TBool aUpdateScrollBar);
       
   630 
       
   631     /**
       
   632      * 
       
   633      */
       
   634     CFbsBitmap* DrawToBitmap();
       
   635     
       
   636     /**
       
   637      * 
       
   638      */
       
   639     void DestroyRendering();
       
   640     
       
   641     /**
       
   642      * 
       
   643      */
       
   644     TBool DrawAll();
       
   645     
       
   646     /**
       
   647      * 
       
   648      */
       
   649     void InitMediaWallFullScreenLandscapeL();
       
   650     
       
   651     /**
       
   652      * 
       
   653      */
       
   654     void InitMediaWallTBonePortraitL();
       
   655     
       
   656     /**
       
   657      * 
       
   658      */
       
   659     void InitMediaWallGridLandscapeL();
       
   660 
       
   661     /**
       
   662      * 
       
   663      */
       
   664     void InitLabelsL(TInt aLayoutVariant);
       
   665     
       
   666     /**
       
   667      * 
       
   668      */
       
   669     void InitPopupL(TInt aLayoutVariant);
       
   670     
       
   671     /**
       
   672      * 
       
   673      */
       
   674     static TInt DelayedInit( TAny* aSelf);
       
   675     
       
   676     /**
       
   677      * 
       
   678      */
       
   679     void FillSystemGcWithSkin( ) const;
       
   680     
       
   681     /**
       
   682      * 
       
   683      */
       
   684     void SetConstantsForStyle();
       
   685 
       
   686     /**
       
   687      * 
       
   688      */
       
   689     TBool SearchItem( TChar& aFirstLetter );
       
   690 
       
   691 protected:
       
   692     CHgScrollBufferManager* iManager; // Own
       
   693     
       
   694     HBufC* iEmptyText; // text for empty list or grid.
       
   695     
       
   696     // Observers
       
   697     MHgSelectionObserver* iSelectionObserver; // Not Own
       
   698     
       
   699     // Arrays
       
   700     RPointerArray<CHgVgItem> iItems; // Items
       
   701 
       
   702     // For dragging
       
   703     TTime iPrevTime; // Previous pointer position time.
       
   704                 
       
   705     TInt iItemCount; // Total number of items
       
   706     
       
   707     TInt iItemsOnScreen; // Max items on screen.    
       
   708         
       
   709     TInt iSelectedIndex; // The index of the selected item
       
   710                                     
       
   711     CGulIcon* iDefaultIcon; // Default item icon, owns
       
   712                 
       
   713     THgVgAnimationState iAnimationState; // current animation state
       
   714     TInt64 iAnimationDuration; // total length of the animation    
       
   715     TTime iAnimationStartTime; // starting time of the animation   
       
   716     TReal iAnimationAlpha; // value going from 0-1 during animation    
       
   717     CHgVgTimer* iAnimationTimer;  
       
   718              
       
   719     TBool iScrollBarEnabled;
       
   720     CHgVgScrollBar* iScrollBar; // Scrollbar, owns
       
   721     TBool iScrollBarHit;
       
   722     TBool iUpdateScrollBar;
       
   723     
       
   724     CHgVgMediaWallRenderer* iRenderer; // Renderer for current media wall style, owns
       
   725             
       
   726     CHgVgSkinRenderer* iSkinRenderer; // Renderer for drawing skin, owns.
       
   727 
       
   728     THgVgMediaWallStyle iMediaWallStyle; // Style of mediawall.
       
   729                                 
       
   730     //TTime iKeyPressStartTime;
       
   731  
       
   732     AknTouchGestureFw::CAknTouchGestureFw* iTouchFw; // touch gesture fw, own.
       
   733     
       
   734     TReal iViewPositionAtDragStart;
       
   735     
       
   736     CHgVgPopup* iLetterPopup; // letter popup show when using scrollbar, own.
       
   737     
       
   738     CHgVgButton* iHideSKButton; // button for hiding softkeys, own.
       
   739     
       
   740     MHgVgMediaWallObserver* iMediaWallObserver;
       
   741     
       
   742     TRect iRect;
       
   743     
       
   744     THgVgOpeningAnimationType iOpeningAnimationType;
       
   745         
       
   746     TInt iPreviousPointerDelta;
       
   747 
       
   748     TBool iIsForeground;
       
   749     TBool iUsingDefaultIcon;
       
   750             
       
   751     TBool iButtonsHit;
       
   752         
       
   753     TBool iPointerDown; 
       
   754     
       
   755     CHgVgLabel* iArtistLabel; // label for artist text, own.
       
   756     CHgVgLabel* iAlbumLabel; // label for album text, own.
       
   757     CHgVgLabel* iEmptyLabel; // label for empty text, own.
       
   758 
       
   759     enum TKeyScrollingState
       
   760         {
       
   761         ENoKeyScrolling = 0,
       
   762         EKeyScrollingUp,
       
   763         EKeyScrollingDown,
       
   764         EKeyScrollingLeft,
       
   765         EKeyScrollingRight
       
   766         } iKeyScrollingState; // State of the key scrolling
       
   767     
       
   768     TInt iKeyRepeats;
       
   769     CPeriodic* iKeyScrollingTimer; // Timer for key scrolling, own.    
       
   770 
       
   771     CHgVgEGL* iEGL; // encapsulated egl stuff, own.
       
   772     
       
   773     TInt iRowCount; // number of rows in grid style
       
   774 
       
   775     TReal iCameraRotationFactor; // max amount of camera rotation in radians
       
   776     TReal iCameraZoomFactor; // max amount of zoom out
       
   777     TReal iSpringVelocityToAnimationFactor; // factor used to convert spring velocity to animation alpha
       
   778     
       
   779     RBuf iPopupText1; // text1 shown in popup 
       
   780     RBuf iPopupText2; // text2 shown in popup
       
   781                 
       
   782     TBool iSelectionMode; // used to indicate when user is selectin items in grid style
       
   783     
       
   784     THgVgSpring* iSpring; // spring physics simulator, own.
       
   785     
       
   786     TInt iBufferPosition;
       
   787     
       
   788     CHgVgItem* iTempItem;
       
   789 
       
   790     TInt iPickedGridItem; // item picked from grid
       
   791     
       
   792     TInt iPrevGridItem; // prev item selected from grid
       
   793     TInt iSelGridItem; // selected it from grid
       
   794     
       
   795     TReal iItemsToMoveOnFullScreenDrag;
       
   796     
       
   797     TInt iFlags;
       
   798     
       
   799     CAlfCompositionSource* iCompositionSource;    
       
   800     
       
   801     CPeriodic* iDelayedInit;
       
   802     
       
   803     TBool iFirstTime;
       
   804 
       
   805     TReal iSpringDragVel;
       
   806     TReal iSpringVelAtDragStart;
       
   807     TInt iDragFrames;
       
   808     TBool iObserverNotified;
       
   809 
       
   810     TRect iOpenedItemRect;
       
   811     
       
   812     TBool iRotatedDraw;
       
   813     };
       
   814 
       
   815        
       
   816 #endif /*HGVGMEDIAWALL_H_*/