photosgallery/viewframework/layouts/inc/glxzoomlayoutbase.h
changeset 0 4e91876724a2
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-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:    Definition of TGlxZoomLayoutBase
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef GLXZOOMLAYOUTBASE_H
       
    22 #define GLXZOOMLAYOUTBASE_H
       
    23 
       
    24 // INCLUDES
       
    25 
       
    26 #include <glxlayout.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 
       
    30 struct TAlfRealRect;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 * Abtract base class for zooming layouts.  Sets layout values based on
       
    36 * coordinates provided by the derived class.
       
    37 *
       
    38 * @internal reviewed 06/06/2007 by Kimmo Hoikka
       
    39 */
       
    40 class TGlxZoomLayoutBase : public TGlxLayout
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43 
       
    44         /**
       
    45         * C++ default constructor.
       
    46         */
       
    47         IMPORT_C TGlxZoomLayoutBase();
       
    48 
       
    49         /**
       
    50         * Destructor.
       
    51         */
       
    52         IMPORT_C ~TGlxZoomLayoutBase();
       
    53 
       
    54     public: // New functions
       
    55 
       
    56         /**
       
    57         * Set the image dimensions.
       
    58         * @param aDimensions Dimensions of the image being zoomed (in pixels)
       
    59         */
       
    60         IMPORT_C void SetImageDimensions(const TSize& aDimensions);
       
    61         /**
       
    62         * Get the image dimensions.
       
    63         * @return const TSize& Dimensions of the image being zoomed (in pixels)
       
    64         */
       
    65         IMPORT_C const TSize& ImageDimensions() const;
       
    66 
       
    67         /**
       
    68         * Get current zoom and pan values.  The returned rectangle is relative
       
    69         * to the screen, ie. if the width is 2, the visual should be twice the
       
    70         * width of the screen, and if the centre of the rectangle is (0, 0) the
       
    71         * visual should be centred on the screen. If the rectangle is
       
    72         * (-0.5, -0.5) - (0.5, 0.5) then the visual should exactly fill the
       
    73         * screen.
       
    74         * @param aRect Reference to rect in which to return coords.
       
    75         */
       
    76         virtual void GetCurrentCoords(TAlfRealRect& aRect) = 0;
       
    77         /**
       
    78         * Get "predicted" zoom and pan values.  These are the values that would
       
    79         * eventually be reached if the user released all zoom/pan keys now.
       
    80         * @param aRect Reference to rect in which to return coords.
       
    81         */
       
    82         virtual void GetPredictedCoords(TAlfRealRect& aRect) = 0;
       
    83 
       
    84     protected:  // From TGlxLayout
       
    85 
       
    86         /** See @ref TGlxLayout::DoSetLayoutValues */
       
    87         IMPORT_C void DoSetLayoutValues(TGlxLayoutInfo& aInfo);
       
    88         /** See @ref TGlxLayout::DoChanged */
       
    89         IMPORT_C TBool DoChanged() const;
       
    90         /** See @ref TGlxLayout::DoClearChanged */
       
    91         IMPORT_C void DoClearChanged();
       
    92 
       
    93     protected:  // Data
       
    94         /** Dimensions of the image being zoomed (in pixels) */
       
    95         TSize iImageDimensions;
       
    96 
       
    97     private:    // Data
       
    98         /** Whether the layout has changed since last refresh */
       
    99         TBool iChanged;
       
   100     };
       
   101 
       
   102 #endif  // GLXZOOMLAYOUTBASE_H
       
   103 
       
   104 // End of File