AppInc/CDrawGrid.h
changeset 3 93fff7023be8
equal deleted inserted replaced
2:e1e28b0273b0 3:93fff7023be8
       
     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: Juha Kauppinen, Mika Hokkanen
       
    13 * 
       
    14 * Description: Photo Browser
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CDRAWGRID_H
       
    19 #define CDRAWGRID_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 #include "ImagicContainerBrowser.h"
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 
       
    29 struct TGridXY
       
    30     {
       
    31     float iX;
       
    32     float iY;
       
    33     };
       
    34     
       
    35     
       
    36 /**
       
    37  *  CDrawGrid
       
    38  * 
       
    39  */
       
    40 class CDrawGrid : public CBase
       
    41     {
       
    42 public:
       
    43     // Constructors and destructor
       
    44 
       
    45     /**
       
    46      * Destructor.
       
    47      */
       
    48     ~CDrawGrid();
       
    49 
       
    50     /**
       
    51      * Two-phased constructor.
       
    52      */
       
    53     static CDrawGrid* NewL(CImagicContainerBrowser* aContainer, TInt& aCurrentIndex);
       
    54 
       
    55     /**
       
    56      * Two-phased constructor.
       
    57      */
       
    58     static CDrawGrid* NewLC(CImagicContainerBrowser* aContainer, TInt& aCurrentIndex);
       
    59 
       
    60 private:
       
    61 
       
    62     /**
       
    63      * Constructor for performing 1st stage construction
       
    64      */
       
    65     CDrawGrid(CImagicContainerBrowser* aContainer, TInt& aCurrentIndex);
       
    66 
       
    67     /**
       
    68      * EPOC default constructor for performing 2nd stage construction
       
    69      */
       
    70     void ConstructL(CImagicContainerBrowser* aContainer, TInt& aCurrentIndex);
       
    71     
       
    72     void MovingDirection();
       
    73     void DisplayDate();
       
    74     void SetPrespective(const TSize &aSize);
       
    75     void DrawFrame(TInt aIndex);
       
    76     void BubbleEffect(TInt& x, TInt& y, float& z);
       
    77     void HandleKeys();
       
    78     
       
    79 public:
       
    80     void InitDrawGrid();
       
    81     void DrawGridL(const TSize &aSize);
       
    82     TBool IsDrawingNeededGrid();
       
    83     TReal GetCurrentGridTilt();
       
    84     TReal GetGridZoom();
       
    85     TGridXY GetGridTargetXY();
       
    86     void SetGridTargetXY(TGridXY aValue);
       
    87     TGridXY GetGridXY();
       
    88     void SetGridXY(TGridXY aValue);
       
    89     void UpdateImageCoordinates(const TInt aFirstIndex);    
       
    90     void KeyPressed();
       
    91     void KeyReleased();
       
    92     void KeyEvent();
       
    93     
       
    94     CImagicContainerBrowser* iContainer;
       
    95     
       
    96     float               iPerspectiveCurrent;//current value of perspective when moving on grid by tilting while grid
       
    97     //float               iPerspectiveTarget;//target value of perspective
       
    98     float               iGridMovingSpeed;
       
    99     float               iGridZoomSpeed;//zoom value in Grid
       
   100     float               iGridZoomStep;//zoom value in Grid
       
   101     float               iDrawGridZoom;//Holds zooming value for Grid
       
   102     float               iDrawGridTargetZoom;//Holds target zooming value for Grid
       
   103     float               iTargetPerspective;
       
   104     TBool               iIntheEndOfGrid;
       
   105     TBool               iJumpOver;
       
   106     TUint               iLastGridTexture;
       
   107     TBool               iMovingRight;
       
   108     TBool               iMovingLeft;
       
   109     TDateTime           iPrevDateTime;
       
   110     TGridXY             iDrawGridXY;
       
   111     TGridXY             iDrawGridTargetXY;
       
   112     
       
   113     
       
   114     
       
   115     //variables used in Buble mode
       
   116     TBool               iBubbleEffect;//Flag for "Bubble" effect to set it on/off
       
   117     TInt                iDistanceX;
       
   118     TInt                iDistanceY;
       
   119     TInt                iDiff;
       
   120     TInt                iDistX;
       
   121     TInt                iDistY;
       
   122     TInt                iBindDiff;
       
   123     
       
   124     
       
   125     TInt                iKeyTimer;
       
   126     TInt                iKeyTimer2;
       
   127     
       
   128     TReal               iMenuAlpha;
       
   129     
       
   130     float               iScaleTarget;
       
   131     };
       
   132 
       
   133 #endif // CDRAWGRID_H