windowing/windowserver/nga/SERVER/OBJECT.CPP
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 1994-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 // Common object code
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "OBJECT.H"
       
    19 #include "CLIENT.H"
       
    20 
       
    21 CWsObject::CWsObject(CWsClient* aOwner, WH_HANDLES aType)
       
    22 	: iType(aType), iWsOwner(aOwner)
       
    23 	{
       
    24 	__DECLARE_NAME(_S("CWsObject"));
       
    25 	}
       
    26 
       
    27 CWsObject::~CWsObject()
       
    28 	{
       
    29 	RemoveFromIndex();
       
    30 	}
       
    31 
       
    32 void CWsObject::CloseObject()
       
    33 	{
       
    34 	delete this;
       
    35 	}
       
    36 
       
    37 void CWsObject::RemoveFromIndex()
       
    38 	{
       
    39 	if (iWsOwner)
       
    40 		{
       
    41 		iWsOwner->ObjectIndex()->Remove(this);
       
    42 		iWsOwner=NULL;
       
    43 		}
       
    44 	}
       
    45 
       
    46 void CWsObject::NewObjL()
       
    47 	{
       
    48 	if (iWsOwner)
       
    49 		SetReply(iWsOwner->ObjectIndex()->AddL(this));
       
    50 	}
       
    51 
       
    52 TInt CWsObject::LogHandle() const
       
    53 	{
       
    54 	return(iWsOwner ? iWsOwner->ObjectHandle(this) : 0);
       
    55 	}
       
    56 
       
    57 void CWsObject::SetReply(TInt aReply)
       
    58 	{
       
    59 	iWsOwner->SetReply(aReply);
       
    60 	}
       
    61 
       
    62 void CWsObject::OwnerPanic(TClientPanic aPanic) const
       
    63 	{
       
    64 	if ( iWsOwner )
       
    65 		{
       
    66 		iWsOwner->PPanic(aPanic);
       
    67 		}
       
    68 	else
       
    69 		{
       
    70 		User::Leave(CWsClient::EPanicLeave);
       
    71 		}
       
    72 	}
       
    73