williamr@2
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __COEAUI_H__
|
williamr@2
|
17 |
#define __COEAUI_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <e32std.h>
|
williamr@2
|
20 |
#include <e32base.h>
|
williamr@2
|
21 |
#include <w32std.h>
|
williamr@2
|
22 |
#include <vwsdef.h>
|
williamr@2
|
23 |
#include <coedef.h>
|
williamr@2
|
24 |
#include <coehelp.h>
|
williamr@2
|
25 |
#include <coeview.h>
|
williamr@2
|
26 |
#include <coeinput.h>
|
williamr@2
|
27 |
|
williamr@2
|
28 |
class CCoeEnv;
|
williamr@2
|
29 |
class CCoeControl;
|
williamr@2
|
30 |
|
williamr@2
|
31 |
/**
|
williamr@2
|
32 |
Creates a FEP interface object.
|
williamr@2
|
33 |
|
williamr@2
|
34 |
@publishedAll
|
williamr@2
|
35 |
@released
|
williamr@2
|
36 |
*/
|
williamr@2
|
37 |
typedef CCoeFep* (*TCoeFepFactoryFunctionL)(CCoeEnv& aConeEnvironment, const TDesC& aFullFileNameOfDll, const CCoeFepParameters& aFepParameters);
|
williamr@2
|
38 |
|
williamr@2
|
39 |
/**
|
williamr@2
|
40 |
Calls the second ordinal function of the FEP for which the settings dialog is to be executed.
|
williamr@2
|
41 |
|
williamr@2
|
42 |
@publishedAll
|
williamr@2
|
43 |
@released
|
williamr@2
|
44 |
*/
|
williamr@2
|
45 |
typedef void (*TCoeSynchronouslyExecuteFepSettingsDialogFunctionL)(CCoeEnv& aConeEnvironment, const TDesC& aFullFileNameOfDll);
|
williamr@2
|
46 |
|
williamr@2
|
47 |
/** Stack priority flags.
|
williamr@2
|
48 |
|
williamr@2
|
49 |
Controls with higher priorities get offered key events before controls
|
williamr@2
|
50 |
with lower priorities.
|
williamr@2
|
51 |
|
williamr@2
|
52 |
@publishedAll
|
williamr@2
|
53 |
@released */
|
williamr@2
|
54 |
enum
|
williamr@2
|
55 |
{
|
williamr@2
|
56 |
/** 0 */
|
williamr@2
|
57 |
ECoeStackPriorityDefault=0,
|
williamr@2
|
58 |
/** 10 */
|
williamr@2
|
59 |
ECoeStackPriorityMenu=10,
|
williamr@2
|
60 |
/** 50 */
|
williamr@2
|
61 |
ECoeStackPriorityDialog=50,
|
williamr@2
|
62 |
/** 60 */
|
williamr@2
|
63 |
ECoeStackPriorityCba=60,
|
williamr@2
|
64 |
/** 200 */
|
williamr@2
|
65 |
ECoeStackPriorityAlert=200,
|
williamr@2
|
66 |
/** 240 */
|
williamr@2
|
67 |
ECoeStackPrioritySoftkey=240,
|
williamr@2
|
68 |
/** 250 */
|
williamr@2
|
69 |
ECoeStackPriorityFep=250,
|
williamr@2
|
70 |
/** 300 */
|
williamr@2
|
71 |
ECoeStackPriorityEnvironmentFilter=300
|
williamr@2
|
72 |
};
|
williamr@2
|
73 |
|
williamr@2
|
74 |
|
williamr@2
|
75 |
/** Control stack flags.
|
williamr@2
|
76 |
|
williamr@2
|
77 |
Each control on the stack has a set of these flags which can be used
|
williamr@2
|
78 |
to refuse to accept key events and to refuse requests for focus.
|
williamr@2
|
79 |
|
williamr@2
|
80 |
@publishedAll
|
williamr@2
|
81 |
@released */
|
williamr@2
|
82 |
enum
|
williamr@2
|
83 |
{
|
williamr@2
|
84 |
/** The default value */
|
williamr@2
|
85 |
ECoeStackFlagStandard = 0,
|
williamr@2
|
86 |
/** The control does not accept key events. */
|
williamr@2
|
87 |
ECoeStackFlagRefusesAllKeys = 0x01,
|
williamr@2
|
88 |
/** The control does not accept keyboard focus. */
|
williamr@2
|
89 |
ECoeStackFlagRefusesFocus = 0x02,
|
williamr@2
|
90 |
/** The control is owned and deleted by the stack. */
|
williamr@2
|
91 |
ECoeStackFlagOwnershipTransfered= 0x04,
|
williamr@2
|
92 |
/** The control is also added to the stack of any embedded app UI. For
|
williamr@2
|
93 |
example, an alert dialog added through CEikonEnv will be
|
williamr@2
|
94 |
shared on the stack of all embedded app UIs that may appear in the
|
williamr@2
|
95 |
application. */
|
williamr@2
|
96 |
ECoeStackFlagSharable = 0x08
|
williamr@2
|
97 |
};
|
williamr@2
|
98 |
|
williamr@2
|
99 |
class CCoeControlStack;
|
williamr@2
|
100 |
class CCoeViewManager;
|
williamr@2
|
101 |
|
williamr@2
|
102 |
/** Application user interface (app UI) base class.
|
williamr@2
|
103 |
|
williamr@2
|
104 |
The app UI's responsibilities include owning the application's control stack and views,
|
williamr@2
|
105 |
handling user commands, (see the derived class CEikAppUi), and handling events sent by
|
williamr@2
|
106 |
the OS to the application, for instance being brought to the foreground.
|
williamr@2
|
107 |
|
williamr@2
|
108 |
The UI framework class CEikAppUi is derived from this class. UIs may derive
|
williamr@2
|
109 |
further to add their own UI-specific features to the app UI; each application must
|
williamr@2
|
110 |
derive its own concrete app UI class from this.
|
williamr@2
|
111 |
|
williamr@2
|
112 |
@publishedAll
|
williamr@2
|
113 |
@released */
|
williamr@2
|
114 |
class CCoeAppUi : public CBase
|
williamr@2
|
115 |
{
|
williamr@2
|
116 |
public:
|
williamr@2
|
117 |
// Construction and destruction
|
williamr@2
|
118 |
IMPORT_C CCoeAppUi();
|
williamr@2
|
119 |
IMPORT_C ~CCoeAppUi();
|
williamr@2
|
120 |
IMPORT_C void ConstructL(CCoeAppUi* aPrevious=NULL);
|
williamr@2
|
121 |
// Control stack
|
williamr@2
|
122 |
IMPORT_C void AddToStackL(const MCoeView& aView,CCoeControl* aControl,TInt aPriority=ECoeStackPriorityDefault,TInt aStackingFlags=ECoeStackFlagStandard);
|
williamr@2
|
123 |
IMPORT_C void AddToStackL(CCoeControl* aControl,TInt aPriority=ECoeStackPriorityDefault,TInt aStackingFlags=ECoeStackFlagStandard);
|
williamr@2
|
124 |
IMPORT_C void RemoveFromStack(CCoeControl* aControl);
|
williamr@2
|
125 |
IMPORT_C void HandleStackChanged();
|
williamr@2
|
126 |
IMPORT_C void HandleStackedControlsResourceChange(TInt aType);
|
williamr@2
|
127 |
IMPORT_C void UpdateStackedControlFlags(CCoeControl* aControl,TInt aFlags,TInt aMask);
|
williamr@2
|
128 |
// Help context
|
williamr@2
|
129 |
IMPORT_C CArrayFix<TCoeHelpContext>* AppHelpContextL() const;
|
williamr@2
|
130 |
// Text input
|
williamr@2
|
131 |
IMPORT_C virtual TCoeInputCapabilities InputCapabilities() const;
|
williamr@2
|
132 |
// Control focus
|
williamr@2
|
133 |
IMPORT_C CCoeControl* TopFocusedControl() const;
|
williamr@2
|
134 |
// Utility
|
williamr@2
|
135 |
IMPORT_C TBool IsDisplayingMenuOrDialog() const;
|
williamr@2
|
136 |
IMPORT_C TBool IsDisplayingDialog() const;
|
williamr@2
|
137 |
IMPORT_C TBool IsDisplayingControlBetweenPriorities(TInt aLowerPriority, TInt aHigherPriority) const;
|
williamr@2
|
138 |
// View registration
|
williamr@2
|
139 |
IMPORT_C void RegisterViewL(MCoeView& aView);
|
williamr@2
|
140 |
IMPORT_C void DeregisterView(const MCoeView& aView);
|
williamr@2
|
141 |
IMPORT_C void SetDefaultViewL(const MCoeView& aView);
|
williamr@2
|
142 |
IMPORT_C TInt GetDefaultViewId(TVwsViewId& aViewId) const;
|
williamr@2
|
143 |
// Pseudo-view registration
|
williamr@2
|
144 |
IMPORT_C void CheckInitializeViewsL(TUid aAppUid);
|
williamr@2
|
145 |
IMPORT_C void RegisterApplicationViewL(TUid aAppUid);
|
williamr@2
|
146 |
IMPORT_C void DeregisterApplicationView();
|
williamr@2
|
147 |
// View construction
|
williamr@2
|
148 |
IMPORT_C TBool IsViewConstructed(const TVwsViewId& aViewId) const;
|
williamr@2
|
149 |
// View activation
|
williamr@2
|
150 |
IMPORT_C void ActivateViewL(const TVwsViewId& aViewId);
|
williamr@2
|
151 |
IMPORT_C void ActivateViewL(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
|
williamr@2
|
152 |
IMPORT_C void ActivateTopViewL();
|
williamr@2
|
153 |
IMPORT_C void CreateActivateViewEventL(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
|
williamr@2
|
154 |
IMPORT_C void DeactivateActiveViewIfOwnerMatchL();
|
williamr@2
|
155 |
IMPORT_C void DeactivateActiveViewL();
|
williamr@2
|
156 |
IMPORT_C TInt GetActiveViewId(TVwsViewId& aViewId) const;
|
williamr@2
|
157 |
// View registration
|
williamr@2
|
158 |
IMPORT_C void AddViewObserverL(MCoeViewObserver* aViewObserver);
|
williamr@2
|
159 |
IMPORT_C void RemoveViewObserver(MCoeViewObserver* aViewObserver);
|
williamr@2
|
160 |
// View activation observer
|
williamr@2
|
161 |
IMPORT_C void AddViewActivationObserverL(MCoeViewActivationObserver* aViewActivationObserver);
|
williamr@2
|
162 |
IMPORT_C void RemoveViewActivationObserver(MCoeViewActivationObserver* aViewActivationObserver);
|
williamr@2
|
163 |
IMPORT_C void NotifyNextActivation(const TVwsViewId& aViewId, MCoeViewActivationObserver& aViewActivationObserver);
|
williamr@2
|
164 |
IMPORT_C void NotifyNextActivation(MCoeViewActivationObserver& aViewActivationObserver);
|
williamr@2
|
165 |
IMPORT_C TBool CheckSourceOfViewSwitchL(const TSecurityPolicy& aSecurityPolicy,const char* aDiagnostic=NULL) const;
|
williamr@2
|
166 |
// View decativation observer
|
williamr@2
|
167 |
IMPORT_C void AddViewDeactivationObserverL(MCoeViewDeactivationObserver* aViewDeactivationObserver);
|
williamr@2
|
168 |
IMPORT_C void RemoveViewDeactivationObserver(MCoeViewDeactivationObserver* aViewDeactivationObserver);
|
williamr@2
|
169 |
IMPORT_C void NotifyNextDeactivation(const TVwsViewId& aViewId, MCoeViewDeactivationObserver& aViewDeactivationObserver);
|
williamr@2
|
170 |
IMPORT_C void NotifyNextDeactivation(MCoeViewDeactivationObserver& aViewDeactivationObserver);
|
williamr@2
|
171 |
// View session configuration
|
williamr@2
|
172 |
IMPORT_C TInt EnableExternalViewSwitches(TBool aEnable);
|
williamr@2
|
173 |
IMPORT_C void UpdateViewServerBackgroundColor(const TRgb& aBgColor);
|
williamr@2
|
174 |
|
williamr@2
|
175 |
// New APIs
|
williamr@2
|
176 |
IMPORT_C void SetCustomControl(TInt aCustomControl);
|
williamr@2
|
177 |
IMPORT_C TInt GetTopViewId(TVwsViewId& aViewId) const;
|
williamr@2
|
178 |
IMPORT_C void SetWindowGroupOrdinal(TInt aWindowGroupOrdinal);
|
williamr@2
|
179 |
|
williamr@2
|
180 |
public: // Internal
|
williamr@2
|
181 |
IMPORT_C void SetApplicationViewAsDefaultL(); // internalTechnology
|
williamr@2
|
182 |
IMPORT_C void SetSystemDefaultViewL(const TVwsViewId& aViewId,TInt aMode); // internalTechnology
|
williamr@2
|
183 |
IMPORT_C void SetSystemDefaultViewL(const TVwsViewId& aViewId); // internalTechnology
|
williamr@2
|
184 |
IMPORT_C void GetSystemDefaultViewL(TVwsViewId& aViewId); // internalTechnology
|
williamr@2
|
185 |
IMPORT_C virtual void HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination);
|
williamr@2
|
186 |
IMPORT_C virtual void PrepareToExit();
|
williamr@2
|
187 |
protected: // Internal
|
williamr@2
|
188 |
IMPORT_C virtual void HandleScreenDeviceChangedL();
|
williamr@2
|
189 |
private: // Internal
|
williamr@2
|
190 |
IMPORT_C virtual TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
|
williamr@2
|
191 |
IMPORT_C virtual void HandleForegroundEventL(TBool aForeground);
|
williamr@2
|
192 |
IMPORT_C virtual void HandleSwitchOnEventL(CCoeControl* aDestination);
|
williamr@2
|
193 |
IMPORT_C virtual void HandleSystemEventL(const TWsEvent& aEvent);
|
williamr@2
|
194 |
IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent);
|
williamr@2
|
195 |
IMPORT_C virtual void SetAndDrawFocus(TBool aFocus);
|
williamr@2
|
196 |
IMPORT_C virtual CArrayFix<TCoeHelpContext>* HelpContextL() const;
|
williamr@2
|
197 |
public: // Internal
|
williamr@2
|
198 |
IMPORT_C virtual TBool FrameworkCallsRendezvous() const;
|
williamr@2
|
199 |
public: // Internal
|
williamr@2
|
200 |
IMPORT_C void WriteInternalStateOfStackedControlsL(RWriteStream& aWriteStream) const; // internalTechnology
|
williamr@2
|
201 |
public: // Deprecated. Do not use!
|
williamr@2
|
202 |
IMPORT_C void RegisterViewAndAddStackL(MCoeView& aView); // deprecated
|
williamr@2
|
203 |
IMPORT_C void DeregisterViewAndRemoveStack(const MCoeView& aView); // deprecated
|
williamr@2
|
204 |
IMPORT_C void RemoveFromViewStack(const MCoeView& aView,CCoeControl* aControl); // deprecated
|
williamr@2
|
205 |
IMPORT_C void UpdateViewStackedControlFlags(const MCoeView& aView,CCoeControl* aControl,TInt aFlags,TInt aMask); // deprecated
|
williamr@2
|
206 |
IMPORT_C void AddToViewStackL(const MCoeView& aView,CCoeControl* aControl,TInt aPriority=ECoeStackPriorityDefault,TInt aStackingFlags=ECoeStackFlagStandard); // deprecated
|
williamr@2
|
207 |
public: // not exported
|
williamr@2
|
208 |
TBool IsControlOnStack(CCoeControl* aControl) const;
|
williamr@2
|
209 |
void SetCurrentControlStackGroupId(TInt aGroupId);
|
williamr@2
|
210 |
void NotifyFontChange(const CCoeFontProvider& aFontProvider);
|
williamr@2
|
211 |
void RefetchPixelMappingL();
|
williamr@2
|
212 |
private:
|
williamr@2
|
213 |
enum TRemoveCondition
|
williamr@2
|
214 |
{
|
williamr@2
|
215 |
ERemoveUnconditionally,
|
williamr@2
|
216 |
ERemoveOnlyIfSharable
|
williamr@2
|
217 |
};
|
williamr@2
|
218 |
private:// Internal
|
williamr@2
|
219 |
IMPORT_C virtual void CCoeAppUi_Reserved_2();
|
williamr@2
|
220 |
private:
|
williamr@2
|
221 |
CCoeControl* TopFocusableControl() const;
|
williamr@2
|
222 |
TInt FindPos(CCoeControlStack* aStack,CCoeControl* aControl) const;
|
williamr@2
|
223 |
void SetFocusToControl(CCoeControl* aControl,TBool aFocus);
|
williamr@2
|
224 |
void DoAddToStackL(CCoeControlStack* aStack,CCoeControl* aControl,TInt aPriority,TInt aStackingFlags);
|
williamr@2
|
225 |
void DoAddToStackL(CCoeControlStack* aStack,CCoeControl* aControl,TInt aPriority,TInt aStackingFlags, TInt aGroupId);
|
williamr@2
|
226 |
void DoRemoveFromStack(CCoeControlStack* aStack,CCoeControl* aControl,TRemoveCondition aRemoveCondition=ERemoveUnconditionally);
|
williamr@2
|
227 |
void DoUpdateStackedControlFlags(CCoeControlStack* aStack,CCoeControl* aControl,TInt aFlags,TInt aMask);
|
williamr@2
|
228 |
public:
|
williamr@2
|
229 |
/**Monitor function for passing all windows events to registered monitor observers for optional inspection*/
|
williamr@2
|
230 |
void MonitorWsEvent(const TWsEvent& aEvent);
|
williamr@2
|
231 |
private:
|
williamr@2
|
232 |
class CExtra;
|
williamr@2
|
233 |
friend class CExtra;
|
williamr@2
|
234 |
friend class CTestDriver;
|
williamr@2
|
235 |
protected:
|
williamr@2
|
236 |
CCoeEnv* iCoeEnv;
|
williamr@2
|
237 |
private:
|
williamr@2
|
238 |
CCoeViewManager* iViewManager;
|
williamr@2
|
239 |
CCoeControlStack* iStack;
|
williamr@2
|
240 |
CExtra* iExtra;
|
williamr@2
|
241 |
TInt iCCoeAppUi_Reserved1;
|
williamr@2
|
242 |
};
|
williamr@2
|
243 |
|
williamr@2
|
244 |
|
williamr@2
|
245 |
#endif // __COEAUI_H__
|