1.1 --- a/epoc32/include/vwsdef.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,277 +0,0 @@
1.4 -// Copyright (c) 1999-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 __VWSDEF_H__
1.20 -#define __VWSDEF_H__
1.21 -
1.22 -#include <e32std.h>
1.23 -
1.24 -/**
1.25 -@publishedPartner
1.26 -*/
1.27 -#define KUidCustomCrossCheckValue 0x80282748
1.28 -
1.29 -/**
1.30 -@publishedPartner
1.31 -*/
1.32 -const TUid KUidCustomCrossCheck={KUidCustomCrossCheckValue};
1.33 -
1.34 -class TVwsViewId
1.35 -/** Identifies an application view using two unique identifiers (UIDs): a view
1.36 -UID and an application UID.
1.37 -
1.38 -The application UID is required so that the application associated with the view
1.39 -can be started if it is not already running.
1.40 -
1.41 -@publishedAll
1.42 -@released */
1.43 - {
1.44 -public:
1.45 - inline TVwsViewId();
1.46 - inline TVwsViewId(const TVwsViewId& aUid);
1.47 - inline TVwsViewId(TUid aAppUid,TUid aViewUid);
1.48 - inline TBool operator==(const TVwsViewId& aUid) const;
1.49 - inline TBool operator!=(const TVwsViewId& aUid) const;
1.50 -public:
1.51 - /** A unique application ID (or application UID).
1.52 -
1.53 - Uniquely identifies the application associated with the view. */
1.54 - TUid iAppUid;
1.55 - /** A unique view ID (or view UID).
1.56 -
1.57 - Uniquely identifies the view. */
1.58 - TUid iViewUid;
1.59 - };
1.60 -
1.61 -/** @internalTechnology */
1.62 -#define KNullViewId TVwsViewId(KNullUid,KNullUid)
1.63 -
1.64 -/** @internalTechnology */
1.65 -const TInt KErrViewWrongMode=1; // !!! Wrong error code - should be -ve & unique
1.66 -
1.67 -
1.68 -class TVwsViewIdAndMessage
1.69 -/**
1.70 -The TVwsViewIdAndMessage class identifies a view and encapsulates a message to
1.71 -be read by the view when it is activated.
1.72 -
1.73 -@publishedAll
1.74 -@released
1.75 -*/
1.76 - {
1.77 -public:
1.78 - inline TVwsViewIdAndMessage();
1.79 - inline TVwsViewIdAndMessage(const TVwsViewId& aId);
1.80 - inline TVwsViewIdAndMessage(const TVwsViewId& aId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
1.81 - inline TVwsViewIdAndMessage& operator=(const TVwsViewIdAndMessage& aVwsViewIdAndMessage);
1.82 -public:
1.83 - TVwsViewId iViewId;
1.84 - TUid iCustomMessageId;
1.85 - TInt iCustomMessageLength;
1.86 - TPtrC8 iCustomMessage;
1.87 - };
1.88 -
1.89 -
1.90 -
1.91 -class TVwsViewEvent
1.92 -/**
1.93 -The TVwsViewEvent class encapsulates the attributes of a view server event.
1.94 -These are:
1.95 -- The event type
1.96 -- The view ids of the two views associated with the event
1.97 -- The attributes of any message which can go with the event.
1.98 -
1.99 -@publishedPartner
1.100 -@released
1.101 -*/
1.102 - {
1.103 -public:
1.104 - enum TVwsViewEventType
1.105 - {
1.106 - EVwsActivateView,
1.107 - EVwsDeactivateView,
1.108 - EVwsScreenDeviceChanged,
1.109 - EVwsDeactivationNotification,
1.110 - EVwsActivationNotification,
1.111 - EVwsDeactivateViewDifferentInstance
1.112 - };
1.113 -public:
1.114 - inline TVwsViewEvent();
1.115 - inline TVwsViewEvent(TVwsViewEventType aEventType);
1.116 - inline TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId);
1.117 - inline TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId,const TVwsViewId& aViewTwoId);
1.118 - inline TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId,const TVwsViewId& aViewTwoId,TUid aCustomMessageId,TInt aCustomMessageLength);
1.119 -public:
1.120 - /**
1.121 - The event type.
1.122 - */
1.123 - TVwsViewEventType iEventType;
1.124 - /**
1.125 - The first view id associated with the event. This has a different meaning for each of the event types:
1.126 - - For ActivateView events, it is the view to activate
1.127 - - For DeactivateView events, it is the view to deactivate
1.128 - - For ScreenDeviceChange events, it is the id of the currently active view
1.129 - - For ActivationNotification events, it is the id of the activated view
1.130 - - For DeactivationNotification events, it is the id of the deactivated view
1.131 - */
1.132 - TVwsViewId iViewOneId;
1.133 - /**
1.134 - The second view id associated with the event. This has a different meaning for each of the event types:
1.135 - - For ActivateView events, it is the view that will be deactivated
1.136 - - For DeactivateView events, it is the view that has been activated
1.137 - - For ScreenDeviceChange events, it is unused
1.138 - - For ActivationNotification events, it is the view that will be deactivated
1.139 - - For DeactivationNotification events, it is the id of the view that has been activated
1.140 - */
1.141 - TVwsViewId iViewTwoId;
1.142 - /**
1.143 - The type of message being passed in the custom message buffer
1.144 - */
1.145 - TUid iCustomMessageId;
1.146 - /**
1.147 - The length of the custom message being held by the server.
1.148 - To retrieve the message itself from the server, a buffer of this length must be allocated
1.149 - */
1.150 - TInt iCustomMessageLength;
1.151 - };
1.152 -
1.153 -
1.154 -//
1.155 -// Typedefs.
1.156 -//
1.157 -/** @internalComponent */
1.158 -typedef TPckgBuf<TVwsViewIdAndMessage> TVwsViewIdAndMessageBuf;
1.159 -
1.160 -/** @internalComponent */
1.161 -typedef TPckgBuf<TVwsViewEvent> TVwsViewEventBuf;
1.162 -
1.163 -
1.164 -//
1.165 -// Inlines
1.166 -//
1.167 -
1.168 -inline TVwsViewId::TVwsViewId()
1.169 -/** Constructs a TVwsViewId object, and initialises both the application UID and
1.170 -the view UID to NULL. */
1.171 - : iAppUid(KNullUid), iViewUid(KNullUid) {}
1.172 -
1.173 -inline TVwsViewId::TVwsViewId(const TVwsViewId& aUid)
1.174 -/** Constructs a new TVwsViewId object from an existing one. This simply performs
1.175 -a member-wise copy, each member variable of the passed in object is individually
1.176 -copied to the corresponding member variable of the new object.
1.177 -
1.178 -@param aUid A reference to the TVwsViewId object to be copied. */
1.179 - : iAppUid(aUid.iAppUid), iViewUid(aUid.iViewUid) {}
1.180 -
1.181 -inline TVwsViewId::TVwsViewId(TUid aAppUid,TUid aViewUid)
1.182 -/** Constructs a TVwsViewId object with the specified application UID and view UID.
1.183 -
1.184 -@param aAppUid The application UID.
1.185 -@param aViewUid The view UID. */
1.186 - : iAppUid(aAppUid), iViewUid(aViewUid) {}
1.187 -
1.188 -inline TBool TVwsViewId::operator==(const TVwsViewId& aUid) const
1.189 -/** Checks whether the TVwsViewId object being operated upon and the TVwsViewId
1.190 -object specified are the same.
1.191 -
1.192 -Returns true if both application UIDs and both view UIDs are the same, otherwise
1.193 -returns false.
1.194 -
1.195 -@param aUid A reference to a TVwsViewId object.
1.196 -@return ETrue if objects are the same, EFalse otherwise. */
1.197 - {
1.198 - return (aUid.iAppUid==iAppUid && aUid.iViewUid==iViewUid);
1.199 - }
1.200 -
1.201 -inline TBool TVwsViewId::operator!=(const TVwsViewId& aUid) const
1.202 -/** Checks whether the TVwsViewId object being operated upon and the TVwsViewId
1.203 -object specified are different.
1.204 -
1.205 -Returns true if either the application UIDs or view UIDs are different, otherwise
1.206 -returns false.
1.207 -
1.208 -@param aUid A reference to a TVwsViewId object.
1.209 -@return ETrue if objects are different, EFalse otherwise. */
1.210 - {
1.211 - return (aUid.iAppUid!=iAppUid || aUid.iViewUid!=iViewUid);
1.212 - }
1.213 -
1.214 -
1.215 -/** Constructs a TVwsViewIdAndMessage object, and initialises it to contain a
1.216 -NULL view UID and an empty message */
1.217 -inline TVwsViewIdAndMessage::TVwsViewIdAndMessage()
1.218 - : iViewId(TVwsViewId()), iCustomMessageLength(0)
1.219 - {
1.220 - iCustomMessageId.iUid=0;
1.221 - iCustomMessage.Set(KNullDesC8);
1.222 - }
1.223 -
1.224 -/** Constructs a TVwsViewIdAndMessage object, and initialises it to contain the
1.225 -specified view UID and an empty message
1.226 -
1.227 -@param aId A reference to the TVwsViewId to be used
1.228 -*/
1.229 -inline TVwsViewIdAndMessage::TVwsViewIdAndMessage(const TVwsViewId& aId)
1.230 - : iViewId(aId), iCustomMessageLength(0)
1.231 - {
1.232 - iCustomMessageId.iUid=0;
1.233 - iCustomMessage.Set(KNullDesC8);
1.234 - }
1.235 -
1.236 -/** Constructs a TVwsViewIdAndMessage object, and initialises it to contain the
1.237 -specified view UID and the specified message
1.238 -
1.239 -@param aId A reference to the TVwsViewId to be used
1.240 -@param aCustomMessageId The message Id to use
1.241 -@param aCustomMessage A narrow descriptor containing the message
1.242 -*/
1.243 -inline TVwsViewIdAndMessage::TVwsViewIdAndMessage(const TVwsViewId& aId,TUid aCustomMessageId,const TDesC8& aCustomMessage)
1.244 - : iViewId(aId), iCustomMessageId(aCustomMessageId)
1.245 - {
1.246 - iCustomMessageLength=aCustomMessage.Length();
1.247 - iCustomMessage.Set(aCustomMessage);
1.248 - }
1.249 -
1.250 -/** Copies the contents of another TVwsViewIdAndMessage into this one
1.251 -
1.252 -@param aVwsViewIdAndMessage A reference to the TVwsViewIdAndMessage to be copied
1.253 -
1.254 -@return A reference to the object being copied into
1.255 -*/
1.256 -inline TVwsViewIdAndMessage& TVwsViewIdAndMessage::operator=(const TVwsViewIdAndMessage& aVwsViewIdAndMessage)
1.257 - {
1.258 - iViewId=aVwsViewIdAndMessage.iViewId;
1.259 - iCustomMessageId=aVwsViewIdAndMessage.iCustomMessageId;
1.260 - iCustomMessageLength=aVwsViewIdAndMessage.iCustomMessage.Length();
1.261 - iCustomMessage.Set(aVwsViewIdAndMessage.iCustomMessage);
1.262 - return(*this);
1.263 - }
1.264 -
1.265 -inline TVwsViewEvent::TVwsViewEvent() {}
1.266 -
1.267 -inline TVwsViewEvent::TVwsViewEvent(TVwsViewEventType aEventType)
1.268 - : iEventType(aEventType),iViewOneId(),iViewTwoId(),iCustomMessageId(KNullUid),iCustomMessageLength(0) {}
1.269 -
1.270 -inline TVwsViewEvent::TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId)
1.271 - : iEventType(aEventType),iViewOneId(aViewOneId),iViewTwoId(),iCustomMessageId(KNullUid),iCustomMessageLength(0) {}
1.272 -
1.273 -inline TVwsViewEvent::TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId,const TVwsViewId& aViewTwoId)
1.274 - : iEventType(aEventType),iViewOneId(aViewOneId),iViewTwoId(aViewTwoId),iCustomMessageId(KNullUid),iCustomMessageLength(0) {}
1.275 -
1.276 -inline TVwsViewEvent::TVwsViewEvent(TVwsViewEventType aEventType,const TVwsViewId& aViewOneId,const TVwsViewId& aViewTwoId,TUid aCustomMessageId,TInt aCustomMessageLength)
1.277 - : iEventType(aEventType),iViewOneId(aViewOneId),iViewTwoId(aViewTwoId),iCustomMessageId(aCustomMessageId),iCustomMessageLength(aCustomMessageLength) {}
1.278 -
1.279 -
1.280 -#endif