lafagnosticuifoundation/cone/inc/COEVIEW.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 __COEVIEW_H__
       
    17 #define __COEVIEW_H__
       
    18 
       
    19 #include <vwsdef.h>
       
    20 #include <coemain.h> // for CCoeStatic
       
    21 
       
    22 class CCoeAppUi;
       
    23 class TVwsViewEvent;
       
    24 
       
    25 /** Specifies an interface for views. 
       
    26 
       
    27 This class should be implemented by all application views. 
       
    28 
       
    29 @publishedAll
       
    30 @released */
       
    31 class MCoeView
       
    32 	{
       
    33 public:	
       
    34 	/** Returns a TVwsViewId uniquely identifying the view.
       
    35 	
       
    36 	@return Represents a view in the server. */
       
    37 	virtual TVwsViewId ViewId() const=0;
       
    38 private:
       
    39 	/** Takes any action required when a view is activated. Reimplemented versions 
       
    40 	should read the contents of aCustomMessage for any message type identified 
       
    41 	by aCustomMessageId that the view understands.
       
    42 	
       
    43 	The ID of the previously active view aPrevViewId is supplied so that the activated 
       
    44 	view can subsequently switch back to the caller if required.
       
    45 	
       
    46 	@param aPrevViewId The UID of the previously active view.
       
    47 	@param aCustomMessageId Message type.
       
    48 	@param aCustomMessage Message contents. 
       
    49 
       
    50 	@publishedAll
       
    51 	@released */
       
    52 	virtual void ViewActivatedL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage)=0;
       
    53 	/** Takes any action that is required following deactivation of the view. 
       
    54 	
       
    55 	This reduces the work required of the window server.
       
    56 
       
    57 	@publishedAll
       
    58 	@released */
       
    59 	virtual void ViewDeactivated()=0;
       
    60 
       
    61 protected:
       
    62 	IMPORT_C MCoeView();
       
    63 	IMPORT_C virtual TVwsViewIdAndMessage ViewScreenDeviceChangedL();
       
    64 private:
       
    65 	IMPORT_C virtual void ViewConstructL();
       
    66 protected:
       
    67 	IMPORT_C virtual TBool ViewScreenModeCompatible(TInt aScreenMode); // was MCoeView_Reserved_1()
       
    68 private:
       
    69 	friend class CCoeViewManager;
       
    70 	IMPORT_C virtual void PrepareForViewActivation();
       
    71 	IMPORT_C virtual void MCoeView_Reserved_2();
       
    72 	IMPORT_C virtual void MCoeView_Reserved_3();
       
    73 private:
       
    74 	TInt iMCoeView_Reserved1;
       
    75 	};
       
    76 
       
    77 /** An interface through which view events can be notified to an observer.
       
    78 
       
    79 @publishedAll
       
    80 @released */
       
    81 class MCoeViewObserver
       
    82 	{
       
    83 public:
       
    84 	virtual void HandleViewEventL(const TVwsViewEvent& aEvent)=0;
       
    85 protected:
       
    86 	IMPORT_C MCoeViewObserver();
       
    87 private:
       
    88 	IMPORT_C virtual void MCoeViewObserver_Reserved1();
       
    89 	IMPORT_C virtual void MCoeViewObserver_Reserved2();
       
    90 private:
       
    91 	TInt iMCoeViewObserver_Reserved1;
       
    92 	};
       
    93 
       
    94 /** An interface through which view activations can be notified to an observer.
       
    95 
       
    96 @publishedAll
       
    97 @released
       
    98 */
       
    99 class MCoeViewActivationObserver
       
   100 	{
       
   101 public:
       
   102 	//
       
   103 	// Handles the activation of the view aNewlyActivatedViewId before the old view aViewIdToBeDeactivated is
       
   104 	// to be deactivated.
       
   105 	//
       
   106 	virtual void HandleViewActivation(const TVwsViewId& aNewlyActivatedViewId,const TVwsViewId& aViewIdToBeDeactivated)=0;
       
   107 protected:
       
   108 	IMPORT_C MCoeViewActivationObserver();
       
   109 private:
       
   110 	IMPORT_C virtual void MCoeViewActivationObserver_Reserved_1();
       
   111 	IMPORT_C virtual void MCoeViewActivationObserver_Reserved_2();
       
   112 private:
       
   113 	TInt iMCoeViewActivationObserver_Reserved1;
       
   114 	};
       
   115 
       
   116 /** An interface through which view deactivations can be
       
   117 notified to an observer.
       
   118 
       
   119 Dialogs and other floating windows such as virtual keyboards which should be dismissed
       
   120 when a view is deactivated can implement this interface and take any action required.
       
   121 
       
   122 @publishedAll
       
   123 @released */
       
   124 
       
   125 class MCoeViewDeactivationObserver
       
   126 	{
       
   127 public:
       
   128 	//
       
   129 	// Handles the deactivation of the view identified by aViewIdToBeDeactivated before the newly activated
       
   130 	// view with id aNewlyActivatedViewId is marked as current.
       
   131 	//
       
   132 	virtual void HandleViewDeactivation(const TVwsViewId& aViewIdToBeDeactivated,const TVwsViewId& aNewlyActivatedViewId)=0;
       
   133 protected:
       
   134 	IMPORT_C MCoeViewDeactivationObserver();
       
   135 private:
       
   136 	IMPORT_C virtual void MCoeViewDeactivationObserver_Reserved_1();
       
   137 	IMPORT_C virtual void MCoeViewDeactivationObserver_Reserved_2();
       
   138 private:
       
   139 	TInt iMCoeViewDeactivationObserver_Reserved1;
       
   140 	};
       
   141 
       
   142 //
       
   143 // Handles any screen device changes that occur while a view is active 
       
   144 //
       
   145 /** A default screen device change handler. 
       
   146 
       
   147 This class is used to activate a default view when a screen "flip" occurs, 
       
   148 if the currently active view does not implement MCoeView::ViewScreenDeviceChangedL().
       
   149 
       
   150 @publishedAll 
       
   151 @released
       
   152 @see MCoeView::ViewScreenDeviceChangedL() */
       
   153 class CCoeScreenDeviceChangeDefaultHandler : public CCoeStatic
       
   154 	{
       
   155 public:
       
   156 	IMPORT_C ~CCoeScreenDeviceChangeDefaultHandler();
       
   157 	IMPORT_C static CCoeScreenDeviceChangeDefaultHandler* Self();
       
   158 protected:
       
   159 	IMPORT_C CCoeScreenDeviceChangeDefaultHandler();
       
   160 	IMPORT_C CCoeScreenDeviceChangeDefaultHandler(TInt aDestructionPriority);
       
   161 private:
       
   162 	IMPORT_C virtual void CCoeStatic_Reserved1();
       
   163 	IMPORT_C virtual void CCoeStatic_Reserved2();
       
   164 	IMPORT_C virtual void CCoeScreenDeviceChangeDefaultHandler_Reserved1();
       
   165 	IMPORT_C virtual void CCoeScreenDeviceChangeDefaultHandler_Reserved2();
       
   166 public:
       
   167 	virtual void HandleScreenDeviceChangedL()=0;
       
   168 	virtual TVwsViewIdAndMessage DefaultViewOnScreenDeviceChanged()=0;
       
   169 private:
       
   170 	TInt iCCoeScreenDeviceChangeDefaultHandler;
       
   171 	};
       
   172 
       
   173 
       
   174 #endif	// __COEVIEW_H__