34
|
1 |
/*
|
|
2 |
* Copyright (c) 2005-2007 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: App UI
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef C_APPUI_H
|
|
20 |
#define C_APPUI_H
|
|
21 |
|
|
22 |
// System includes
|
|
23 |
#include <coeview.h>
|
|
24 |
|
|
25 |
// User includes
|
|
26 |
#include <aifwpublisherinfo.h>
|
|
27 |
#include "xnappuiadapter.h"
|
|
28 |
|
|
29 |
// Forward declarations
|
|
30 |
class CAiUiIdleIntegration;
|
|
31 |
|
|
32 |
namespace AiXmlUiController
|
|
33 |
{
|
|
34 |
class CContentRenderer;
|
|
35 |
class CXmlUiController;
|
|
36 |
class CAIXuikonEventHandler;
|
|
37 |
class COnlineOfflineHelper;
|
|
38 |
|
|
39 |
/**
|
|
40 |
* @ingroup group_xmluicontroller
|
|
41 |
*
|
|
42 |
* AppUI class of XML UI Controller application
|
|
43 |
*
|
|
44 |
* @lib AiXmlUiMain
|
|
45 |
*/
|
|
46 |
NONSHARABLE_CLASS( CAppUi ) : public CXnAppUiAdapter,
|
|
47 |
public MCoeViewActivationObserver
|
|
48 |
{
|
|
49 |
public: // Constructors and destructor
|
|
50 |
|
|
51 |
static CAppUi* NewL( CXmlUiController& aUiCtl );
|
|
52 |
|
|
53 |
~CAppUi();
|
|
54 |
|
|
55 |
public:
|
|
56 |
// new functions
|
|
57 |
CCoeEnv* CoeEnv() { return iCoeEnv; }
|
|
58 |
|
|
59 |
private:
|
|
60 |
// from CXnAppUiAdapter
|
|
61 |
|
|
62 |
void PrepareToExit();
|
|
63 |
|
|
64 |
void HandleCommandL( TInt aCommand );
|
|
65 |
|
|
66 |
void HandleXuikonEventL( CXnNodeAppIf& aOrigin, CXnNodeAppIf& aTrigger,
|
|
67 |
CXnDomNode& aTriggerDefinition, CXnDomNode& aEvent );
|
|
68 |
|
|
69 |
void HandleEventL( const TDesC& aEvent, CXnNodeAppIf& aDestination );
|
|
70 |
|
|
71 |
void HandleWsEventL( const TWsEvent& aEvent,
|
|
72 |
CCoeControl* aDestination );
|
|
73 |
|
|
74 |
void LoadPublisher( const TAiFwPublisherInfo& aPublisher );
|
|
75 |
|
|
76 |
void DestroyPublisher( const TAiFwPublisherInfo& aPublisher );
|
|
77 |
|
|
78 |
TBool DynInitMenuItemL( const TDesC& aItemType,
|
|
79 |
RPointerArray< CXnNodeAppIf >* aList = NULL );
|
|
80 |
|
|
81 |
void HandleEnterEditModeL( TBool aEnter );
|
|
82 |
|
|
83 |
void HandleUiReadyEventL();
|
|
84 |
|
|
85 |
TInt PublisherInfo( CXnNodeAppIf& aNode,
|
|
86 |
THsPublisherInfo& aInfo );
|
|
87 |
|
|
88 |
private:
|
|
89 |
// new functions
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Starts long press recognizer of Send key.
|
|
93 |
*
|
|
94 |
* @since S60 5.2
|
|
95 |
*/
|
|
96 |
void StartKeyTimerL();
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Stops Send key long press recognizer.
|
|
100 |
*
|
|
101 |
* @since S60 5.2
|
|
102 |
*/
|
|
103 |
void StopKeyTimer();
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Launches Voice command application after long Send key is pressed.
|
|
107 |
*
|
|
108 |
* @since S60 5.2
|
|
109 |
*/
|
|
110 |
void LaunchVoiceCommandL();
|
|
111 |
|
|
112 |
/**
|
|
113 |
* Callback function for long press timer of the Send key.
|
|
114 |
*
|
|
115 |
* @since S60 5.2
|
|
116 |
*/
|
|
117 |
static TInt ReportLongPressL( TAny* aThis );
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Sets title pane text
|
|
121 |
*
|
|
122 |
* @since S60 5.2
|
|
123 |
* @param aText Text to set
|
|
124 |
*/
|
|
125 |
void SetTitlePaneTextL( const TDesC& aText );
|
|
126 |
|
|
127 |
private:
|
|
128 |
// from MCoeViewActivationObserver
|
|
129 |
|
|
130 |
/**
|
|
131 |
* @see MCoeViewActivationObserver
|
|
132 |
*/
|
|
133 |
void HandleViewActivation( const TVwsViewId& aNewlyActivatedViewId,
|
|
134 |
const TVwsViewId& aViewIdToBeDeactivated );
|
|
135 |
|
|
136 |
private:
|
|
137 |
// from CCoeAppUi
|
|
138 |
|
|
139 |
/**
|
|
140 |
* Gets a list of help contexts for a particular
|
|
141 |
* application user interface.
|
|
142 |
*/
|
|
143 |
CArrayFix<TCoeHelpContext>* HelpContextL() const;
|
|
144 |
|
|
145 |
public:
|
|
146 |
// new functions
|
|
147 |
|
|
148 |
/**
|
|
149 |
* Activates UI. Called by UI controller during bootup sequence.
|
|
150 |
*
|
|
151 |
* @since S60 5.2
|
|
152 |
*/
|
|
153 |
void ActivateUi();
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Sets plugins online state
|
|
157 |
*
|
|
158 |
* @since S60 5.2
|
|
159 |
* @param aOnline ETrue to enter online, EFalse to offline
|
|
160 |
*
|
|
161 |
*/
|
|
162 |
void SetOnlineStateL( TBool aOnline );
|
|
163 |
|
|
164 |
/**
|
|
165 |
* Gets Ui controller
|
|
166 |
*
|
|
167 |
* @since S60 5.0
|
|
168 |
* @return Ui Controller
|
|
169 |
*/
|
|
170 |
CXmlUiController& UiController() const;
|
|
171 |
|
|
172 |
/**
|
|
173 |
* Gets online/offline helper object
|
|
174 |
*
|
|
175 |
* @since S60 5.2
|
|
176 |
* @return online/offline helper
|
|
177 |
*/
|
|
178 |
COnlineOfflineHelper* Helper() const;
|
|
179 |
|
|
180 |
private:
|
|
181 |
// Constructors
|
|
182 |
|
|
183 |
CAppUi( CXmlUiController& aUiCtl, TUid aAppUid );
|
|
184 |
|
|
185 |
void ConstructL();
|
|
186 |
|
|
187 |
void DoConstructL();
|
|
188 |
|
|
189 |
private:
|
|
190 |
// data
|
|
191 |
|
|
192 |
/** UI Controller implementation, not owned */
|
|
193 |
CXmlUiController& iUiCtl;
|
|
194 |
/** Event handler, owned */
|
|
195 |
CAIXuikonEventHandler* iEventHandler;
|
|
196 |
/** Content renderer, owned */
|
|
197 |
CContentRenderer* iContentRenderer;
|
|
198 |
/** Idle Integration helper object, owed */
|
|
199 |
CAiUiIdleIntegration* iIdleIntegration;
|
|
200 |
/** Online/Offline helper object, owned */
|
|
201 |
COnlineOfflineHelper* iHelper;
|
|
202 |
/** Timer for Send key long press recognition, owned */
|
|
203 |
CPeriodic* iKeyTimer;
|
|
204 |
/** Edit mode title pane text, owned */
|
|
205 |
HBufC* iEditModeTitle;
|
|
206 |
/** DeviceStatus publisher info */
|
|
207 |
THsPublisherInfo iDeviceStatusInfo;
|
|
208 |
/** Flag to indicate whether edit mode is active */
|
|
209 |
TBool iInEditMode;
|
|
210 |
};
|
|
211 |
|
|
212 |
} // namespace AiXmlUiController
|
|
213 |
|
|
214 |
#endif // C_APPUI_H
|
|
215 |
|
|
216 |
// End of File.
|