mmsharing/mmshui/inc/musuiresourcehandler.h
branchRCL_3
changeset 33 bc78a40cd63c
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Handler for camera, keypad and video player resources
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "musuipropertyobserver.h"
       
    21 #include "musresourceproperties.h"
       
    22 #include "mussettingskeys.h"
       
    23 #include "musmanagercommon.h"
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 class CMusUiPropertyWatch;
       
    28 class MMusUiEventObserver;
       
    29 class CAknWaitDialog;
       
    30 
       
    31 /**
       
    32  * Encapsulates handling and observing of camera, keypad and video player
       
    33  * hardware and software resources.
       
    34  */
       
    35 class CMusUiResourceHandler : public CBase,
       
    36                               public MMusUiPropertyObserver
       
    37     {
       
    38     
       
    39     public:
       
    40     
       
    41         virtual ~CMusUiResourceHandler();
       
    42         
       
    43         static CMusUiResourceHandler* NewL( MMusUiEventObserver& aObserver );
       
    44     
       
    45     public: // API
       
    46         
       
    47         TBool RequestKeypadL( TBool aMandatory = EFalse );
       
    48         
       
    49         TBool RequestCameraL( TBool aMandatory = EFalse );
       
    50         
       
    51         TBool RequestVideoPlayerL( TBool aMandatory = EFalse );
       
    52         
       
    53         void CheckInitialOrientationL( MultimediaSharing::TMusUseCase aUsecase );
       
    54         
       
    55         
       
    56     public:	// From MMusUiPropertyObserver
       
    57 
       
    58         /**
       
    59         * @param TUint aKey - The Property key
       
    60         * @param TInt aValue - The value of the Property key
       
    61         */
       
    62         virtual	void PropertyChanged( const TUint aKey, const TInt aValue );
       
    63 
       
    64         virtual void HandlePropertyError( const TInt aReason );
       
    65         
       
    66         
       
    67     private:
       
    68     
       
    69         CMusUiResourceHandler( MMusUiEventObserver& aObserver );
       
    70         
       
    71         void ConstructL();
       
    72     
       
    73     
       
    74     private: // Helpers
       
    75     
       
    76         TBool ShowChangeProductModeDialogL( const TDesC& aPrompt );
       
    77         
       
    78         TBool IsCurrentlyAvailable( NMusResourceApi::TAvailability aResourceAvailability,
       
    79         							MusSettingsKeys::TUsability aResourceUsability );
       
    80         
       
    81         
       
    82     private: // data
       
    83         
       
    84         /**
       
    85         * 
       
    86         */
       
    87         MMusUiEventObserver& iObserver;
       
    88     
       
    89         /**
       
    90         * 
       
    91         */
       
    92     	CMusUiPropertyWatch* iCameraResourceWatch;
       
    93 
       
    94         /**
       
    95         * 
       
    96         */
       
    97     	CMusUiPropertyWatch* iKeypadResourceWatch;
       
    98         
       
    99         /**
       
   100         * It holds the value for CameraAvailability.
       
   101         * If it is static available ( Bit set to 0 in Cenrep)
       
   102         * then it will be available always , if the bit set
       
   103         * to 1 ( dynamic ) then it should be monitored by property
       
   104         * listner and set the value accordingly.
       
   105         */
       
   106         NMusResourceApi::TAvailability iCameraAvailability;
       
   107 
       
   108         /**
       
   109         * It holds the value for KeypadAvailability.
       
   110         * If it is static available ( Bit set to 0 in Cenrep)
       
   111         * then it will be available always , if the bit set
       
   112         * to 1 ( dynamic ) then it should be monitored by property
       
   113         * listner and set the value accordingly.
       
   114         */
       
   115         NMusResourceApi::TAvailability iKeypadAvailability;
       
   116 
       
   117 		/**
       
   118         * It holds the value for CameraUsability.
       
   119         * Intially read from cenrep and assigned
       
   120         * Refer mussettingskeys.h to know the bit value.
       
   121         */
       
   122         MusSettingsKeys::TUsability iCameraUsability;
       
   123         
       
   124         /**
       
   125         * It holds the value for KeypadUsability.
       
   126         * Intially read from cenrep and assigned
       
   127         * Refer mussettingskeys.h to know the bit value.
       
   128         */
       
   129         MusSettingsKeys::TUsability iKeypadUsability;
       
   130         
       
   131         /**
       
   132         * It holds the value for VideoplayerUsability.
       
   133         * Intially read from cenrep and assigned
       
   134         * Refer mussettingskeys.h to know the bit value.
       
   135         */
       
   136         MusSettingsKeys::TUsability iVideoplayerUsability;
       
   137 
       
   138         /**
       
   139         * 
       
   140         */
       
   141         TBool iCameraAvailibilityInProgress;
       
   142         
       
   143         /**
       
   144         * 
       
   145         */
       
   146         TBool iKeypadAvailibilityInProgress;
       
   147         
       
   148         /**
       
   149         * 
       
   150         */
       
   151         CAknWaitDialog* iChangeProductModeDialog;
       
   152         
       
   153         /**
       
   154         * 
       
   155         */
       
   156         HBufC* iDialogPrompt;
       
   157         
       
   158     };
       
   159 
       
   160 
       
   161 
       
   162