|
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 // Test colour overriding.\n |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent - Internal Symbian test code |
|
21 */ |
|
22 |
|
23 #if (!defined __TCOLOVR_STEP_H__) |
|
24 #define __TCOLOVR_STEP_H__ |
|
25 |
|
26 #include <eikenv.h> |
|
27 #include <techview/eikdialg.h> |
|
28 #include <eikappui.h> |
|
29 #include <eikapp.h> |
|
30 #include <eikdoc.h> |
|
31 #include <eikdebug.h> |
|
32 #include <techview/eikchlst.h> |
|
33 #include <eikrutil.h> |
|
34 #include <eikpanic.h> |
|
35 #include <eiksvdef.h> |
|
36 #include <techview/eiklabel.h> |
|
37 #include <techview/eikcmbut.h> |
|
38 #include <techview/eikmenub.h> |
|
39 #include <techview/eiktbar.h> |
|
40 #include <techview/eikchlst.h> |
|
41 #include <techview/eikchkbx.h> |
|
42 #include <techview/eikopbut.h> |
|
43 #include <techview/eikmfne.h> |
|
44 #include <techview/eikcmbox.h> |
|
45 #include <techview/eikseced.h> |
|
46 #include <techview/eikprogi.h> |
|
47 #include <techview/eikclock.h> |
|
48 #include <techview/eikconso.h> |
|
49 #include <techview/eikcapc.h> |
|
50 #include <eikspane.h> |
|
51 |
|
52 #include <test/testexecutestepbase.h> |
|
53 #include "appfwk_test_AppUi.h" |
|
54 |
|
55 //! A CTColOvrStep test class. |
|
56 /** |
|
57 Test colour overriding. |
|
58 */ |
|
59 class CTColOvrStep : public CTmsTestStep |
|
60 { |
|
61 public: |
|
62 CTColOvrStep(); |
|
63 ~CTColOvrStep(); |
|
64 virtual TVerdict doTestStepPreambleL(); |
|
65 virtual TVerdict doTestStepL(); |
|
66 void ConstructAppL(CEikonEnv* aEikEnv); |
|
67 private: |
|
68 }; |
|
69 |
|
70 //! CStandaloneLabel |
|
71 /** |
|
72 Label control |
|
73 */ |
|
74 class CStandaloneLabel : public CEikLabel |
|
75 { |
|
76 public: |
|
77 CStandaloneLabel(); |
|
78 public: // from CCoeControl |
|
79 void GetColorUseListL (CArrayFix<TCoeColorUse>& aColorUseList) const ; |
|
80 void Draw(const TRect& aRect) const ; |
|
81 }; |
|
82 |
|
83 //! CColorOverrideControl |
|
84 /** |
|
85 Control on which all tests are carried out. |
|
86 */ |
|
87 class CColorOverrideControl : public CCoeControl, public MEikMenuObserver |
|
88 { |
|
89 public: |
|
90 CColorOverrideControl(); |
|
91 void ConstructL(const TRect& aRect); |
|
92 ~CColorOverrideControl(); |
|
93 virtual TInt CountComponentControls() const; |
|
94 virtual CCoeControl* ComponentControl(TInt aIndex) const; |
|
95 void UserOverrideForeAndBackColorsL(TRgb aForeColor, TRgb aBackColor); |
|
96 void SetSystemColorsL(); |
|
97 void Dim(); |
|
98 void ToggleFloatingMenuL(); |
|
99 private: // from CCoeControl |
|
100 void Draw(const TRect& aRect) const; |
|
101 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
102 private: // from MEikMenuObserver |
|
103 void SetEmphasis(CCoeControl* aMenuControl,TBool aEmphasis); |
|
104 void ProcessCommandL(TInt aCommandId); |
|
105 private: |
|
106 void DrawColorBlocks(CCoeControl& aControl, TInt aXPos, TInt aYPos, CWindowGc& aGc ) const; |
|
107 void SetBackgroundColorL(CCoeControl& aControl, TRgb aRgb); |
|
108 void SetForegroundColorL(CCoeControl& aControl, TRgb aRgb); |
|
109 private: |
|
110 CStandaloneLabel* iOverrideLabel; |
|
111 CEikTextListBox* iListBox; |
|
112 CEikTextButton* iButton; |
|
113 CEikScrollBar* iScrollBar; |
|
114 CEikEdwin* iEdwin; |
|
115 CEikChoiceList* iChoiceList; |
|
116 CEikCaptionedControl* iCaptionedCheckBox; |
|
117 CEikOptionButton* iOpBut[3]; |
|
118 TEikButtonCoordinator* iBCoord; |
|
119 CEikNumberEditor* iNumberEditor; |
|
120 CEikComboBox* iComboBox; |
|
121 CEikMenuBar* iMenuBar; |
|
122 CEikSecretEditor* iSecretEditor; |
|
123 CEikProgressInfo* iProgressInfo; |
|
124 CEikClock* iClock; |
|
125 CEikConsoleControl* iConsole; |
|
126 CEikMenuPane* iMenu; |
|
127 |
|
128 CCoeBrushAndPenContext* iBrushAndPenContext; |
|
129 TPtrC iPtr; |
|
130 TRect iMenuBarRect; |
|
131 }; |
|
132 |
|
133 //! CColorOverrideAppUi |
|
134 /** |
|
135 Test Ui class. |
|
136 */ |
|
137 class CColorOverrideAppUi : public CTestAppUi |
|
138 { |
|
139 public: |
|
140 CColorOverrideAppUi(CTmsTestStep* aStep); |
|
141 void ConstructL(); |
|
142 ~CColorOverrideAppUi(); |
|
143 protected: //from CTestAppUi |
|
144 virtual void RunTestStepL(TInt aNumStep); |
|
145 private: // framework |
|
146 void HandleCommandL(TInt aCommand); |
|
147 private: |
|
148 CColorOverrideControl* iColorSchemeControl; |
|
149 CEikButtonGroupContainer *iToolBar; |
|
150 }; |
|
151 |
|
152 |
|
153 _LIT(KTColOvrStep,"TColOvr"); |
|
154 #endif |
|
155 |
|
156 |