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