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