|
1 /* |
|
2 * Copyright (c) 2004 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 "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __UT_IDLEINT_H__ |
|
20 #define __UT_IDLEINT_H__ |
|
21 |
|
22 // System includes |
|
23 #include <e32def.h> |
|
24 #include <digia/eunit/ceunittestsuiteclass.h> |
|
25 |
|
26 // User includes |
|
27 #include <hscontentpublisher.h> |
|
28 #include "AknSoundSystem.h" |
|
29 #include "aifweventhandler.h" |
|
30 #include "aifwdefs.h" |
|
31 |
|
32 // Forward declarations |
|
33 class CAiUiIdleIntegrationImpl; |
|
34 class CAiWsPluginManager; |
|
35 class CAiIdleAppRegister; |
|
36 class CActiveIdleState; |
|
37 class CPSPropertyObserver; |
|
38 class MAiPSPropertyObserver; |
|
39 |
|
40 // Class declaration |
|
41 NONSHARABLE_CLASS( UT_IdleInt ) : public CEUnitTestSuiteClass, |
|
42 public MAiFwEventHandler |
|
43 { |
|
44 public: |
|
45 // Constructors and destructors |
|
46 |
|
47 /** |
|
48 * Two phase construction |
|
49 */ |
|
50 static UT_IdleInt* NewL(); |
|
51 |
|
52 static UT_IdleInt* NewLC(); |
|
53 |
|
54 /** |
|
55 * Destructor |
|
56 */ |
|
57 ~UT_IdleInt(); |
|
58 |
|
59 private: |
|
60 // Constructors and destructors |
|
61 |
|
62 UT_IdleInt(); |
|
63 |
|
64 void ConstructL(); |
|
65 |
|
66 private: |
|
67 // From MAiFwEventHandler |
|
68 |
|
69 void AppEnvReadyL(); |
|
70 |
|
71 void HandleUiReadyEventL( CAiUiController& aUiController ); |
|
72 |
|
73 void HandlePluginEvent( const TDesC& aParam ); |
|
74 |
|
75 TBool HasMenuItem( const TDesC& aPluginName, const TDesC& aMenuItem ); |
|
76 |
|
77 void HandleUiLayoutChangeL( CAiUiController& aUiController ); |
|
78 |
|
79 void HandleUiThemeChangeStartL( CAiUiController& aUiController ); |
|
80 |
|
81 void HandleUiShutdown( CAiUiController& aUiController ); |
|
82 |
|
83 void HandleAllPluginsLoaded(); |
|
84 |
|
85 void HandleEnterEditMode(); |
|
86 |
|
87 void HandleExitEditMode(); |
|
88 |
|
89 void HandleUIChangeEventL(); |
|
90 |
|
91 void HandleActivateUI(); |
|
92 |
|
93 void HandleLoadPluginL( const THsPublisherInfo& aPublisherInfo ); |
|
94 |
|
95 void HandleDestroyPluginL( const THsPublisherInfo& aPublisherInfo ); |
|
96 |
|
97 void HandlePluginEventL( const THsPublisherInfo& aPublisherInfo, const TDesC& aParam ); |
|
98 |
|
99 TBool HasMenuItemL( const THsPublisherInfo& aPublisherInfo, const TDesC& aMenuItem ); |
|
100 |
|
101 /** |
|
102 * Checks the internet using plugins status |
|
103 */ |
|
104 TBool IsPluginsOnline(); |
|
105 |
|
106 /** |
|
107 * Sets the internet using plugins status |
|
108 */ |
|
109 void SetPluginsOnlineStatus(TBool aStatus); |
|
110 |
|
111 /** |
|
112 * Used for quering if network is in roaming mode |
|
113 */ |
|
114 TBool IsRoaming(); |
|
115 |
|
116 /** |
|
117 * Displays roaming-notification |
|
118 */ |
|
119 void ShowRoamingNotificationL(); |
|
120 |
|
121 TBool RefreshContent( const TDesC& aContentCid ); |
|
122 |
|
123 TBool RefreshContent( const THsPublisherInfo& aPublisherInfo, const TDesC& aContentCid ); |
|
124 |
|
125 TBool SuspendContent( const THsPublisherInfo& aPublisherInfo, const TDesC& aContentCid ); |
|
126 |
|
127 // void DestroyingPlugin( /*CAiContentPublisher*/CHsContentPublisher& aPlugin ); |
|
128 |
|
129 void CriticalStartupPhaseOver( TInt aStageInteger ); |
|
130 |
|
131 TBool QueryIsMenuOpen(); |
|
132 |
|
133 // void ProcessStateChange( TAifwStates aState ); |
|
134 |
|
135 void StoreUserOnlineSelection (TBool /*aStatus*/){}; |
|
136 |
|
137 /* |
|
138 void HandlePluginsOnlineStatus( |
|
139 const RAiPublisherInfoArray& aPlugins,TBool aStatus ); |
|
140 */ |
|
141 |
|
142 void SetPluginsVisibility( TBool aStatus ); |
|
143 |
|
144 void ProcessOnlineState( TBool aOnline ); |
|
145 |
|
146 public: // New methods |
|
147 |
|
148 static CPSPropertyObserver* PSPropertyObserver( TUid aCategory, |
|
149 TInt aKey); |
|
150 |
|
151 static void KeySetTo( TInt aValue ); |
|
152 |
|
153 private: // New methods |
|
154 |
|
155 void SetupL(); |
|
156 |
|
157 void Teardown(); |
|
158 |
|
159 void TestIdleIntEventControlNullAndOthersL(); |
|
160 |
|
161 void TestStateChangesL(); |
|
162 |
|
163 void TestStartUpL(); |
|
164 |
|
165 private: // Data |
|
166 |
|
167 EUNIT_DECLARE_TEST_TABLE; |
|
168 |
|
169 CAiUiIdleIntegrationImpl* iIdleInt; |
|
170 |
|
171 CAiWsPluginManager* iAiWsPluginManagerImpl; |
|
172 |
|
173 CAiIdleAppRegister* iAiIdleAppRegister; |
|
174 |
|
175 CActiveIdleState * iState; |
|
176 |
|
177 CAknKeySoundSystem iSoundSystemStub; |
|
178 |
|
179 public: |
|
180 /** |
|
181 * Observer for phone state Publish&Subscribe key. |
|
182 */ |
|
183 CPSPropertyObserver* iPhoneStatusObserver; |
|
184 |
|
185 /** |
|
186 * Observer for system state Publish&Subscribe key. |
|
187 */ |
|
188 CPSPropertyObserver* iSystemStatusObserver; |
|
189 |
|
190 /** |
|
191 * Observer for UI startup state Publish&Subscribe key. |
|
192 */ |
|
193 CPSPropertyObserver* iUiStartupStatusObserver; |
|
194 |
|
195 TInt iIdleStatus; |
|
196 |
|
197 TBool iPhoneStatusOwned; |
|
198 |
|
199 TBool iSystemStatusOwned; |
|
200 |
|
201 TBool iUiStartupStatusOwned; |
|
202 |
|
203 }; |
|
204 |
|
205 #endif // __UT_IDLEINT_H__ |
|
206 |
|
207 // End of file |