|
1 // Copyright (c) 2005-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 #if (!defined __TBORDER_STEP_H__) |
|
22 #define __TBORDER_STEP_H__ |
|
23 #include <test/testexecutestepbase.h> |
|
24 #include "TEgulTestServer.h" |
|
25 #include <coecntrl.h> |
|
26 #include <gulbordr.h> |
|
27 #include "appfwk_test_AppUi.h" |
|
28 |
|
29 const TInt KMaxBufLength = 40; |
|
30 |
|
31 class CTBorderStep : public CTmsTestStep |
|
32 { |
|
33 public: |
|
34 CTBorderStep(); |
|
35 ~CTBorderStep(); |
|
36 // virtual TVerdict doTestStepPreambleL(); |
|
37 // virtual TVerdict doTestStepPostambleL(); |
|
38 virtual TVerdict doTestStepL(); |
|
39 void ConstructAppL(CCoeEnv* aCoeEnv); |
|
40 |
|
41 private: |
|
42 }; |
|
43 |
|
44 |
|
45 class CSimpleControl : public CCoeControl |
|
46 { |
|
47 public: |
|
48 void ConstructL(); |
|
49 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
50 private: // framework |
|
51 void Draw(const TRect& aRect) const; |
|
52 void DrawBorder(CWindowGc& aGC, TRgb aColor, TGulBorder::TBorderType aBorderType, TInt aYPos, TInt aYTextPos, const TDesC &aBorderName) const; |
|
53 private: // new function |
|
54 void DrawText() const; |
|
55 private: |
|
56 TBuf<KMaxBufLength> iBuf1; |
|
57 TBuf<KMaxBufLength> iBuf2; |
|
58 TRect iRect; |
|
59 CGraphicsContext::TTextAlign iAlign; |
|
60 }; |
|
61 |
|
62 class CTestBorderUi : public CTestCoeAppUi |
|
63 { |
|
64 public: |
|
65 void ConstructL(); |
|
66 CTestBorderUi(CTmsTestStep* aStep); |
|
67 virtual ~CTestBorderUi(); |
|
68 protected: |
|
69 CSimpleControl* iControl; |
|
70 protected: |
|
71 virtual void RunTestStepL(TInt aStep); |
|
72 }; |
|
73 |
|
74 _LIT(KTBorderStep,"TBorder"); |
|
75 #endif |
|
76 |
|
77 |