|
||
class CCoeAppUi : public CBase;
Application user interface (app UI) base class.
The app UI's responsibilities include owning the application's control stack and views, handling user commands, (see the derived class CEikAppUi), and handling events sent by the OS to the application, for instance being brought to the foreground.
The UI framework class CEikAppUi is derived from this class. UIs may derive further to add their own UI-specific features to the app UI; each application must derive its own concrete app UI class from this.
CBase
-
Base class for all classes to be instantiated on the heap.
CCoeAppUi
- Application user interface (app UI) base class.
Defined in CCoeAppUi
:
ActivateViewL(const TVwsViewId &)
Activates an application view.ActivateViewL(const TVwsViewId &,TUid,const TDesC8 &)
Activates an application view and passes a message to it.AddToStackL(CCoeControl *,TInt,TInt)
Inserts a control into the app UI's control stack.AddToStackL(const MCoeView &,CCoeControl *,TInt,TInt)
Inserts a control into the app UI's control stack.AddToViewStackL(const MCoeView &,CCoeControl *,TInt,TInt)
AddViewDeactivationObserverL(MCoeViewDeactivationObserver *)
Adds an observer to the list of observers to be notified of view deactivations.AppHelpContextL()const
Returns a list of help contexts appropriate to the current state of the applicat...CCoeAppUi()
C++ constructor.CheckSourceOfViewSwitchL(const TSecurityPolicy &,const char *)const
Checks whether the view-server client that initiated the current view-switch mat...ConstructL(CCoeAppUi *)
Completes construction of the CCoeAppUi object.DeactivateActiveViewIfOwnerMatchL()
Deactivates the active view if the current view is owned by this application.DeactivateActiveViewL()
Deactivates the active view.DeregisterApplicationView()
Deregisters the application view from the view architecture.DeregisterView(const MCoeView &)
Deregisters a view.GetActiveViewId(TVwsViewId &)const
Gets the ID of the app UI's currently active view.GetDefaultViewId(TVwsViewId &)const
Gets this app UI's default view ID.HandleApplicationSpecificEventL(TInt,const TWsEvent &)
Handles an application-specific event.HandleForegroundEventL(TBool)
Handles changes in keyboard focus when the application is brought to the foregro...HandleKeyEventL(const TKeyEvent &,TEventCode)
Handles key events.HandleScreenDeviceChangedL()
HandleStackChanged()
Handles changes to the control stack.HandleStackedControlsResourceChange(TInt)
Handles a change to the application's run-time resources for all controls on the...HandleSwitchOnEventL(CCoeControl *)
Handles the special switch on event.HandleSystemEventL(const TWsEvent &)
Handles system events generated by the window server.HandleWsEventL(const TWsEvent &,CCoeControl *)
Handles events sent to the application by the window server.HelpContextL()const
Gets a list of help contexts for the app UI.InputCapabilities()const
Returns the input capabilities of the control with focus.IsDisplayingControlBetweenPriorities(TInt,TInt)const
Tests whether the application is displaying a control between the given control ...IsDisplayingDialog()const
Tests whether the application is displaying a dialog.IsDisplayingMenuOrDialog()const
Tests whether the application is displaying a menu bar or dialog.IsViewConstructed(const TVwsViewId &)const
Checks if the view has been constructed or not. NotifyNextDeactivation(MCoeViewDeactivationObserver &)
Requests that the next deactivation of any view registered with the view server ...NotifyNextDeactivation(const TVwsViewId &,MCoeViewDeactivationObserver &)
Requests that the next deactivation of the view identified by aViewId be notifie...PrepareToExit()
Performs pre-exit processing on the control environment.RegisterApplicationViewL(TUid)
Registers a pseudo-view for the application identified by aAppUid.RegisterViewL(MCoeView &)
Registers a view with the view server.RemoveFromStack(CCoeControl *)
Removes a control from the app UI's control stack.RemoveFromViewStack(const MCoeView &,CCoeControl *)
RemoveViewDeactivationObserver(MCoeViewDeactivationObserver *)
Removes an observer from the list to be notified of view deactivations.SetAndDrawFocus(TBool)
Sets the keyboard focus of a control and draws it.SetDefaultViewL(const MCoeView &)
Sets one of the app UI's views as the default.UpdateStackedControlFlags(CCoeControl *,TInt,TInt)
Updates the flag values for a control on the control stack.WriteInternalStateOfStackedControlsL(RWriteStream &)const
iCoeEnv
~CCoeAppUi()
The destructor frees all resources owned by the object, including the control st...Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...IMPORT_C CCoeAppUi();
C++ constructor.
To complete construction, call CCoeAppUi::ConstructL(CCoeAppUi *)
.
IMPORT_C ~CCoeAppUi();
The destructor frees all resources owned by the object, including the control stack and the view server session.
IMPORT_C void ConstructL(CCoeAppUi *aPrevious=0);
Completes construction of the CCoeAppUi object.
It creates the application's control stack and starts a view server session.
|
IMPORT_C void AddToStackL(const MCoeView &aView, CCoeControl *aControl, TInt aPriority=ECoeStackPriorityDefault, TInt aStackingFlags=ECoeStackFlagStandard);
Inserts a control into the app UI's control stack.
|
IMPORT_C void AddToStackL(CCoeControl *aControl, TInt aPriority=ECoeStackPriorityDefault, TInt aStackingFlags=ECoeStackFlagStandard);
Inserts a control into the app UI's control stack.
Use the other CCoeAppUi::AddToStackL(const MCoeView &,CCoeControl *,TInt,TInt)
overload if the app UI uses multiple views.
|
IMPORT_C void RemoveFromStack(CCoeControl *aControl);
Removes a control from the app UI's control stack.
This function also handles any focus changes that may occur.
|
IMPORT_C void HandleStackChanged();
Handles changes to the control stack.
This function ensures that the focusable control with the highest priority on the control stack has keyboard focus.
It may need to be called when a control's flag values are modified, by calling CCoeAppUi::UpdateStackedControlFlags(CCoeControl *,TInt,TInt)
. It is called automatically when a control is added to or removed from the stack.
IMPORT_C void HandleStackedControlsResourceChange(TInt aType);
Handles a change to the application's run-time resources for all controls on the app UI's control stack.
These are resources which are shared across the environment, such as colours, fonts or ZoomFactor.
|
IMPORT_C void UpdateStackedControlFlags(CCoeControl *aControl, TInt aFlags, TInt aMask);
Updates the flag values for a control on the control stack.
The mask defines which flags are modified, while aFlags defines the values they are set to.
|
|
IMPORT_C CArrayFix< TCoeHelpContext >* AppHelpContextL() const;
Returns a list of help contexts appropriate to the current state of the application.
The array is generated from the help contexts for all visible controls on the app UI's control stack, and from the app UI
itself (via CCoeAppUi::HelpContextL()const
).
|
IMPORT_C virtual TCoeInputCapabilities InputCapabilities() const;
Returns the input capabilities of the control with focus.
Classes that override CCoeAppUi::HandleKeyEventL(const TKeyEvent &,TEventCode)
should also override this virtual function. The TCoeInputCapabilities
object returned should have attributes that match the behaviour of the CCoeAppUi::HandleKeyEventL(const TKeyEvent &,TEventCode)
function.
Overriding app UIs should do a base-call and "merge" the returned input capabilities with its own input capabilities. If the
overriding CCoeAppUi::InputCapabilities()const
function needs to get the input capabilities of any top-level control, it should do so by calling CCoeControl::RecursivelyMergedInputCapabilities()const
on that control.
|
IMPORT_C TBool IsDisplayingMenuOrDialog() const;
Tests whether the application is displaying a menu bar or dialog.
|
IMPORT_C TBool IsDisplayingDialog() const;
Tests whether the application is displaying a dialog.
|
IMPORT_C TBool IsDisplayingControlBetweenPriorities(TInt aLowerPriority, TInt aHigherPriority) const;
Tests whether the application is displaying a control between the given control stack priorities.
|
|
IMPORT_C void RegisterViewL(MCoeView &aView);
Registers a view with the view server.
All views should be registered in the app UI's CCoeAppUi::ConstructL(CCoeAppUi *)
.
|
IMPORT_C void DeregisterView(const MCoeView &aView);
Deregisters a view.
All views must be deregistered before the application exits. This is usually done in the app UI's destructor.
It has no effect if the specified view does not exist.
|
IMPORT_C void SetDefaultViewL(const MCoeView &aView);
Sets one of the app UI's views as the default.
The default view should be constructed, drawn, registered and set as the default as early as possible in the app UI's CCoeAppUi::ConstructL(CCoeAppUi *)
function.
The meaning of the default view varies depending on the UI. It is normally the view that is displayed when the application is launched. It may also be the view that is displayed when the application is brought to the foreground.
|
IMPORT_C TInt GetDefaultViewId(TVwsViewId &aViewId) const;
Gets this app UI's default view ID.
|
|
IMPORT_C void RegisterApplicationViewL(TUid aAppUid);
Registers a pseudo-view for the application identified by aAppUid.
The view server is notified that a view exists for the application, which allows it to participate in the view switching mechanism, even though it does not implement any views.
Activating the application view means bringing the application into the foreground.
|
IMPORT_C void DeregisterApplicationView();
Deregisters the application view from the view architecture.
IMPORT_C TBool IsViewConstructed(const TVwsViewId &aViewId) const;
Checks if the view has been constructed or not.
|
|
IMPORT_C void ActivateViewL(const TVwsViewId &aViewId);
Activates an application view.
A leave occurs if view activation fails.
|
IMPORT_C void ActivateViewL(const TVwsViewId &aViewId, TUid aCustomMessageId, const TDesC8 &aCustomMessage);
Activates an application view and passes a message to it.
A leave occurs if view activation fails.
Notes:
Activation works synchronously so that in general, this method returns when the view is activated.
An application defines and publishes the message UIDs that it recognises. For example, a contacts application might activate an email editor view, passing an email address as a custom message. To do this, the contacts application must use a message UID, and descriptor encoding that the email application has published as being recognisable.
|
IMPORT_C void DeactivateActiveViewIfOwnerMatchL();
Deactivates the active view if the current view is owned by this application.
Deactivating the active view is necessary before exiting if the app UI has an active view. This function is called by the UI framework during application closure.
IMPORT_C void DeactivateActiveViewL();
Deactivates the active view.
Deactivating the active view is necessary before exiting if the app UI has an active view. In most cases, DeactivateActiveViewIfOwnerMatch should be used instead of this function.
IMPORT_C TInt GetActiveViewId(TVwsViewId &aViewId) const;
Gets the ID of the app UI's currently active view.
|
|
IMPORT_C TBool CheckSourceOfViewSwitchL(const TSecurityPolicy &aSecurityPolicy, const char *aDiagnostic=0) const;
Checks whether the view-server client that initiated the current view-switch matches the security-policy given in the parameter.
This function leaves with KErrUnknown if called outside of an implementation of MCoeView's ViewConstructL or of MCoeView's ViewActivatedL.
|
|
TSecurityPolicy
Class representing a generic security policyIMPORT_C void AddViewDeactivationObserverL(MCoeViewDeactivationObserver *aViewDeactivationObserver);
Adds an observer to the list of observers to be notified of view deactivations.
All view deactivation observers that have been added to the app UI are notified via their HandleViewDeactivation() function when any of this app UI's views are deactivated.
|
IMPORT_C void RemoveViewDeactivationObserver(MCoeViewDeactivationObserver *aViewDeactivationObserver);
Removes an observer from the list to be notified of view deactivations.
This has no effect if the observer is not found in the list.
|
IMPORT_C void NotifyNextDeactivation(const TVwsViewId &aViewId, MCoeViewDeactivationObserver &aViewDeactivationObserver);
Requests that the next deactivation of the view identified by aViewId be notified to the specified view deactivation observer.
The request is cleared after the notification: the observer can only be notified once, and this app UI can have no more than one such request pending.
|
|
IMPORT_C void NotifyNextDeactivation(MCoeViewDeactivationObserver &aViewDeactivationObserver);
Requests that the next deactivation of any view registered with the view server be notified to the specified view deactivation observer.
The request is cleared after the notification: the observer can only be notified once, and this app UI can have no more than one such request pending.
|
|
IMPORT_C virtual void HandleWsEventL(const TWsEvent &aEvent, CCoeControl *aDestination);
Handles events sent to the application by the window server.
This function is called whenever the window server sends key or pointer events or some other special events to the application. It calls one of a number of functions, according to the type of event.
For key events, it calls CCoeControl::OfferKeyEventL(const TKeyEvent &,TEventCode)
for each control on the control stack, beginning with the control at the top (position 0) until a control consumes it. If
no control on the stack consumes the key event, the app UI's CCoeAppUi::HandleKeyEventL(const TKeyEvent &,TEventCode)
is called. Note that CCoeControl::OfferKeyEventL(const TKeyEvent &,TEventCode)
is not called for controls whose ECoeStackFlagRefusesAllKeys flag is set.
For pointer events, CCoeControl::ProcessPointerEventL(const TPointerEvent &)
is called on the control specified in aDestination.
For pointer buffer ready events, ProcessPointerBufferReadyL() is called on the control specified in aDestination.
For other events, for instance focus change events, this function calls one of the following CCoeAppUi private virtual functions:
All these functions have empty implementations in this class, and are implemented by derived classes, if required.
|
CCoeAppUi::HandleWsEventL(const TWsEvent &,CCoeControl *)
Handles events sent to the application by the window server.IMPORT_C virtual void PrepareToExit();
Performs pre-exit processing on the control environment.
This function is called after the control environment's active scheduler exits, but before the control environment (i.e. the
CCoeEnv
object) is destroyed. The default implementation is empty, and this function is not implemented by CCoeAppUi, but it may
be implemented by derived classes to perform pre-exit processing on the control environment.
private: IMPORT_C virtual TKeyResponse HandleKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
Handles key events.
This function is called by CCoeAppUi::HandleWsEventL(const TWsEvent &,CCoeControl *)
if a key event occurred but none of the controls in the app UI's control stack consumed it.
Key events are sent to the application by the window server. A key press generates three separate key events in the order EEventKeyDown, EEventKey, and EEventKeyUp. Controls and app UIs are usually only interested in EEventKey events.
This default implementation simply returns EKeyWasNotConsumed. It may need to be overridden if the derived app UI needs to handle certain key events itself. For example, in some applications, arrow keys may be used to navigate between views. In this case, the app UI should override this function to consume the arrow keys.
|
|
private: IMPORT_C virtual void HandleForegroundEventL(TBool aForeground);
Handles changes in keyboard focus when the application is brought to the foreground, or put into the background.
This function is called from CCoeAppUi::HandleWsEventL(const TWsEvent &,CCoeControl *)
when an EEventFocusLost or EEventFocusGained event occurs.
This default implementation is empty.
|
private: IMPORT_C virtual void HandleSwitchOnEventL(CCoeControl *aDestination);
Handles the special switch on event.
This function is called by CCoeAppUi::HandleWsEventL(const TWsEvent &,CCoeControl *)
if the device is switched on. This default implementation is empty.
|
private: IMPORT_C virtual void HandleSystemEventL(const TWsEvent &aEvent);
Handles system events generated by the window server.
This method should be overridden by the UI layer like CEikAppUi
but not by individual applications. Application events (has a positive value greater than EEventUser) will be sent to HandleApplicationSpecificEventL
.
Unrecognized events should be forwarded to the base class.
|
private: IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType, const TWsEvent &aEvent);
Handles an application-specific event.
This function is called from CCoeAppUi::HandleWsEventL(const TWsEvent &,CCoeControl *)
when the app UI receives a window server event that is not in the standard range (in other words, it has a positive value
greater than EEventUser).
This default implementation is empty.
|
private: IMPORT_C virtual void SetAndDrawFocus(TBool aFocus);
Sets the keyboard focus of a control and draws it.
This is called by CCoeAppUi::HandleWsEventL(const TWsEvent &,CCoeControl *)
when it receives a focus change event and can also be called when a new control is moved to the top of the control stack.
This default implementation is empty. It is intended that an implementation should set the value of a focus flag within the control to the value given by aFocus. This flag indicates whether or not the control has keyboard focus. The function should then draw or change the appearance of the control to indicate whether or not it has focus.
|
private: IMPORT_C virtual CArrayFix< TCoeHelpContext >* HelpContextL() const;
Gets a list of help contexts for the app UI.
This default implementation returns NULL.
|
IMPORT_C void WriteInternalStateOfStackedControlsL(RWriteStream &aWriteStream) const;
|
Interface status: | deprecated |
IMPORT_C void RemoveFromViewStack(const MCoeView &aView, CCoeControl *aControl);
|
Interface status: | deprecated |
IMPORT_C void AddToViewStackL(const MCoeView &aView, CCoeControl *aControl, TInt aPriority=ECoeStackPriorityDefault, TInt
aStackingFlags=ECoeStackFlagStandard);
|
protected: CCoeEnv * iCoeEnv;