camerauis/cameraapp/generic/inc/CamDecorator.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24: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 UI decorator*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 #ifndef CAMDECORATOR_H
       
    20 #define CAMDECORATOR_H
       
    21 
       
    22 #include <e32base.h>
       
    23  
       
    24 
       
    25 class TResourceReader;
       
    26 class CBlendedBackground;
       
    27 class CBitmapContext;
       
    28 class TRect;
       
    29 class CCamAppController;
       
    30 class CCamRecordingIconDecoration;
       
    31 class MCamObserver;
       
    32 
       
    33 class CCamDecorator : public CBase
       
    34     {
       
    35 public:
       
    36     /**
       
    37     * Symbian OS two-phased constructor
       
    38     * @since 2.8
       
    39     * @param aResourceId The resource that describes the decorations required. If 0, a blank decorator is created (i.e. Draw() will have no effect)
       
    40     * @param aObserver If creator is interested, will be registered with observable decorations
       
    41     * @return New instance of class
       
    42     */
       
    43 	static CCamDecorator* NewL( CCamAppController& aController,
       
    44 	                            TInt               aResourceId, 
       
    45 	                            MCamObserver*      aObserver = NULL );
       
    46 
       
    47     /**
       
    48     * Destructor
       
    49     */
       
    50     ~CCamDecorator();
       
    51 
       
    52 protected:
       
    53     /**
       
    54     * Constructor
       
    55     */
       
    56     CCamDecorator( CCamAppController& aController );
       
    57 
       
    58     /**
       
    59     * Second-phase constructor
       
    60     * @param aResourceId The resource that describes the decorations required. If 0, a blank decorator is created (i.e. Draw() will have no effect)
       
    61     * @param aObserver If creator is interested, will be registered with observable decorations
       
    62     */
       
    63     void ConstructL( TInt aResourceId, MCamObserver* aObserver );
       
    64 
       
    65 public: // New functions
       
    66     /**
       
    67     * Draws all decorations
       
    68     * @param aGc The context to use while drawing
       
    69     * @param aDrawRect Rectangle passed on to decorations - meaning varies depending on decoration
       
    70     * @param aForceBlankers Forces the display of the blanking components
       
    71     */
       
    72     void Draw( CBitmapContext& aGc, const TRect& aDrawRect, const TBool aForceBlankers = EFalse );
       
    73 
       
    74 private: // New functions
       
    75     /**
       
    76     * Reads in the details of a blended background, and stores an object based on this
       
    77     * @param aResourceReader The resource reader to use
       
    78     */
       
    79     void CreateBlendedBackgroundL(TResourceReader& aResourceReader);
       
    80 
       
    81     /**
       
    82     * Reads in the details of a blanker, and stores an object based on this
       
    83     * @param aResourceReader The resource reader to use
       
    84     */
       
    85     void CreateDVFBlankerL(TResourceReader& aResourceReader);
       
    86 
       
    87     /**
       
    88     * Reads in the details of a recording icon, and stores an object based on this
       
    89     * @param aResourceReader The resource reader to use
       
    90     */
       
    91     void CreateRecordingIconL(TResourceReader& aResourceReader);
       
    92 
       
    93 private: // Data
       
    94     // Lists of all decorator elements
       
    95     RArray<TRect> iDVFBlankers;
       
    96     RPointerArray<CCamRecordingIconDecoration> iRecordingIcons;
       
    97     
       
    98     // Controller
       
    99     CCamAppController& iController;
       
   100 
       
   101     // An observer to add to observable decorations, if wanted. May be NULL.    
       
   102     MCamObserver* iPossibleObserver;
       
   103     
       
   104     // If true, nothing will be drawn on call to Draw. Optimization.
       
   105     TBool iDrawNothing;
       
   106     };
       
   107     
       
   108 #endif // CAMDECORATOR_H
       
   109 
       
   110 // End of File