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
|
872
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
749
|
6 |
* which accompanies this distribution, and is available
|
872
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
749
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Test AknsListBoxBackgroundControlContext.h
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <aknslistboxbackgroundcontrolcontext.h>
|
|
20 |
|
|
21 |
#include "testsdkskins.h"
|
|
22 |
|
|
23 |
const TInt KLength = 10;
|
|
24 |
const TInt KTiledLength = 20;
|
|
25 |
// ============================ MEMBER FUNCTIONS ===============================
|
|
26 |
// -----------------------------------------------------------------------------
|
|
27 |
// CTestSDKSkins::TestLBBCCNewL
|
|
28 |
// -----------------------------------------------------------------------------
|
|
29 |
TInt CTestSDKSkins::TestLBBCCNewL( CStifItemParser& /*aItem*/ )
|
|
30 |
{
|
|
31 |
TAknsItemID itemID;
|
|
32 |
TAknsItemID tileditemID;
|
|
33 |
TPoint pointTL( 0, 0 );
|
|
34 |
TPoint pointBR( KLength, KLength );
|
|
35 |
TPoint pointSBR( KTiledLength, KTiledLength );
|
|
36 |
TRect rect( pointTL, pointBR );
|
|
37 |
TRect rectTiled( pointBR, pointSBR );
|
|
38 |
|
|
39 |
CAknsListBoxBackgroundControlContext* context =
|
|
40 |
CAknsListBoxBackgroundControlContext::NewL( itemID, rect, ETrue, tileditemID, rectTiled );
|
|
41 |
CleanupStack::PushL( context );
|
|
42 |
STIF_ASSERT_NOT_NULL( context );
|
|
43 |
|
|
44 |
CleanupStack::PopAndDestroy( context );
|
|
45 |
|
|
46 |
return KErrNone;
|
|
47 |
|
|
48 |
}
|
|
49 |
|
|
50 |
// -----------------------------------------------------------------------------
|
|
51 |
// CTestSDKSkins::TestLBBCCSetTiledBitmapL
|
|
52 |
// -----------------------------------------------------------------------------
|
|
53 |
TInt CTestSDKSkins::TestLBBCCSetTiledBitmapL( CStifItemParser& /*aItem*/ )
|
|
54 |
{
|
|
55 |
TAknsItemID itemID;
|
|
56 |
TAknsItemID tileditemID;
|
|
57 |
TPoint pointTL( 0, 0 );
|
|
58 |
TPoint pointBR( KLength, KLength );
|
|
59 |
TPoint pointSBR( KTiledLength, KTiledLength );
|
|
60 |
TRect rect( pointTL, pointBR );
|
|
61 |
TRect rectTiled( pointBR, pointSBR );
|
|
62 |
|
|
63 |
CAknsListBoxBackgroundControlContext* context =
|
|
64 |
CAknsListBoxBackgroundControlContext::NewL( itemID, rect, ETrue, tileditemID, rectTiled );
|
|
65 |
CleanupStack::PushL( context );
|
|
66 |
STIF_ASSERT_NOT_NULL( context );
|
|
67 |
|
|
68 |
context->SetTiledBitmap( tileditemID );
|
|
69 |
|
|
70 |
CleanupStack::PopAndDestroy( context );
|
|
71 |
|
|
72 |
return KErrNone;
|
|
73 |
|
|
74 |
}
|
|
75 |
|
|
76 |
// -----------------------------------------------------------------------------
|
|
77 |
// CTestSDKSkins::TestLBBCCSetTiledRectL
|
|
78 |
// -----------------------------------------------------------------------------
|
|
79 |
TInt CTestSDKSkins::TestLBBCCSetTiledRectL( CStifItemParser& /*aItem*/ )
|
|
80 |
{
|
|
81 |
TAknsItemID itemID;
|
|
82 |
TAknsItemID tileditemID;
|
|
83 |
TPoint pointTL( 0, 0 );
|
|
84 |
TPoint pointBR( KLength, KLength );
|
|
85 |
TPoint pointSBR( KTiledLength, KTiledLength );
|
|
86 |
TRect rect( pointTL, pointBR );
|
|
87 |
TRect rectTiled( pointBR, pointSBR );
|
|
88 |
|
|
89 |
CAknsListBoxBackgroundControlContext* context =
|
|
90 |
CAknsListBoxBackgroundControlContext::NewL( itemID, rect, ETrue, tileditemID, rectTiled );
|
|
91 |
CleanupStack::PushL( context );
|
|
92 |
STIF_ASSERT_NOT_NULL( context );
|
|
93 |
|
|
94 |
context->SetTiledRect( rectTiled );
|
|
95 |
|
|
96 |
CleanupStack::PopAndDestroy( context );
|
|
97 |
|
|
98 |
return KErrNone;
|
|
99 |
|
|
100 |
}
|
|
101 |
|
|
102 |
// -----------------------------------------------------------------------------
|
|
103 |
// CTestSDKSkins::TestLBBCCSetBottomBitmapL
|
|
104 |
// -----------------------------------------------------------------------------
|
|
105 |
TInt CTestSDKSkins::TestLBBCCSetBottomBitmapL( CStifItemParser& /*aItem*/ )
|
|
106 |
{
|
|
107 |
TAknsItemID itemID;
|
|
108 |
TAknsItemID tileditemID;
|
|
109 |
TPoint pointTL( 0, 0 );
|
|
110 |
TPoint pointBR( KLength, KLength );
|
|
111 |
TPoint pointSBR( KTiledLength, KTiledLength );
|
|
112 |
TRect rect( pointTL, pointBR );
|
|
113 |
TRect rectTiled( pointBR, pointSBR );
|
|
114 |
|
|
115 |
CAknsListBoxBackgroundControlContext* context =
|
|
116 |
CAknsListBoxBackgroundControlContext::NewL( itemID, rect, ETrue, tileditemID, rectTiled );
|
|
117 |
CleanupStack::PushL( context );
|
|
118 |
STIF_ASSERT_NOT_NULL( context );
|
|
119 |
|
|
120 |
context->SetBottomBitmap( tileditemID );
|
|
121 |
|
|
122 |
CleanupStack::PopAndDestroy( context );
|
|
123 |
|
|
124 |
return KErrNone;
|
|
125 |
|
|
126 |
}
|
|
127 |
|
|
128 |
// -----------------------------------------------------------------------------
|
|
129 |
// CTestSDKSkins::TestLBBCCSetBottomRectL
|
|
130 |
// -----------------------------------------------------------------------------
|
|
131 |
TInt CTestSDKSkins::TestLBBCCSetBottomRectL( CStifItemParser& /*aItem*/ )
|
|
132 |
{
|
|
133 |
TAknsItemID itemID;
|
|
134 |
TAknsItemID tileditemID;
|
|
135 |
TPoint pointTL( 0, 0 );
|
|
136 |
TPoint pointBR( KLength, KLength );
|
|
137 |
TPoint pointSBR( KTiledLength, KTiledLength );
|
|
138 |
TRect rect( pointTL, pointBR );
|
|
139 |
TRect rectTiled( pointBR, pointSBR );
|
|
140 |
|
|
141 |
CAknsListBoxBackgroundControlContext* context =
|
|
142 |
CAknsListBoxBackgroundControlContext::NewL( itemID, rect, ETrue, tileditemID, rectTiled );
|
|
143 |
CleanupStack::PushL( context );
|
|
144 |
STIF_ASSERT_NOT_NULL( context );
|
|
145 |
|
|
146 |
context->SetBottomRect( rectTiled );
|
|
147 |
|
|
148 |
CleanupStack::PopAndDestroy( context );
|
|
149 |
|
|
150 |
return KErrNone;
|
|
151 |
|
|
152 |
}
|
|
153 |
|