imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/creceivemessagehandler.cpp
changeset 0 5e5d6b214f4f
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  implementation of receive message handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <ximpprotocolconnectionhost.h>
       
    20 #include "creceivemessagehandler.h"
       
    21 #include "mossprotocolconnectionmanager.h"
       
    22 
       
    23 #include "cossprotocolconnectionmanager.h"
       
    24 #include <ximpobjectfactory.h>
       
    25 #include <ximpobjectcollection.h>
       
    26 #include <protocolpresentitygroupsdatahost.h>
       
    27 #include <presentitygroupinfo.h>
       
    28 #include <presentitygroupmemberinfo.h>
       
    29 #include <ximpidentity.h>
       
    30 #include <protocolpresencepublishingdatahost.h>
       
    31 #include <protocolpresencedatahost.h>
       
    32 #include <presenceobjectfactory.h>
       
    33 #include <presencegrantrequestinfo.h>
       
    34 #include <personpresenceinfo.h>
       
    35 #include <servicepresenceinfo.h>
       
    36 #include <devicepresenceinfo.h>
       
    37 #include <presenceinfo.h>
       
    38 #include <presenceinfofield.h>
       
    39 #include <presenceinfofieldcollection.h>
       
    40 #include <presenceinfofieldvalueenum.h>
       
    41 #include <presenceinfofieldvaluetext.h>
       
    42 #include <ximpcontext.h>
       
    43 #include <ximpclient.h>
       
    44 #include <devicepresenceinfo.h>
       
    45 #include <protocolpresencewatchingdatahost.h>
       
    46 #include <presencegrantrequestinfo.h>
       
    47 #include <protocolpresenceauthorizationdatahost.h>
       
    48 #include <e32des16.h>
       
    49 #include <imconversationinfo.h>
       
    50 #include <imobjectfactory.h>
       
    51 #include <protocolimdatahost.h>
       
    52 #include <protocolimconversationdatahost.h>
       
    53 
       
    54 // ======== MEMBER FUNCTIONS ========
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // CReceiveMessageHandler::CReceiveMessageHandler
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 CReceiveMessageHandler::CReceiveMessageHandler (
       
    61     MOSSProtocolConnectionManager& aConnMan ) :
       
    62 
       
    63 		CActive ( EPriorityNormal ),
       
    64 		iConnMan ( aConnMan )
       
    65 	{
       
    66 	//LOGGER ( TXT ( "::CReceiveMessageHandler Start" ) );
       
    67 	CActiveScheduler::Add ( this );
       
    68 
       
    69 	//LOGGER ( TXT ( "::CReceiveMessageHandler End" ) );
       
    70 	}
       
    71 
       
    72 
       
    73 // ---------------------------------------------------------------------------
       
    74 // CReceiveMessageHandler::ConstructL
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 void CReceiveMessageHandler::ConstructL()
       
    78 	{
       
    79 	//LOGGER ( TXT ( "CReceiveMessageHandler::ConstructL Start-End" ) );
       
    80 
       
    81 
       
    82 	}
       
    83 
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // CReceiveMessageHandler::NewL
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 CReceiveMessageHandler* CReceiveMessageHandler::NewL (
       
    90     MOSSProtocolConnectionManager& aConnMan )
       
    91 	{
       
    92 	//LOGGER ( TXT ( "CReceiveMessageHandler::NewL Start" ) );
       
    93 
       
    94 	CReceiveMessageHandler* self = new ( ELeave )
       
    95 	CReceiveMessageHandler ( aConnMan );
       
    96 	CleanupStack::PushL ( self );
       
    97 	self->ConstructL();
       
    98 	CleanupStack::Pop ( self );
       
    99 
       
   100 	//LOGGER ( TXT ( "CReceiveMessageHandler::NewL End" ) );
       
   101 	return self;
       
   102 	}
       
   103 
       
   104 
       
   105 
       
   106 // ---------------------------------------------------------------------------
       
   107 // CReceiveMessageHandler::~CReceiveMessageHandler
       
   108 // ---------------------------------------------------------------------------
       
   109 //
       
   110 CReceiveMessageHandler::~CReceiveMessageHandler()
       
   111 	{
       
   112 	//LOGGER ( TXT ( "::~CReceiveMessageHandler Start" ) );
       
   113 
       
   114 	Cancel();
       
   115 
       
   116 	//LOGGER ( TXT ( "::~CReceiveMessageHandler End" ) );
       
   117 	}
       
   118 
       
   119 
       
   120 // ---------------------------------------------------------------------------
       
   121 // CReceiveMessageHandler::DoCancel()
       
   122 // ---------------------------------------------------------------------------
       
   123 //
       
   124 void CReceiveMessageHandler::DoCancel()
       
   125 	{
       
   126 	//LOGGER ( TXT ( "CReceiveMessageHandler::DoCancel Start" ) );
       
   127 
       
   128 //	iConnMan.DataHandler().CancelListeningMsg();
       
   129 
       
   130 	//LOGGER ( TXT ( "CReceiveMessageHandler::DoCancel End" ) );
       
   131 	}
       
   132 
       
   133 // ---------------------------------------------------------------------------
       
   134 // CReceiveMessageHandler::RunL()
       
   135 // ---------------------------------------------------------------------------
       
   136 //
       
   137 void CReceiveMessageHandler::RunL()
       
   138 	{
       
   139 	//LOGGER ( TXT ( "CReceiveMessageHandler::RunL Start" ) );
       
   140 
       
   141 	// something is coming from the xmpp server
       
   142 	User::LeaveIfError ( iStatus.Int() );
       
   143 	
       
   144 	TRAPD( error, ProcessIncomingDataL() );
       
   145     if ( error != KErrNone )
       
   146     {
       
   147     	Cancel();
       
   148     }
       
   149    
       
   150     // start listening again for next incoming message
       
   151 	StartListeningL();
       
   152 
       
   153 	//LOGGER ( TXT ( "CReceiveMessageHandler::RunL End" ) );
       
   154 	}
       
   155 
       
   156 // ---------------------------------------------------------------------------
       
   157 // CReceiveMessageHandler::ProcessIncomingDataL()
       
   158 // ---------------------------------------------------------------------------
       
   159 //
       
   160 void CReceiveMessageHandler::ProcessIncomingDataL()
       
   161 	{
       
   162 	//LOGGER ( TXT ( "CReceiveMessageHandler::ProcessIncomingDataL Start" ) );
       
   163 	//LOGGER ( TXT ( "CReceiveMessageHandler::ProcessIncomingDataL End" ) );
       
   164 	}
       
   165 
       
   166 
       
   167 // ---------------------------------------------------------------------------
       
   168 // CReceiveMessageHandler::RunError
       
   169 // ---------------------------------------------------------------------------
       
   170 //
       
   171 TInt CReceiveMessageHandler::RunError ( TInt  aError )
       
   172 	{
       
   173 	//LOGGER ( TXT ( "CReceiveMessageHandler::RunError Start %d" ), aError );
       
   174 
       
   175 	//LOGGER ( TXT ( "CReceiveMessageHandler::RunError End" ) );
       
   176 	return KErrNone;
       
   177 	}
       
   178 
       
   179 // ---------------------------------------------------------------------------
       
   180 // CReceiveMessageHandler::StartListeningL
       
   181 // ---------------------------------------------------------------------------
       
   182 //
       
   183 void CReceiveMessageHandler::StartListeningL()
       
   184 	{
       
   185 	//LOGGER ( TXT ( "CReceiveMessageHandler::StartListeningL Start" ) );
       
   186 
       
   187 	// Ready to receive notification from the server
       
   188 
       
   189 	// signal the scheduler
       
   190 
       
   191 
       
   192 	//LOGGER ( TXT ( "CReceiveMessageHandler::StartListeningL End" ) );
       
   193 	}
       
   194 
       
   195 
       
   196 
       
   197 // End of file