epoc32/include/coeview.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 __COEVIEW_H__
    17 #define __COEVIEW_H__
    18 
    19 #include <vwsdef.h>
    20 #include <coemain.h> // for CCoeStatic
    21 
    22 class CCoeAppUi;
    23 
    24 /** Specifies an interface for views. 
    25 
    26 This class should be implemented by all application views. 
    27 
    28 @publishedAll
    29 @released */
    30 class MCoeView
    31 	{
    32 public:	
    33 	/** Returns a TVwsViewId uniquely identifying the view.
    34 	
    35 	@return Represents a view in the server. */
    36 	virtual TVwsViewId ViewId() const=0;
    37 private:
    38 	/** Takes any action required when a view is activated. Reimplemented versions 
    39 	should read the contents of aCustomMessage for any message type identified 
    40 	by aCustomMessageId that the view understands.
    41 	
    42 	The ID of the previously active view aPrevViewId is supplied so that the activated 
    43 	view can subsequently switch back to the caller if required.
    44 	
    45 	@param aPrevViewId The UID of the previously active view.
    46 	@param aCustomMessageId Message type.
    47 	@param aCustomMessage Message contents. 
    48 
    49 	@publishedAll
    50 	@released */
    51 	virtual void ViewActivatedL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage)=0;
    52 	/** Takes any action that is required following deactivation of the view. 
    53 	
    54 	This reduces the work required of the window server.
    55 
    56 	@publishedAll
    57 	@released */
    58 	virtual void ViewDeactivated()=0;
    59 
    60 protected:
    61 	IMPORT_C MCoeView();
    62 	IMPORT_C virtual TVwsViewIdAndMessage ViewScreenDeviceChangedL();
    63 private:
    64 	IMPORT_C virtual void ViewConstructL();
    65 protected:
    66 	IMPORT_C virtual TBool ViewScreenModeCompatible(TInt aScreenMode); // was MCoeView_Reserved_1()
    67 private:
    68 	friend class CCoeViewManager;
    69 	IMPORT_C virtual void PrepareForViewActivation();
    70 	IMPORT_C virtual void MCoeView_Reserved_2();
    71 	IMPORT_C virtual void MCoeView_Reserved_3();
    72 private:
    73 	TInt iMCoeView_Reserved1;
    74 	};
    75 
    76 /** An interface through which view deactivations can be
    77 notified to an observer.
    78 
    79 Dialogs and other floating windows such as virtual keyboards which should be dismissed
    80 when a view is deactivated can implement this interface and take any action required.
    81 
    82 @publishedAll
    83 @released */
    84 class MCoeViewDeactivationObserver
    85 	{
    86 public:
    87 	//
    88 	// Handles the deactivation of the view identified by aViewIdToBeDeactivated before the newly activated
    89 	// view with id aNewlyActivatedViewId is marked as current.
    90 	//
    91 	virtual void HandleViewDeactivation(const TVwsViewId& aViewIdToBeDeactivated,const TVwsViewId& aNewlyActivatedViewId)=0;
    92 protected:
    93 	IMPORT_C MCoeViewDeactivationObserver();
    94 private:
    95 	IMPORT_C virtual void MCoeViewDeactivationObserver_Reserved_1();
    96 	IMPORT_C virtual void MCoeViewDeactivationObserver_Reserved_2();
    97 private:
    98 	TInt iMCoeViewDeactivationObserver_Reserved1;
    99 	};
   100 
   101 /** An interface through which view activations can be notified to an observer.
   102 
   103 @publishedPartner
   104 @released
   105 */
   106 class MCoeViewActivationObserver
   107 	{
   108 public:
   109 	//
   110 	// Handles the activation of the view aNewlyActivatedViewId before the old view aViewIdToBeDeactivated is
   111 	// to be deactivated.
   112 	//
   113 	virtual void HandleViewActivation(const TVwsViewId& aNewlyActivatedViewId,const TVwsViewId& aViewIdToBeDeactivated)=0;
   114 protected:
   115 	IMPORT_C MCoeViewActivationObserver();
   116 private:
   117 	IMPORT_C virtual void MCoeViewActivationObserver_Reserved_1();
   118 	IMPORT_C virtual void MCoeViewActivationObserver_Reserved_2();
   119 private:
   120 	TInt iMCoeViewActivationObserver_Reserved1;
   121 	};
   122 
   123 
   124 /** An interface through which view events can be notified to an observer.
   125 
   126 @publishedPartner
   127 @released */
   128 class MCoeViewObserver
   129 	{
   130 public:
   131 	virtual void HandleViewEventL(const TVwsViewEvent& aEvent)=0;
   132 protected:
   133 	IMPORT_C MCoeViewObserver();
   134 private:
   135 	IMPORT_C virtual void MCoeViewObserver_Reserved1();
   136 	IMPORT_C virtual void MCoeViewObserver_Reserved2();
   137 private:
   138 	TInt iMCoeViewObserver_Reserved1;
   139 	};
   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__