|
1 /* |
|
2 * Copyright (c) 2003-2009 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 * This file contains the SAT Shell Controller class that is responsible |
|
16 * for the actual implementation of the following functionality: |
|
17 * - add SAT UI application to Desk (or similar) |
|
18 * - remove SAT UI application from Desk (or similar) |
|
19 * - bring SAT UI application to foreground if it already is up |
|
20 * and running |
|
21 * - launching the SAT UI application |
|
22 * - launching the Browser |
|
23 * - resolving default access point |
|
24 * - bring Browser to the foreground |
|
25 * |
|
26 * |
|
27 */ |
|
28 |
|
29 |
|
30 #ifndef CSATSHELLCONTROLLER_H |
|
31 #define CSATSHELLCONTROLLER_H |
|
32 |
|
33 // INCLUDES |
|
34 #include <e32base.h> |
|
35 #include <MSatShellController.h> |
|
36 |
|
37 // CONSTS |
|
38 const TInt KSatAppNameSize = 255; //Context pane max |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 // DESCRIPTION |
|
43 // This class is used to control adding, removing and launching of |
|
44 // the SAT UI Client application. It connects to appropriate module |
|
45 // and is used by the SAT Server. |
|
46 |
|
47 class CSatShellController : public CBase, |
|
48 public MSatShellController |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 */ |
|
55 static CSatShellController* NewL(); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CSatShellController(); |
|
61 |
|
62 public: // New functions |
|
63 |
|
64 /** |
|
65 * Adds SAT UI Client to the Application Shell (or similar). |
|
66 * @param aName Name of the entry |
|
67 * @param aUid UID of the SAT UI Application |
|
68 * @return Nothing |
|
69 */ |
|
70 void AddSatUiL( TDesC& aName ); |
|
71 |
|
72 /** |
|
73 * Adds SAT UI Client to the Application Shell (or similar). |
|
74 * @param aName Name of the entry |
|
75 * @param aIconId Id for icons |
|
76 * @return Nothing |
|
77 */ |
|
78 void AddSatUiL( TDesC& aName, TUint8 aIconId ); |
|
79 |
|
80 /** |
|
81 * Removes SAT UI Client from the Application Shell (or similar). |
|
82 * @param aUid UID of the SAT UI Application |
|
83 * @return Nothing |
|
84 */ |
|
85 void RemoveSatUiL(); |
|
86 |
|
87 /** |
|
88 * Launches the SAT UI Client. |
|
89 * @param aUid UID of the SAT UI Application |
|
90 * @return Nothing |
|
91 */ |
|
92 void LaunchSatUiL(); |
|
93 |
|
94 /** |
|
95 * Brings Browser to foreground after period of time. |
|
96 * @param Nothing |
|
97 * @return Nothing |
|
98 */ |
|
99 void BringBrowserToForegroundAfterPeriod(); |
|
100 |
|
101 /** |
|
102 * Bring the SAT UI Application to foreground. |
|
103 * @param Nothing |
|
104 * @return Nothing |
|
105 */ |
|
106 void BringSatUiToForeground(); |
|
107 |
|
108 /** |
|
109 * Sets SAT UI Application to background if needed. |
|
110 */ |
|
111 void SetSatUiToBackground() const; |
|
112 |
|
113 /** |
|
114 * Launch XHTML-browser |
|
115 * @param aUrl URL to be opened when launching browser |
|
116 * @param aAccessPointUid ID number of access point in CommDb |
|
117 * @return The result of the operation |
|
118 */ |
|
119 TInt LaunchBrowserL( const TDesC& aUrl, TUid aAccessPointUid ); |
|
120 |
|
121 /** |
|
122 * This callback function is used to call Browser to the foreground |
|
123 * after short while. |
|
124 * @param aObject Pointer to caller is passed to callback function. |
|
125 * @return Callback function should return TInt. |
|
126 */ |
|
127 static TInt TimerCompleted( TAny* aObject ); |
|
128 |
|
129 private: |
|
130 |
|
131 /** |
|
132 * C++ default constructor. |
|
133 */ |
|
134 CSatShellController(); |
|
135 |
|
136 /** |
|
137 * By default EPOC constructor is private. |
|
138 */ |
|
139 void ConstructL(); |
|
140 |
|
141 /** |
|
142 * Bring the SAT UI Application to foreground. |
|
143 * @param aAppUid The UID value of application. |
|
144 * @return Nothing |
|
145 */ |
|
146 void BringApplicationToForeground( const TUid& aAppUid ) const; |
|
147 |
|
148 /** |
|
149 * Brings Browser to foreground. |
|
150 * @param Nothing |
|
151 * @return Nothing |
|
152 */ |
|
153 void BringBrowserToForeground() const; |
|
154 |
|
155 /** |
|
156 * Checks if Browser is not foreground and starts that if needed. |
|
157 * @param Nothing |
|
158 * @return Nothing |
|
159 */ |
|
160 void CycleSatUiBackwards(); |
|
161 |
|
162 /** |
|
163 * Check if SatUi is needed to set to background. |
|
164 * @param Nothing |
|
165 * @return Nothing |
|
166 */ |
|
167 void CheckSatUiStatus(); |
|
168 |
|
169 private: // Data |
|
170 |
|
171 TBufC<KSatAppNameSize> iSimAppName; |
|
172 TUid iUidWmlBrowser; |
|
173 RWsSession iWsSession; |
|
174 RApaLsSession iApaLsSession; |
|
175 // Timer for checking Browser start. |
|
176 CPeriodic* iTimer; |
|
177 TBool iSetSatUiToBackground; |
|
178 |
|
179 }; |
|
180 |
|
181 #endif // CSATSHELLCONTROLLER_H |
|
182 |
|
183 // End of File |