uiresources/src/testsdkskinsblocksfbcc.cpp
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     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 the License "Symbian Foundation License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Test AknsFrameBackgroundControlContext.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <aknsframebackgroundcontrolcontext.h>
       
    20 
       
    21 #include "testsdkskins.h"
       
    22 
       
    23 const TInt KLength = 10;
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 // -----------------------------------------------------------------------------
       
    26 // CTestSDKSkins::TestFBCCNewL
       
    27 // -----------------------------------------------------------------------------
       
    28 TInt CTestSDKSkins::TestFBCCNewL( CStifItemParser& /*aItem*/ )
       
    29     {
       
    30     TAknsItemID itemID;
       
    31     
       
    32     TPoint pointTL( 0, 0 );
       
    33     TPoint pointBR( KLength, KLength );
       
    34     const TInt KOutPoint = 50;
       
    35     TPoint outPoint( KOutPoint, KOutPoint );
       
    36     const TInt KInPoint = 40;
       
    37     TPoint inPoint( KInPoint, KInPoint );
       
    38     TRect outRect( pointTL, outPoint );
       
    39     TRect inRect( pointBR, inPoint );
       
    40     
       
    41     CAknsFrameBackgroundControlContext* context = 
       
    42         CAknsFrameBackgroundControlContext::NewL( itemID, 
       
    43                                                   outRect, 
       
    44                                                   inRect, 
       
    45                                                   ETrue );
       
    46     CleanupStack::PushL( context );
       
    47     STIF_ASSERT_NOT_NULL( context );
       
    48     
       
    49     CleanupStack::PopAndDestroy( context );
       
    50     
       
    51     return KErrNone;
       
    52     
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CTestSDKSkins::TestFBCCSetFrameL
       
    57 // -----------------------------------------------------------------------------
       
    58 TInt CTestSDKSkins::TestFBCCSetFrameL( CStifItemParser& /*aItem*/ )
       
    59     {
       
    60     TAknsItemID itemID;
       
    61     
       
    62     TPoint pointTL( 0, 0 );
       
    63     TPoint pointBR( KLength, KLength );
       
    64     const TInt KOutPoint = 50;
       
    65     TPoint outPoint( KOutPoint, KOutPoint );
       
    66     const TInt KInPoint = 40;
       
    67     TPoint inPoint( KInPoint, KInPoint );
       
    68     TRect outRect( pointTL, outPoint );
       
    69     TRect inRect( pointBR, inPoint );
       
    70     
       
    71     CAknsFrameBackgroundControlContext* context = 
       
    72         CAknsFrameBackgroundControlContext::NewL( itemID, 
       
    73                                                   outRect, 
       
    74                                                   inRect, 
       
    75                                                   ETrue );
       
    76     CleanupStack::PushL( context );
       
    77     STIF_ASSERT_NOT_NULL( context );
       
    78     
       
    79     context->SetFrame( itemID );
       
    80     
       
    81     CleanupStack::PopAndDestroy( context );
       
    82     
       
    83     return KErrNone;
       
    84     
       
    85     }
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // CTestSDKSkins::TestFBCCSetFrameRectsL
       
    89 // -----------------------------------------------------------------------------
       
    90 TInt CTestSDKSkins::TestFBCCSetFrameRectsL( CStifItemParser& /*aItem*/ )
       
    91     {
       
    92     TAknsItemID itemID;
       
    93     
       
    94     TPoint pointTL( 0, 0 );
       
    95     TPoint pointBR( KLength, KLength );
       
    96     const TInt KOutPoint = 50;
       
    97     TPoint outPoint( KOutPoint, KOutPoint );
       
    98     const TInt KInPoint = 40;
       
    99     TPoint inPoint( KInPoint, KInPoint );
       
   100     TRect outRect( pointTL, outPoint );
       
   101     TRect inRect( pointBR, inPoint );
       
   102     
       
   103     CAknsFrameBackgroundControlContext* context = 
       
   104         CAknsFrameBackgroundControlContext::NewL( itemID, 
       
   105                                                   outRect, 
       
   106                                                   inRect, 
       
   107                                                   ETrue );
       
   108     CleanupStack::PushL( context );
       
   109     STIF_ASSERT_NOT_NULL( context );
       
   110     
       
   111     context->SetFrameRects( outRect, inRect );
       
   112     
       
   113     CleanupStack::PopAndDestroy( context );
       
   114     
       
   115     return KErrNone;
       
   116     
       
   117     }
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CTestSDKSkins::TestFBCCSetCenterL
       
   121 // -----------------------------------------------------------------------------
       
   122 TInt CTestSDKSkins::TestFBCCSetCenterL( CStifItemParser& /*aItem*/ )
       
   123     {
       
   124     TAknsItemID itemID;
       
   125     
       
   126     TPoint pointTL( 0, 0 );
       
   127     TPoint pointBR( KLength, KLength );
       
   128     const TInt KOutPoint = 50;
       
   129     TPoint outPoint( KOutPoint, KOutPoint );
       
   130     const TInt KInPoint = 40;
       
   131     TPoint inPoint( KInPoint, KInPoint );
       
   132     TRect outRect( pointTL, outPoint );
       
   133     TRect inRect( pointBR, inPoint );
       
   134     
       
   135     CAknsFrameBackgroundControlContext* context = 
       
   136         CAknsFrameBackgroundControlContext::NewL( itemID, 
       
   137                                                   outRect, 
       
   138                                                   inRect, 
       
   139                                                   ETrue );
       
   140     CleanupStack::PushL( context );
       
   141     STIF_ASSERT_NOT_NULL( context );
       
   142     
       
   143     context->SetCenter( itemID );
       
   144     
       
   145     CleanupStack::PopAndDestroy( context );
       
   146     
       
   147     return KErrNone;
       
   148     
       
   149     }
       
   150 
       
   151 // -----------------------------------------------------------------------------
       
   152 // CTestSDKSkins::TestFBCCSetFramePartRectL
       
   153 // -----------------------------------------------------------------------------
       
   154 TInt CTestSDKSkins::TestFBCCSetFramePartRectL( CStifItemParser& /*aItem*/ )
       
   155     {
       
   156     TAknsItemID itemID;
       
   157     
       
   158     TPoint pointTL( 0, 0 );
       
   159     TPoint pointBR( KLength, KLength );
       
   160     const TInt KOutPoint = 50;
       
   161     TPoint outPoint( KOutPoint, KOutPoint );
       
   162     const TInt KInPoint = 40;
       
   163     TPoint inPoint( KInPoint, KInPoint );
       
   164     TRect outRect( pointTL, outPoint );
       
   165     TRect inRect( pointBR, inPoint );
       
   166     
       
   167     CAknsFrameBackgroundControlContext* context = 
       
   168         CAknsFrameBackgroundControlContext::NewL( itemID, 
       
   169                                                   outRect, 
       
   170                                                   inRect, 
       
   171                                                   ETrue );
       
   172     CleanupStack::PushL( context );
       
   173     STIF_ASSERT_NOT_NULL( context );
       
   174     
       
   175     context->SetFramePartRect( outRect, EAknsFrameIndexTl );
       
   176     
       
   177     CleanupStack::PopAndDestroy( context );
       
   178     
       
   179     return KErrNone;
       
   180     
       
   181     }