AppInc/CDrawOneByOne.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 DRAWONEBYONE_H
       
    19 #define DRAWONEBYONE_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 #include "ImagicContainerBrowser.h"
       
    25 #include "CDrawMagGlass.h"
       
    26 
       
    27 
       
    28 
       
    29 class CDrawMagGlass;
       
    30 
       
    31 struct TDrawOneByOneXY
       
    32     {
       
    33     float iX;
       
    34     float iY;
       
    35     };
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40  *  CDrawOneByOne
       
    41  * 
       
    42  */
       
    43 class CDrawOneByOne : public CBase
       
    44     {
       
    45 public:
       
    46     // Constructors and destructor
       
    47 
       
    48     /**
       
    49      * Destructor.
       
    50      */
       
    51     ~CDrawOneByOne();
       
    52 
       
    53     /**
       
    54      * Two-phased constructor.
       
    55      */
       
    56     static CDrawOneByOne* NewL(CImagicContainerBrowser* aContainer, TInt& aCurrentIndex);
       
    57 
       
    58     /**
       
    59      * Two-phased constructor.
       
    60      */
       
    61     static CDrawOneByOne* NewLC(CImagicContainerBrowser* aContainer, TInt& aCurrentIndex);
       
    62 
       
    63 private:
       
    64 
       
    65     /**
       
    66      * Constructor for performing 1st stage construction
       
    67      */
       
    68     CDrawOneByOne(CImagicContainerBrowser* aContainer, TInt& aCurrentIndex);
       
    69 
       
    70     /**
       
    71      * EPOC default constructor for performing 2nd stage construction
       
    72      */
       
    73     void ConstructL(CImagicContainerBrowser* aContainer, TInt& aCurrentIndex);
       
    74     void CheckImageLocation(/*float& aImageWidth, float& aImageHeight*/);
       
    75     void HandleMovingKeysOnebyOne();
       
    76     
       
    77 public:
       
    78     void InitDrawOnebyOne(TReal aDrawZoom, TReal aInPictureX, TReal aInPictureY);
       
    79     void DrawOnebyOneL(const TSize &aSize);
       
    80     TBool IsDrawingNeededOneByOne();
       
    81     float GetMovingStep();
       
    82     float GetImgeFlowLocation();
       
    83     void SetImgeFlowLocation(float aValue);
       
    84     TDrawOneByOneXY GetDrawOneByOneXY();
       
    85     TDrawOneByOneXY GetDrawOneByOneTargetXY();
       
    86     void SetDrawOneByOneTargetXY(TDrawOneByOneXY aValue);
       
    87     void ChangeDrawOneByOneTargetX(float aValue);
       
    88     void ChangeDrawOneByOneTargetY(float aValue);
       
    89     float GetDrawOneByOneZoom();
       
    90     void SetDrawOneByOneZoom(float aValue);
       
    91     float GetDrawOneByOneTargetZoom();
       
    92     void SetDrawOneByOneTargetZoom(float aValue);
       
    93     float GetDrawOneByOneWidth();
       
    94     void SetDrawOneByOneWidth(float aValue);
       
    95     float GetDrawOneByOneHeight();
       
    96     void SetDrawOneByOneHeight(float aValue);
       
    97     
       
    98     TBool IsMagGlassOn();
       
    99     void SetMagGlassStatus(TBool aValue);
       
   100     TBool IsMagGlassPrevStateOn();
       
   101     void SetMagGlassPrevStatus(TBool aValue);
       
   102     CDrawMagGlass* GetMagGlass();
       
   103     void KeyPressed();
       
   104     void KeyReleased();
       
   105     void KeyEvent();
       
   106 
       
   107     
       
   108     
       
   109 private:    
       
   110     CImagicContainerBrowser* iContainer;
       
   111     CDrawMagGlass*           iMagGlass;
       
   112     
       
   113     float                    iMovingSpeed;
       
   114     float                    iMovingStep;
       
   115     
       
   116     float                    iZoomingStep;
       
   117     float                    iZoomingSpeed;
       
   118     float                    iScalingSpeed;
       
   119     float                    iOneByOneFlow;
       
   120     
       
   121     TDrawOneByOneXY          iDrawOneByOneXY;
       
   122     TDrawOneByOneXY          iDrawOneByOneTargetXY;
       
   123     float                    iDrawOneByOneZoom;//Used for image scaling in OneByOne mode
       
   124     float                    iDrawOneByOneTargetZoom;//Used for image zooming in OneByOne mode
       
   125     float                    iDrawOnebyOneW, iDrawOnebyOneH;//OneByOne mode image size Widht and Height
       
   126     float                    iInPictureX, iInPictureY;
       
   127     //when moving in picture zoomed in, this defines value how we can go over the image boundary
       
   128     float                    iBorder;
       
   129     //Size of the screen, when moving in picture zoomed in
       
   130     float                    iScreenW;
       
   131     float                    iScreenH;
       
   132     float                    iImageWidth;
       
   133     float                    iImageHeight;
       
   134     float                    iFadeColor;
       
   135     //MagGlass
       
   136     TBool                    iMagGlassOn;
       
   137     TBool                    iMagGlassOnPrev;
       
   138     float                    iFlowThresHold;
       
   139     TReal                    iMenuAlpha;
       
   140     
       
   141 public:
       
   142     static const float KMaxMagGlassZoomFactor;
       
   143     
       
   144     };
       
   145 
       
   146 #endif // DRAWONEBYONE_H