uiresources_pub/skins_api/tsrc/src/testsdkskinsblockscc.cpp
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     1 /*
       
     2 * Copyright (c) 2002 - 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:  Test AknsControlContext.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <aknscontrolcontext.h>
       
    20 #include <aknsbasicbackgroundcontrolcontext.h>
       
    21 
       
    22 #include "testsdkskins.h"
       
    23 
       
    24 const TInt KLength = 10;
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 // -----------------------------------------------------------------------------
       
    27 // CTestSDKSkins::TestCCSupplyMopObjectL
       
    28 // -----------------------------------------------------------------------------
       
    29 TInt CTestSDKSkins::TestCCSupplyMopObjectL( CStifItemParser& /*aItem*/ )
       
    30     {
       
    31     TAknsItemID itemID;
       
    32     TPoint pointTL( 0, 0 );
       
    33     TPoint pointBR( KLength, KLength );
       
    34     TRect rect( pointTL, pointBR );
       
    35     CAknsBasicBackgroundControlContext* context = 
       
    36         CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
       
    37     CleanupStack::PushL( context );
       
    38     STIF_ASSERT_NOT_NULL( context );
       
    39     
       
    40     TTypeUid::Ptr ptr = TTypeUid::Null();
       
    41     ptr = context->SupplyMopObject( MAknsControlContext::ETypeId, context );
       
    42     CAknsBasicBackgroundControlContext* point = 
       
    43         static_cast<CAknsBasicBackgroundControlContext*> ( ptr.Pointer() );
       
    44     STIF_ASSERT_NOT_NULL( point );
       
    45     
       
    46     CleanupStack::PopAndDestroy( context );
       
    47     
       
    48     return KErrNone;
       
    49     
       
    50     }