idlehomescreen/inc/mxncomponentinterface.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  Base interface for component data APIs
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __MXNCOMPONENTINTERFACE_H__
       
    20 #define __MXNCOMPONENTINTERFACE_H__
       
    21 
       
    22 //  INCLUDES
       
    23 #include    <e32base.h>
       
    24 #include	"xnnodeappif.h"
       
    25 
       
    26 // CLASS DECLARATION
       
    27 /**
       
    28 *  Base interface for component data APIs
       
    29 *  @lib xnlayoutengine.lib
       
    30 *  @since Series 60 3.1
       
    31 */
       
    32 namespace XnComponentInterface
       
    33     {
       
    34     _LIT8(KType, "");
       
    35    
       
    36     class MXnComponentInterface
       
    37 		    {
       
    38         public:
       
    39         static inline const TDesC8& Type()
       
    40             {
       
    41             return KType;
       
    42             }
       
    43    			};
       
    44 		
       
    45     template<class T> TBool MakeInterfaceL(T*& aTargetInterface, CXnNodeAppIf& aNode)
       
    46         {
       
    47         aTargetInterface = static_cast<T*>(aNode.MakeInterfaceL(T::Type()));
       
    48         return aTargetInterface ? ETrue : EFalse;
       
    49         }
       
    50       }
       
    51 #endif //__MXNCOMPONENTINTERFACE_H__