|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 |
|
22 #if !defined(__TCONETransparency_H__) |
|
23 #define __TCONETransparency_H__ |
|
24 |
|
25 #include <coecntrl.h> |
|
26 #include <coeccntx.h> |
|
27 #include <gulgcmap.h> |
|
28 #include "TConeTestServer.h" |
|
29 #include "appfwk_test_AppUi.h" |
|
30 |
|
31 |
|
32 /** Base control drawing class, with semi-transparent ellipse draw implementation. |
|
33 @test |
|
34 */ |
|
35 class CTransparentControl : public CCoeControl |
|
36 { |
|
37 friend class CTransparencyParentControl; |
|
38 void Draw(const TRect& aRect) const; |
|
39 }; |
|
40 |
|
41 |
|
42 /** Window owning parent control, which also acts as background, contains a window owning |
|
43 * child controls for manipulation |
|
44 @test |
|
45 */ |
|
46 class CTransparencyParentControl : public CTransparentControl, public MCoeControlBackground |
|
47 { |
|
48 public: |
|
49 |
|
50 CTransparencyParentControl():iBackgroundDrawnCount(0) |
|
51 {}; |
|
52 ~CTransparencyParentControl(); |
|
53 void ConstructL(TBool aEnableTransparencyProperly); |
|
54 TInt BgDrawnCount() {return iBackgroundDrawnCount;} |
|
55 //MCoeControlBackground |
|
56 void Draw(CWindowGc &aGc, const CCoeControl &aControl, const TRect &aRect) const; |
|
57 |
|
58 private: |
|
59 CTransparentControl *iControl; |
|
60 mutable TInt iBackgroundDrawnCount; |
|
61 |
|
62 }; |
|
63 |
|
64 /** Test step class |
|
65 @test |
|
66 */ |
|
67 class CTConeTransparencyStep : public CTmsTestStep |
|
68 { |
|
69 public: |
|
70 CTConeTransparencyStep(); |
|
71 ~CTConeTransparencyStep(); |
|
72 virtual TVerdict doTestStepL(); |
|
73 void ConstructAppL(CCoeEnv* aCoe); |
|
74 |
|
75 private: |
|
76 }; |
|
77 |
|
78 |
|
79 class CTConeTransparencyAppUi : public CTestCoeAppUi |
|
80 { |
|
81 |
|
82 public: |
|
83 CTConeTransparencyAppUi(CTmsTestStep* aStep); |
|
84 ~CTConeTransparencyAppUi(); |
|
85 void ConstructL(); |
|
86 private: // from CCoeAppUi |
|
87 TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
88 |
|
89 private: // utility |
|
90 void RunTestStepL(TInt aStepNum); |
|
91 protected: |
|
92 CTransparencyParentControl* iViewControl1; //The main application control |
|
93 CTransparencyParentControl* iViewControl2; |
|
94 }; |
|
95 |
|
96 _LIT(KTConeTransparencyStep,"TConeTransparency"); |
|
97 |
|
98 #endif |
|
99 |
|
100 |