ImagePrint/ImagePrintEngine/ImagePrintServer/src/server/tmessagewrp2.cpp
branchGCC_SURGE
changeset 25 59ea2209bb67
parent 23 08cc4cc059d4
parent 15 a92d00fca574
equal deleted inserted replaced
23:08cc4cc059d4 25:59ea2209bb67
     1 /*
       
     2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32cmn.h>
       
    20 
       
    21 #include "tmessagewrp2.h"
       
    22 #include "clog.h"
       
    23 
       
    24 TMessageWrp2::TMessageWrp2( const RMessage2& aMessage, 
       
    25 							const TBool& aConnected ) :
       
    26 							iConnected( aConnected ),
       
    27 							iDisposable( EFalse )
       
    28 																		
       
    29     {
       
    30     iMessage = aMessage;
       
    31     }
       
    32 
       
    33 void TMessageWrp2::WriteL(TInt aParam, const TDesC8 &aDes, TInt aOffset) const
       
    34 	{
       
    35 	LOG("TMessageWrp2::WriteL begin");
       
    36 	LOG1("TMessageWrp2::WriteL iConnected: %d", iConnected);
       
    37 	if( !iMessage.IsNull() && iConnected )
       
    38 		{
       
    39 		LOG1("TMessageWrp2::WriteL iMessage.Function(): %d", iMessage.Function());
       
    40 		iMessage.WriteL( aParam, aDes, aOffset );	
       
    41 		}
       
    42 	LOG("TMessageWrp2::WriteL end");
       
    43 	}
       
    44 	
       
    45 void TMessageWrp2::Complete(TInt aReason) const
       
    46 	{
       
    47 	LOG("TMessageWrp2::Complete begin");
       
    48 	LOG1("TMessageWrp2::Complete iConnected: %d", iConnected);
       
    49 	if( !iMessage.IsNull() && iConnected ) 
       
    50 		{
       
    51 		LOG1("TMessageWrp2::Complete iMessage.Function(): %d", iMessage.Function());
       
    52 		iMessage.Complete( aReason );
       
    53 		}
       
    54 	LOG("TMessageWrp2::Complete end");
       
    55 	}
       
    56 	
       
    57 TInt TMessageWrp2::Int0() const
       
    58 	{
       
    59 	LOG("TMessageWrp2::Int0 begin");
       
    60 	LOG1("TMessageWrp2::Int0 iConnected: %d", iConnected);
       
    61 	TInt value( 0 );
       
    62 	if( !iMessage.IsNull() && iConnected )
       
    63 		{
       
    64 		LOG1("TMessageWrp2::Int0 iMessage.Function(): %d", iMessage.Function());
       
    65 		value = iMessage.Int0();
       
    66 		}	
       
    67 	LOG("TMessageWrp2::Int0 end");
       
    68 	return value;
       
    69 	}
       
    70 	
       
    71 TInt TMessageWrp2::Int1() const
       
    72 	{
       
    73 	LOG("TMessageWrp2::Int1 begin");
       
    74 	LOG1("TMessageWrp2::Int1 iConnected: %d", iConnected);
       
    75 	TInt value( 0 );
       
    76 	if( !iMessage.IsNull() && iConnected )
       
    77 		{
       
    78 		LOG1("TMessageWrp2::Int1 iMessage.Function(): %d", iMessage.Function());
       
    79 		value = iMessage.Int1();
       
    80 		}	
       
    81 	LOG("TMessageWrp2::Int1 end");
       
    82 	return value;
       
    83 	}
       
    84 	
       
    85 TInt TMessageWrp2::GetDesLength(TInt aParam) const
       
    86 	{
       
    87 	LOG("TMessageWrp2::GetDesLength begin");
       
    88 	LOG1("TMessageWrp2::GetDesLength iConnected: %d", iConnected);	
       
    89 	TInt value( 0 );
       
    90 	if( !iMessage.IsNull() && iConnected )
       
    91 		{
       
    92 		LOG1("TMessageWrp2::GetDesLength iMessage.Function(): %d", iMessage.Function());
       
    93 		value = iMessage.GetDesLength( aParam );
       
    94 		}	
       
    95 	LOG("TMessageWrp2::GetDesLength end");
       
    96 	return value;
       
    97 	}
       
    98 	
       
    99 void TMessageWrp2::ReadL(TInt aParam, TDes8 &aDes, TInt aOffset) const
       
   100 	{
       
   101 	LOG("TMessageWrp2::ReadL TDes8 begin");
       
   102 	LOG1("TMessageWrp2::ReadL TDes8 iConnected: %d", iConnected);
       
   103 	if( !iMessage.IsNull() && iConnected )
       
   104 		{
       
   105 		LOG1("TMessageWrp2::ReadL TDes8 iMessage.Function(): %d", iMessage.Function());
       
   106 		iMessage.ReadL( aParam, aDes, aOffset );
       
   107 		}
       
   108 	LOG("TMessageWrp2::ReadL TDes8 end");
       
   109 	}
       
   110 	
       
   111 void TMessageWrp2::ReadL(TInt aParam, TDes16 &aDes, TInt aOffset) const
       
   112 	{
       
   113 	LOG("TMessageWrp2::ReadL TDes16 begin");
       
   114 	LOG1("TMessageWrp2::ReadL TDes16 iConnected: %d", iConnected);
       
   115 	if( !iMessage.IsNull() && iConnected )
       
   116 		{
       
   117 		LOG1("TMessageWrp2::ReadL TDes16 iMessage.Function(): %d", iMessage.Function());
       
   118 		iMessage.ReadL( aParam, aDes, aOffset );
       
   119 		}
       
   120 	LOG("TMessageWrp2::ReadL TDes16 end");
       
   121 	}
       
   122 	
       
   123 TInt TMessageWrp2::Function() const
       
   124 	{
       
   125 	return iMessage.Function();
       
   126 	}
       
   127 	
       
   128 void TMessageWrp2::SetDisposable( TBool aDisposable )
       
   129 	{
       
   130 	iDisposable = aDisposable;
       
   131 	}
       
   132 	
       
   133 TBool TMessageWrp2::Disposable() const
       
   134 	{
       
   135 	return iDisposable;
       
   136 	}		
       
   137 	
       
   138 void TMessageWrp2::Panic(const TDesC &aCategory, TInt aReason) const
       
   139 	{
       
   140 	iMessage.Panic( aCategory, aReason );
       
   141 	}
       
   142 
       
   143 //  End of File