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