idlehomescreen/xmluirendering/renderingplugins/xnvolumecontrolfactory/src/xnvolumecontrolfactory.cpp
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Implementation for factory creating CXnVolumeControl -element
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <coecntrl.h>
       
    21 #include <barsread.h>
       
    22 
       
    23 #include "xnvolumecontrolfactory.h"
       
    24 #include "xnvolumecontroladapter.h"
       
    25 #include "xntype.h"
       
    26 #include "xncomponent.h"
       
    27 #include "xnnodepluginif.h"
       
    28 #include "xndomnode.h"
       
    29 #include "xncomponentnodeimpl.h"
       
    30 #include <aisystemuids.hrh>
       
    31 #include "xnvolumecontrol.h"
       
    32 
       
    33 // ============================ MEMBER FUNCTIONS ===============================
       
    34 
       
    35 _LIT8(KSlider, "slider" );
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CXnVolumeControlFactory::MakeXnComponentL
       
    39 // Creates the Xuikon component for label control
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 MXnComponentFactory::TXnComponentFactoryResponse CXnVolumeControlFactory::MakeXnComponentL( 
       
    43                                         CXnNodePluginIf& aNode,
       
    44                                         CXnComponent*& aTargetComponent
       
    45         								)
       
    46     {
       
    47     MXnComponentFactory::TXnComponentFactoryResponse retVal = MXnComponentFactory::EXnFactoryResponseComponentNotSupported;
       
    48     // Check that the given type of a control is parent (or ancestor) of this control
       
    49     if(aNode.Type()->Type() == KSlider)
       
    50         {
       
    51     	  CXnVolumeControl* container = CXnVolumeControl::NewL();	
       
    52         aTargetComponent = static_cast<CXnComponent*>(container);
       
    53   	    retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed;
       
    54 	    }
       
    55     return retVal;  
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CXnVolumeControlFactory::MakeXnControlAdapterL
       
    60 // Creates the control adapter for label control
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 CXnControlAdapter* CXnVolumeControlFactory::MakeXnControlAdapterL(
       
    64                                             CXnNodePluginIf& aNode,
       
    65                                             CXnControlAdapter* aParent)
       
    66     {
       
    67     return CXnVolumeControlAdapter::NewL(aParent, aNode);
       
    68     }
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // CXnVolumeControlFactory::NewL
       
    72 // Two-phased constructor.
       
    73 // -----------------------------------------------------------------------------
       
    74 //
       
    75 CXnVolumeControlFactory* CXnVolumeControlFactory::NewL()
       
    76     {
       
    77     CXnVolumeControlFactory* self = new( ELeave ) CXnVolumeControlFactory;
       
    78     
       
    79     CleanupStack::PushL( self );
       
    80     self->ConstructL();
       
    81     CleanupStack::Pop();
       
    82 
       
    83     return self;
       
    84     }
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // CXnVolumeControlFactory::CXnVolumeControlFactory
       
    88 // C++ default constructor can NOT contain any code, that
       
    89 // might leave.
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 CXnVolumeControlFactory::CXnVolumeControlFactory()
       
    93     {
       
    94     }
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CXnVolumeControlFactory::~CXnVolumeControlFactory
       
    98 // Destructor.
       
    99 // -----------------------------------------------------------------------------
       
   100 //
       
   101 CXnVolumeControlFactory::~CXnVolumeControlFactory()
       
   102     {
       
   103     }
       
   104 
       
   105 // -----------------------------------------------------------------------------
       
   106 // CXnVolumeControlFactory::ConstructL
       
   107 // Symbian 2nd phase constructor can leave.
       
   108 // -----------------------------------------------------------------------------
       
   109 //
       
   110 void CXnVolumeControlFactory::ConstructL()
       
   111     {
       
   112     }
       
   113 
       
   114 
       
   115 // Define the interface UIDs
       
   116 const TImplementationProxy ImplementationTable[] =
       
   117     {
       
   118 #ifdef __EABI__ 
       
   119 	IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY_IMPLEMENTATION, CXnVolumeControlFactory::NewL) 
       
   120 #else
       
   121     {{AI3_UID_RENDERING_PLUGIN_VOLUMECONTROLFACTORY_IMPLEMENTATION}, CXnVolumeControlFactory::NewL}
       
   122 #endif
       
   123     };
       
   124 
       
   125 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   126     {
       
   127     aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
   128 
       
   129     return ImplementationTable;
       
   130     }