1.1 --- a/epoc32/include/coeaui.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/coeaui.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,245 @@
1.4 -coeaui.h
1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __COEAUI_H__
1.21 +#define __COEAUI_H__
1.22 +
1.23 +#include <e32std.h>
1.24 +#include <e32base.h>
1.25 +#include <w32std.h>
1.26 +#include <vwsdef.h>
1.27 +#include <coedef.h>
1.28 +#include <coehelp.h>
1.29 +#include <coeview.h>
1.30 +#include <coeinput.h>
1.31 +
1.32 +class CCoeEnv;
1.33 +class CCoeControl;
1.34 +
1.35 +/**
1.36 +Creates a FEP interface object.
1.37 +
1.38 +@publishedAll
1.39 +@released
1.40 +*/
1.41 +typedef CCoeFep* (*TCoeFepFactoryFunctionL)(CCoeEnv& aConeEnvironment, const TDesC& aFullFileNameOfDll, const CCoeFepParameters& aFepParameters);
1.42 +
1.43 +/**
1.44 +Calls the second ordinal function of the FEP for which the settings dialog is to be executed.
1.45 +
1.46 +@publishedAll
1.47 +@released
1.48 +*/
1.49 +typedef void (*TCoeSynchronouslyExecuteFepSettingsDialogFunctionL)(CCoeEnv& aConeEnvironment, const TDesC& aFullFileNameOfDll);
1.50 +
1.51 +/** Stack priority flags.
1.52 +
1.53 +Controls with higher priorities get offered key events before controls
1.54 +with lower priorities.
1.55 +
1.56 +@publishedAll
1.57 +@released */
1.58 +enum
1.59 + {
1.60 + /** 0 */
1.61 + ECoeStackPriorityDefault=0,
1.62 + /** 10 */
1.63 + ECoeStackPriorityMenu=10,
1.64 + /** 50 */
1.65 + ECoeStackPriorityDialog=50,
1.66 + /** 60 */
1.67 + ECoeStackPriorityCba=60,
1.68 + /** 200 */
1.69 + ECoeStackPriorityAlert=200,
1.70 + /** 240 */
1.71 + ECoeStackPrioritySoftkey=240,
1.72 + /** 250 */
1.73 + ECoeStackPriorityFep=250,
1.74 + /** 300 */
1.75 + ECoeStackPriorityEnvironmentFilter=300
1.76 + };
1.77 +
1.78 +
1.79 +/** Control stack flags.
1.80 +
1.81 +Each control on the stack has a set of these flags which can be used
1.82 +to refuse to accept key events and to refuse requests for focus.
1.83 +
1.84 +@publishedAll
1.85 +@released */
1.86 +enum
1.87 + {
1.88 + /** The default value */
1.89 + ECoeStackFlagStandard = 0,
1.90 + /** The control does not accept key events. */
1.91 + ECoeStackFlagRefusesAllKeys = 0x01,
1.92 + /** The control does not accept keyboard focus. */
1.93 + ECoeStackFlagRefusesFocus = 0x02,
1.94 + /** The control is owned and deleted by the stack. */
1.95 + ECoeStackFlagOwnershipTransfered= 0x04,
1.96 + /** The control is also added to the stack of any embedded app UI. For
1.97 + example, an alert dialog added through CEikonEnv will be
1.98 + shared on the stack of all embedded app UIs that may appear in the
1.99 + application. */
1.100 + ECoeStackFlagSharable = 0x08
1.101 + };
1.102 +
1.103 +class CCoeControlStack;
1.104 +class CCoeViewManager;
1.105 +
1.106 +/** Application user interface (app UI) base class.
1.107 +
1.108 +The app UI's responsibilities include owning the application's control stack and views,
1.109 +handling user commands, (see the derived class CEikAppUi), and handling events sent by
1.110 +the OS to the application, for instance being brought to the foreground.
1.111 +
1.112 +The UI framework class CEikAppUi is derived from this class. UIs may derive
1.113 +further to add their own UI-specific features to the app UI; each application must
1.114 +derive its own concrete app UI class from this.
1.115 +
1.116 +@publishedAll
1.117 +@released */
1.118 +class CCoeAppUi : public CBase
1.119 + {
1.120 +public:
1.121 + // Construction and destruction
1.122 + IMPORT_C CCoeAppUi();
1.123 + IMPORT_C ~CCoeAppUi();
1.124 + IMPORT_C void ConstructL(CCoeAppUi* aPrevious=NULL);
1.125 + // Control stack
1.126 + IMPORT_C void AddToStackL(const MCoeView& aView,CCoeControl* aControl,TInt aPriority=ECoeStackPriorityDefault,TInt aStackingFlags=ECoeStackFlagStandard);
1.127 + IMPORT_C void AddToStackL(CCoeControl* aControl,TInt aPriority=ECoeStackPriorityDefault,TInt aStackingFlags=ECoeStackFlagStandard);
1.128 + IMPORT_C void RemoveFromStack(CCoeControl* aControl);
1.129 + IMPORT_C void HandleStackChanged();
1.130 + IMPORT_C void HandleStackedControlsResourceChange(TInt aType);
1.131 + IMPORT_C void UpdateStackedControlFlags(CCoeControl* aControl,TInt aFlags,TInt aMask);
1.132 + // Help context
1.133 + IMPORT_C CArrayFix<TCoeHelpContext>* AppHelpContextL() const;
1.134 + // Text input
1.135 + IMPORT_C virtual TCoeInputCapabilities InputCapabilities() const;
1.136 + // Control focus
1.137 + IMPORT_C CCoeControl* TopFocusedControl() const;
1.138 + // Utility
1.139 + IMPORT_C TBool IsDisplayingMenuOrDialog() const;
1.140 + IMPORT_C TBool IsDisplayingDialog() const;
1.141 + IMPORT_C TBool IsDisplayingControlBetweenPriorities(TInt aLowerPriority, TInt aHigherPriority) const;
1.142 + // View registration
1.143 + IMPORT_C void RegisterViewL(MCoeView& aView);
1.144 + IMPORT_C void DeregisterView(const MCoeView& aView);
1.145 + IMPORT_C void SetDefaultViewL(const MCoeView& aView);
1.146 + IMPORT_C TInt GetDefaultViewId(TVwsViewId& aViewId) const;
1.147 + // Pseudo-view registration
1.148 + IMPORT_C void CheckInitializeViewsL(TUid aAppUid);
1.149 + IMPORT_C void RegisterApplicationViewL(TUid aAppUid);
1.150 + IMPORT_C void DeregisterApplicationView();
1.151 + // View construction
1.152 + IMPORT_C TBool IsViewConstructed(const TVwsViewId& aViewId) const;
1.153 + // View activation
1.154 + IMPORT_C void ActivateViewL(const TVwsViewId& aViewId);
1.155 + IMPORT_C void ActivateViewL(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
1.156 + IMPORT_C void ActivateTopViewL();
1.157 + IMPORT_C void CreateActivateViewEventL(const TVwsViewId& aViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
1.158 + IMPORT_C void DeactivateActiveViewIfOwnerMatchL();
1.159 + IMPORT_C void DeactivateActiveViewL();
1.160 + IMPORT_C TInt GetActiveViewId(TVwsViewId& aViewId) const;
1.161 + // View registration
1.162 + IMPORT_C void AddViewObserverL(MCoeViewObserver* aViewObserver);
1.163 + IMPORT_C void RemoveViewObserver(MCoeViewObserver* aViewObserver);
1.164 + // View activation observer
1.165 + IMPORT_C void AddViewActivationObserverL(MCoeViewActivationObserver* aViewActivationObserver);
1.166 + IMPORT_C void RemoveViewActivationObserver(MCoeViewActivationObserver* aViewActivationObserver);
1.167 + IMPORT_C void NotifyNextActivation(const TVwsViewId& aViewId, MCoeViewActivationObserver& aViewActivationObserver);
1.168 + IMPORT_C void NotifyNextActivation(MCoeViewActivationObserver& aViewActivationObserver);
1.169 + IMPORT_C TBool CheckSourceOfViewSwitchL(const TSecurityPolicy& aSecurityPolicy,const char* aDiagnostic=NULL) const;
1.170 + // View decativation observer
1.171 + IMPORT_C void AddViewDeactivationObserverL(MCoeViewDeactivationObserver* aViewDeactivationObserver);
1.172 + IMPORT_C void RemoveViewDeactivationObserver(MCoeViewDeactivationObserver* aViewDeactivationObserver);
1.173 + IMPORT_C void NotifyNextDeactivation(const TVwsViewId& aViewId, MCoeViewDeactivationObserver& aViewDeactivationObserver);
1.174 + IMPORT_C void NotifyNextDeactivation(MCoeViewDeactivationObserver& aViewDeactivationObserver);
1.175 + // View session configuration
1.176 + IMPORT_C TInt EnableExternalViewSwitches(TBool aEnable);
1.177 + IMPORT_C void UpdateViewServerBackgroundColor(const TRgb& aBgColor);
1.178 +
1.179 + // New APIs
1.180 + IMPORT_C void SetCustomControl(TInt aCustomControl);
1.181 + IMPORT_C TInt GetTopViewId(TVwsViewId& aViewId) const;
1.182 + IMPORT_C void SetWindowGroupOrdinal(TInt aWindowGroupOrdinal);
1.183 +
1.184 +public: // Internal
1.185 + IMPORT_C void SetApplicationViewAsDefaultL(); // internalTechnology
1.186 + IMPORT_C void SetSystemDefaultViewL(const TVwsViewId& aViewId,TInt aMode); // internalTechnology
1.187 + IMPORT_C void SetSystemDefaultViewL(const TVwsViewId& aViewId); // internalTechnology
1.188 + IMPORT_C void GetSystemDefaultViewL(TVwsViewId& aViewId); // internalTechnology
1.189 + IMPORT_C virtual void HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination);
1.190 + IMPORT_C virtual void PrepareToExit();
1.191 +protected: // Internal
1.192 + IMPORT_C virtual void HandleScreenDeviceChangedL();
1.193 +private: // Internal
1.194 + IMPORT_C virtual TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
1.195 + IMPORT_C virtual void HandleForegroundEventL(TBool aForeground);
1.196 + IMPORT_C virtual void HandleSwitchOnEventL(CCoeControl* aDestination);
1.197 + IMPORT_C virtual void HandleSystemEventL(const TWsEvent& aEvent);
1.198 + IMPORT_C virtual void HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent);
1.199 + IMPORT_C virtual void SetAndDrawFocus(TBool aFocus);
1.200 + IMPORT_C virtual CArrayFix<TCoeHelpContext>* HelpContextL() const;
1.201 +public: // Internal
1.202 + IMPORT_C virtual TBool FrameworkCallsRendezvous() const;
1.203 +public: // Internal
1.204 + IMPORT_C void WriteInternalStateOfStackedControlsL(RWriteStream& aWriteStream) const; // internalTechnology
1.205 +public: // Deprecated. Do not use!
1.206 + IMPORT_C void RegisterViewAndAddStackL(MCoeView& aView); // deprecated
1.207 + IMPORT_C void DeregisterViewAndRemoveStack(const MCoeView& aView); // deprecated
1.208 + IMPORT_C void RemoveFromViewStack(const MCoeView& aView,CCoeControl* aControl); // deprecated
1.209 + IMPORT_C void UpdateViewStackedControlFlags(const MCoeView& aView,CCoeControl* aControl,TInt aFlags,TInt aMask); // deprecated
1.210 + IMPORT_C void AddToViewStackL(const MCoeView& aView,CCoeControl* aControl,TInt aPriority=ECoeStackPriorityDefault,TInt aStackingFlags=ECoeStackFlagStandard); // deprecated
1.211 +public: // not exported
1.212 + TBool IsControlOnStack(CCoeControl* aControl) const;
1.213 + void SetCurrentControlStackGroupId(TInt aGroupId);
1.214 + void NotifyFontChange(const CCoeFontProvider& aFontProvider);
1.215 + void RefetchPixelMappingL();
1.216 +private:
1.217 + enum TRemoveCondition
1.218 + {
1.219 + ERemoveUnconditionally,
1.220 + ERemoveOnlyIfSharable
1.221 + };
1.222 +private:// Internal
1.223 + IMPORT_C virtual void CCoeAppUi_Reserved_2();
1.224 +private:
1.225 + CCoeControl* TopFocusableControl() const;
1.226 + TInt FindPos(CCoeControlStack* aStack,CCoeControl* aControl) const;
1.227 + void SetFocusToControl(CCoeControl* aControl,TBool aFocus);
1.228 + void DoAddToStackL(CCoeControlStack* aStack,CCoeControl* aControl,TInt aPriority,TInt aStackingFlags);
1.229 + void DoAddToStackL(CCoeControlStack* aStack,CCoeControl* aControl,TInt aPriority,TInt aStackingFlags, TInt aGroupId);
1.230 + void DoRemoveFromStack(CCoeControlStack* aStack,CCoeControl* aControl,TRemoveCondition aRemoveCondition=ERemoveUnconditionally);
1.231 + void DoUpdateStackedControlFlags(CCoeControlStack* aStack,CCoeControl* aControl,TInt aFlags,TInt aMask);
1.232 +public:
1.233 +/**Monitor function for passing all windows events to registered monitor observers for optional inspection*/
1.234 + void MonitorWsEvent(const TWsEvent& aEvent);
1.235 +private:
1.236 + class CExtra;
1.237 + friend class CExtra;
1.238 + friend class CTestDriver;
1.239 +protected:
1.240 + CCoeEnv* iCoeEnv;
1.241 +private:
1.242 + CCoeViewManager* iViewManager;
1.243 + CCoeControlStack* iStack;
1.244 + CExtra* iExtra;
1.245 + TInt iCCoeAppUi_Reserved1;
1.246 + };
1.247 +
1.248 +
1.249 +#endif // __COEAUI_H__