epoc32/include/mw/coeview.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/coeview.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,174 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// 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.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __COEVIEW_H__
    1.20 +#define __COEVIEW_H__
    1.21 +
    1.22 +#include <vwsdef.h>
    1.23 +#include <coemain.h> // for CCoeStatic
    1.24 +
    1.25 +class CCoeAppUi;
    1.26 +
    1.27 +/** Specifies an interface for views. 
    1.28 +
    1.29 +This class should be implemented by all application views. 
    1.30 +
    1.31 +@publishedAll
    1.32 +@released */
    1.33 +class MCoeView
    1.34 +	{
    1.35 +public:	
    1.36 +	/** Returns a TVwsViewId uniquely identifying the view.
    1.37 +	
    1.38 +	@return Represents a view in the server. */
    1.39 +	virtual TVwsViewId ViewId() const=0;
    1.40 +private:
    1.41 +	/** Takes any action required when a view is activated. Reimplemented versions 
    1.42 +	should read the contents of aCustomMessage for any message type identified 
    1.43 +	by aCustomMessageId that the view understands.
    1.44 +	
    1.45 +	The ID of the previously active view aPrevViewId is supplied so that the activated 
    1.46 +	view can subsequently switch back to the caller if required.
    1.47 +	
    1.48 +	@param aPrevViewId The UID of the previously active view.
    1.49 +	@param aCustomMessageId Message type.
    1.50 +	@param aCustomMessage Message contents. 
    1.51 +
    1.52 +	@publishedAll
    1.53 +	@released */
    1.54 +	virtual void ViewActivatedL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage)=0;
    1.55 +	/** Takes any action that is required following deactivation of the view. 
    1.56 +	
    1.57 +	This reduces the work required of the window server.
    1.58 +
    1.59 +	@publishedAll
    1.60 +	@released */
    1.61 +	virtual void ViewDeactivated()=0;
    1.62 +
    1.63 +protected:
    1.64 +	IMPORT_C MCoeView();
    1.65 +	IMPORT_C virtual TVwsViewIdAndMessage ViewScreenDeviceChangedL();
    1.66 +private:
    1.67 +	IMPORT_C virtual void ViewConstructL();
    1.68 +protected:
    1.69 +	IMPORT_C virtual TBool ViewScreenModeCompatible(TInt aScreenMode); // was MCoeView_Reserved_1()
    1.70 +private:
    1.71 +	friend class CCoeViewManager;
    1.72 +	IMPORT_C virtual void PrepareForViewActivation();
    1.73 +	IMPORT_C virtual void MCoeView_Reserved_2();
    1.74 +	IMPORT_C virtual void MCoeView_Reserved_3();
    1.75 +private:
    1.76 +	TInt iMCoeView_Reserved1;
    1.77 +	};
    1.78 +
    1.79 +/** An interface through which view deactivations can be
    1.80 +notified to an observer.
    1.81 +
    1.82 +Dialogs and other floating windows such as virtual keyboards which should be dismissed
    1.83 +when a view is deactivated can implement this interface and take any action required.
    1.84 +
    1.85 +@publishedAll
    1.86 +@released */
    1.87 +class MCoeViewDeactivationObserver
    1.88 +	{
    1.89 +public:
    1.90 +	//
    1.91 +	// Handles the deactivation of the view identified by aViewIdToBeDeactivated before the newly activated
    1.92 +	// view with id aNewlyActivatedViewId is marked as current.
    1.93 +	//
    1.94 +	virtual void HandleViewDeactivation(const TVwsViewId& aViewIdToBeDeactivated,const TVwsViewId& aNewlyActivatedViewId)=0;
    1.95 +protected:
    1.96 +	IMPORT_C MCoeViewDeactivationObserver();
    1.97 +private:
    1.98 +	IMPORT_C virtual void MCoeViewDeactivationObserver_Reserved_1();
    1.99 +	IMPORT_C virtual void MCoeViewDeactivationObserver_Reserved_2();
   1.100 +private:
   1.101 +	TInt iMCoeViewDeactivationObserver_Reserved1;
   1.102 +	};
   1.103 +
   1.104 +/** An interface through which view activations can be notified to an observer.
   1.105 +
   1.106 +@publishedPartner
   1.107 +@released
   1.108 +*/
   1.109 +class MCoeViewActivationObserver
   1.110 +	{
   1.111 +public:
   1.112 +	//
   1.113 +	// Handles the activation of the view aNewlyActivatedViewId before the old view aViewIdToBeDeactivated is
   1.114 +	// to be deactivated.
   1.115 +	//
   1.116 +	virtual void HandleViewActivation(const TVwsViewId& aNewlyActivatedViewId,const TVwsViewId& aViewIdToBeDeactivated)=0;
   1.117 +protected:
   1.118 +	IMPORT_C MCoeViewActivationObserver();
   1.119 +private:
   1.120 +	IMPORT_C virtual void MCoeViewActivationObserver_Reserved_1();
   1.121 +	IMPORT_C virtual void MCoeViewActivationObserver_Reserved_2();
   1.122 +private:
   1.123 +	TInt iMCoeViewActivationObserver_Reserved1;
   1.124 +	};
   1.125 +
   1.126 +
   1.127 +/** An interface through which view events can be notified to an observer.
   1.128 +
   1.129 +@publishedPartner
   1.130 +@released */
   1.131 +class MCoeViewObserver
   1.132 +	{
   1.133 +public:
   1.134 +	virtual void HandleViewEventL(const TVwsViewEvent& aEvent)=0;
   1.135 +protected:
   1.136 +	IMPORT_C MCoeViewObserver();
   1.137 +private:
   1.138 +	IMPORT_C virtual void MCoeViewObserver_Reserved1();
   1.139 +	IMPORT_C virtual void MCoeViewObserver_Reserved2();
   1.140 +private:
   1.141 +	TInt iMCoeViewObserver_Reserved1;
   1.142 +	};
   1.143 +
   1.144 +
   1.145 +//
   1.146 +// Handles any screen device changes that occur while a view is active 
   1.147 +//
   1.148 +/** A default screen device change handler. 
   1.149 +
   1.150 +This class is used to activate a default view when a screen "flip" occurs, 
   1.151 +if the currently active view does not implement MCoeView::ViewScreenDeviceChangedL().
   1.152 +
   1.153 +@publishedAll 
   1.154 +@released
   1.155 +@see MCoeView::ViewScreenDeviceChangedL() */
   1.156 +class CCoeScreenDeviceChangeDefaultHandler : public CCoeStatic
   1.157 +	{
   1.158 +public:
   1.159 +	IMPORT_C ~CCoeScreenDeviceChangeDefaultHandler();
   1.160 +	IMPORT_C static CCoeScreenDeviceChangeDefaultHandler* Self();
   1.161 +protected:
   1.162 +	IMPORT_C CCoeScreenDeviceChangeDefaultHandler();
   1.163 +	IMPORT_C CCoeScreenDeviceChangeDefaultHandler(TInt aDestructionPriority);
   1.164 +private:
   1.165 +	IMPORT_C virtual void CCoeStatic_Reserved1();
   1.166 +	IMPORT_C virtual void CCoeStatic_Reserved2();
   1.167 +	IMPORT_C virtual void CCoeScreenDeviceChangeDefaultHandler_Reserved1();
   1.168 +	IMPORT_C virtual void CCoeScreenDeviceChangeDefaultHandler_Reserved2();
   1.169 +public:
   1.170 +	virtual void HandleScreenDeviceChangedL()=0;
   1.171 +	virtual TVwsViewIdAndMessage DefaultViewOnScreenDeviceChanged()=0;
   1.172 +private:
   1.173 +	TInt iCCoeScreenDeviceChangeDefaultHandler;
   1.174 +	};
   1.175 +
   1.176 +
   1.177 +#endif	// __COEVIEW_H__