mmfenh/configurationcomponentsfactory/src/ConfigurationComponentsFactoryImpl.cpp
changeset 0 71ca22bcf22a
equal deleted inserted replaced
-1:000000000000 0:71ca22bcf22a
       
     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:  This is the implementation of the CConfigurationComponentsFactoryImpl class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <e32svr.h>
       
    22 #include "ConfigurationComponentsFactoryImpl.h"
       
    23 #include <RestrictedAudioOutputProxy.h>
       
    24 #include <AudioOutputControlUtilityProxy.h>
       
    25 
       
    26 #ifdef _DEBUG
       
    27 #define DEBPRN0         RDebug::Printf( "%s", __PRETTY_FUNCTION__);
       
    28 #define DEBPRN1(str)    RDebug::Printf( "%s %s", __PRETTY_FUNCTION__, str );
       
    29 #else
       
    30 #define DEBPRN0
       
    31 #define DEBPRN1(str)
       
    32 #endif
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // CConfigurationComponentsFactory::CBody::CBody
       
    36 // C++ default constructor can NOT contain any code, that
       
    37 // might leave.
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 CConfigurationComponentsFactory::CBody::CBody()
       
    41     {
       
    42     }
       
    43 
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CConfigurationComponentsFactory::CBody::ConstructL
       
    47 // Symbian 2nd phase constructor can leave.
       
    48 // assumes that iParent has already been set up properly
       
    49 // -----------------------------------------------------------------------------
       
    50 //
       
    51 void CConfigurationComponentsFactory::CBody::ConstructL()
       
    52     {
       
    53 
       
    54     }
       
    55 
       
    56 
       
    57 // Two-phased constructor.
       
    58 CConfigurationComponentsFactory::CBody* CConfigurationComponentsFactory::CBody::NewL()
       
    59     {
       
    60     DEBPRN0;
       
    61     
       
    62 	CConfigurationComponentsFactory::CBody* self = new(ELeave) CBody();
       
    63 	CleanupStack::PushL(self);
       
    64 	self->ConstructL();
       
    65 	CleanupStack::Pop(self);
       
    66 	return self;  
       
    67 
       
    68     }
       
    69     
       
    70 // -----------------------------------------------------------------------------
       
    71 // CConfigurationComponentsFactory::CBody::~CBody
       
    72 // Destructor
       
    73 // -----------------------------------------------------------------------------
       
    74 //
       
    75 CConfigurationComponentsFactory::CBody::~CBody()
       
    76     {
       
    77 
       
    78     } 
       
    79        
       
    80 // ---------------------------------------------------------
       
    81 // CConfigurationComponentsFactory::CBody::CreateRestrictedAudioOutput
       
    82 // ?implementation_description
       
    83 // (other items were commented in a header).
       
    84 // ---------------------------------------------------------
       
    85 //
       
    86 TInt CConfigurationComponentsFactory::CBody::CreateRestrictedAudioOutput(CMMFDevSound& aDevSound, CRestrictedAudioOutput*& aAudioOutput)
       
    87     {
       
    88     DEBPRN0;
       
    89     
       
    90     TInt err = KErrNone;
       
    91     TRAP(err, iAudioOutput = CRestrictedAudioOutputProxy::NewL(aDevSound));
       
    92     if (err != KErrNone)
       
    93     	return KErrNoMemory;
       
    94     
       
    95     aAudioOutput = iAudioOutput;
       
    96     
       
    97     return err;
       
    98     }
       
    99 
       
   100 // ---------------------------------------------------------
       
   101 // CConfigurationComponentsFactory::CBody::CreateAudioOutputControlUtility
       
   102 // ?implementation_description
       
   103 // (other items were commented in a header).
       
   104 // ---------------------------------------------------------
       
   105 //
       
   106 TInt CConfigurationComponentsFactory::CBody::CreateAudioOutputControlUtility(CAudioOutputControlUtility*& aAudioOutputControlUtility)
       
   107     {
       
   108     DEBPRN0;
       
   109     
       
   110     TInt err = KErrNone;    
       
   111     TRAP(err, iAudioOutputControlUtility = CAudioOutputControlUtilityProxy::NewL());
       
   112     if (err != KErrNone)
       
   113     	return KErrNoMemory;
       
   114     
       
   115     aAudioOutputControlUtility = iAudioOutputControlUtility;
       
   116     
       
   117     return err;
       
   118     }
       
   119     
       
   120 // End of file
       
   121