camerauis/cameraapp/generic/inc/CamIndicator.h
branchRCL_3
changeset 54 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
53:61bc0f252b2b 54:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Camera Indicator class*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef CAMINDICATOR_H
       
    19 #define CAMINDICATOR_H
       
    20 
       
    21 // INCLUDES
       
    22  
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CCamBitmapItem;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 /**
       
    30 * Camera Indicator class for drawing indicators in the viewfinder
       
    31 */
       
    32 class CCamIndicator : public CBase
       
    33     {
       
    34     public: // Constructors and destructor
       
    35 
       
    36         /**
       
    37         * Symbian OS two-phased constructor
       
    38         * @since 2.8
       
    39         * @param aRect frame rectangle for control
       
    40         */
       
    41         static CCamIndicator* NewL( const TRect& aRect );
       
    42 
       
    43         /**
       
    44         * Destructor.
       
    45         */
       
    46         virtual ~CCamIndicator();
       
    47 
       
    48     private:
       
    49 
       
    50         /**
       
    51         * C++ constructor
       
    52         * @since 2.8
       
    53         * @param aRect frame rectangle for control
       
    54         */
       
    55         CCamIndicator( const TRect& aRect );
       
    56 
       
    57         /**
       
    58         * C++ default constructor.
       
    59         * @since 
       
    60         */
       
    61         CCamIndicator();
       
    62 
       
    63     public: // New functions
       
    64         /**
       
    65         * Called to add a bitmap to array of available
       
    66         * icons for the camera indicator
       
    67         * @since 2.8
       
    68         * @param aBitmapId bitmap identifier
       
    69         * @param aMaskId mask identifier
       
    70         */
       
    71         void AddIconL( TInt32 aBitmapId, TInt32 aMaskId );
       
    72 
       
    73         // This is needed because location icon is from svg file
       
    74         void AddSvgIconL( TInt32 aBitmapId, TInt32 aMaskId, const TSize& aSize );
       
    75         
       
    76         // update the rect according to new coordinates
       
    77         void UpdateRect( TRect& aRect );
       
    78         
       
    79         /**
       
    80         * Called to set the icon (no redraw request)
       
    81         * @since 2.8
       
    82         * @param aIndex index into available icons for this indicator
       
    83         */
       
    84         void SetIcon( TInt aIndex );
       
    85 
       
    86         /**
       
    87         * Called to clear the icon
       
    88         * @since 2.8
       
    89         */
       
    90         void ClearIcon();
       
    91 
       
    92         /**
       
    93         * Called to show the icon
       
    94         * @since 2.8
       
    95         */
       
    96         void DisplayIcon();
       
    97 
       
    98         /**
       
    99         * Called to check if indicator is currently flashing
       
   100         * @since 2.8
       
   101         * @return ETrue if indicator is in flashing state
       
   102         */
       
   103         TBool IsFlashing() const;
       
   104 
       
   105         /**
       
   106         * Called to set indicator flashing state
       
   107         * @since 2.8
       
   108         * @param aFlashing set to ETrue to set flashing state on
       
   109         */
       
   110         void SetFlashing( TBool aFlashing );
       
   111 
       
   112         /**
       
   113          * Allows the position to be overriden
       
   114          * @since 3.0
       
   115          * @param aPos The new position
       
   116          */
       
   117         void OverridePosition( const TPoint& aPos );
       
   118         
       
   119         /**
       
   120          * Resets the position set by OverridePosition and causes the 
       
   121          * indicator to be displayed in the originally speficied position.
       
   122          * @since 3.0
       
   123          */
       
   124         void CancelOverridePosition();
       
   125 
       
   126         /**
       
   127         * @since 2.8
       
   128         * @param aGc The graphics context to use for drawing
       
   129         */
       
   130         void Draw( CBitmapContext& aGc ) const;
       
   131         
       
   132         /**
       
   133         * Returns indicators layout rect  
       
   134         * @since 5.0
       
   135         */
       
   136         TRect LayoutRect();
       
   137 
       
   138         /**
       
   139          * Sets new size for all icons 
       
   140          * @since S60 5.0
       
   141          * @param aRect the new size for the icons
       
   142          */
       
   143         void SetRect( const TRect& aRect );
       
   144 
       
   145 private:
       
   146 
       
   147     private: // Data
       
   148         RPointerArray<CCamBitmapItem> iIcons; // array of available icons
       
   149         TInt iCurrentIcon; // index into icon array
       
   150         TBool iClear; // set to ETrue to clear the indicator
       
   151 
       
   152         TBool iFlashing; // set to ETrue for a flashing indicator
       
   153 
       
   154         // rect of the indicator in the viewfinder
       
   155         TRect iRect;
       
   156         
       
   157         // stores the originally specified (ie not overridden) rect
       
   158         TRect iDefaultRect;
       
   159 
       
   160     };
       
   161 
       
   162 #endif
       
   163 
       
   164 // End of File