749
|
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 AknsBasicBackgroundControlContext.h
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <aknsbasicbackgroundcontrolcontext.h>
|
|
20 |
|
|
21 |
#include "testsdkskins.h"
|
|
22 |
|
|
23 |
const TInt KLength = 10;
|
|
24 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
25 |
// -----------------------------------------------------------------------------
|
|
26 |
// CTestSDKSkins::TestBBCCNewL
|
|
27 |
// -----------------------------------------------------------------------------
|
|
28 |
TInt CTestSDKSkins::TestBBCCNewL( CStifItemParser& /*aItem*/ )
|
|
29 |
{
|
|
30 |
TAknsItemID itemID;
|
|
31 |
TPoint pointTL( 0, 0 );
|
|
32 |
TPoint pointBR( KLength, KLength );
|
|
33 |
TRect rect( pointTL, pointBR );
|
|
34 |
CAknsBasicBackgroundControlContext* context =
|
|
35 |
CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
|
|
36 |
CleanupStack::PushL( context );
|
|
37 |
|
|
38 |
STIF_ASSERT_NOT_NULL( context );
|
|
39 |
|
|
40 |
CleanupStack::PopAndDestroy( context );
|
|
41 |
|
|
42 |
return KErrNone;
|
|
43 |
|
|
44 |
}
|
|
45 |
|
|
46 |
// -----------------------------------------------------------------------------
|
|
47 |
// CTestSDKSkins::TestBBCCSetBitmapL
|
|
48 |
// -----------------------------------------------------------------------------
|
|
49 |
TInt CTestSDKSkins::TestBBCCSetBitmapL( CStifItemParser& /*aItem*/ )
|
|
50 |
{
|
|
51 |
TAknsItemID itemID;
|
|
52 |
TPoint pointTL( 0, 0 );
|
|
53 |
TPoint pointBR( KLength, KLength );
|
|
54 |
TRect rect( pointTL, pointBR );
|
|
55 |
CAknsBasicBackgroundControlContext* context =
|
|
56 |
CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
|
|
57 |
CleanupStack::PushL( context );
|
|
58 |
STIF_ASSERT_NOT_NULL( context );
|
|
59 |
|
|
60 |
context->SetBitmap( itemID );
|
|
61 |
|
|
62 |
CleanupStack::PopAndDestroy( context );
|
|
63 |
|
|
64 |
return KErrNone;
|
|
65 |
|
|
66 |
}
|
|
67 |
|
|
68 |
// -----------------------------------------------------------------------------
|
|
69 |
// CTestSDKSkins::TestBBCCSetRectL
|
|
70 |
// -----------------------------------------------------------------------------
|
|
71 |
TInt CTestSDKSkins::TestBBCCSetRectL( CStifItemParser& /*aItem*/ )
|
|
72 |
{
|
|
73 |
TAknsItemID itemID;
|
|
74 |
TPoint pointTL( 0, 0 );
|
|
75 |
TPoint pointBR( KLength, KLength );
|
|
76 |
TRect rect( pointTL, pointBR );
|
|
77 |
CAknsBasicBackgroundControlContext* context =
|
|
78 |
CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
|
|
79 |
CleanupStack::PushL( context );
|
|
80 |
STIF_ASSERT_NOT_NULL( context );
|
|
81 |
|
|
82 |
context->SetRect( rect );
|
|
83 |
|
|
84 |
CleanupStack::PopAndDestroy( context );
|
|
85 |
|
|
86 |
return KErrNone;
|
|
87 |
|
|
88 |
}
|
|
89 |
|
|
90 |
// -----------------------------------------------------------------------------
|
|
91 |
// CTestSDKSkins::TestBBCCSetParentPosL
|
|
92 |
// -----------------------------------------------------------------------------
|
|
93 |
TInt CTestSDKSkins::TestBBCCSetParentPosL( CStifItemParser& /*aItem*/ )
|
|
94 |
{
|
|
95 |
TAknsItemID itemID;
|
|
96 |
TPoint pointTL( 0, 0 );
|
|
97 |
TPoint pointBR( KLength, KLength );
|
|
98 |
TRect rect( pointTL, pointBR );
|
|
99 |
CAknsBasicBackgroundControlContext* context =
|
|
100 |
CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
|
|
101 |
CleanupStack::PushL( context );
|
|
102 |
STIF_ASSERT_NOT_NULL( context );
|
|
103 |
|
|
104 |
context->SetParentPos( pointBR );
|
|
105 |
|
|
106 |
CleanupStack::PopAndDestroy( context );
|
|
107 |
|
|
108 |
return KErrNone;
|
|
109 |
|
|
110 |
}
|
|
111 |
|
|
112 |
// -----------------------------------------------------------------------------
|
|
113 |
// CTestSDKSkins::TestBBCCSetParentContextL
|
|
114 |
// -----------------------------------------------------------------------------
|
|
115 |
TInt CTestSDKSkins::TestBBCCSetParentContextL( CStifItemParser& /*aItem*/ )
|
|
116 |
{
|
|
117 |
TAknsItemID itemID;
|
|
118 |
TPoint pointTL( 0, 0 );
|
|
119 |
TPoint pointBR( KLength, KLength );
|
|
120 |
TRect rect( pointTL, pointBR );
|
|
121 |
CAknsBasicBackgroundControlContext* context =
|
|
122 |
CAknsBasicBackgroundControlContext::NewL( itemID, rect, ETrue );
|
|
123 |
CleanupStack::PushL( context );
|
|
124 |
STIF_ASSERT_NOT_NULL( context );
|
|
125 |
|
|
126 |
context->SetParentContext( context );
|
|
127 |
|
|
128 |
CleanupStack::PopAndDestroy( context );
|
|
129 |
|
|
130 |
return KErrNone;
|
|
131 |
|
|
132 |
}
|