rcsimengine/inc/chatcontactmanagerimpl_sym.h
changeset 0 59dfe4ae66d0
equal deleted inserted replaced
-1:000000000000 0:59dfe4ae66d0
       
     1 /*
       
     2 * Copyright (c) 2009-2010 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 * Initial Contributors:
       
     9 * Nokia Corporation - initial contribution.
       
    10 * Contributors:
       
    11 *
       
    12 * Description:
       
    13 * RCS IM Library - Initial version
       
    14 *
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef __CHATCONTACT_MANAGER_IMPL_SYM_H__
       
    19 #define __CHATCONTACT_MANAGER_IMPL_SYM_H__
       
    20 
       
    21 
       
    22 #include <QObject>
       
    23 #include <QList>
       
    24 #include "chatinterfaces.h"
       
    25 #include "qmobilityglobal.h"
       
    26 #include "qcontactfilter.h"
       
    27 #include "qcontactdetailfilter.h"
       
    28 #include "qtcontactsglobal.h"
       
    29 
       
    30 
       
    31 //SIP and MCE Specific Headers
       
    32 #include <e32base.h>
       
    33 #include <e32std.h>
       
    34 #include <e32math.h>
       
    35 #include <s32mem.h>
       
    36 #include <in_sock.h>
       
    37 #include <badesca.h>
       
    38 #include <e32cmn.h>
       
    39 #include <mcesessionobserver.h>
       
    40 #include <mcemanager.h>
       
    41 #include <mcetransactiondatacontainer.h>
       
    42 #include <mcemessagestream.h>
       
    43 #include <mceexternalsource.h>
       
    44 #include <mceexternalsink.h>
       
    45 #include <mcemessagesink.h>
       
    46 #include <mcemessagesource.h>
       
    47 #include <mcemsrpsource.h>
       
    48 #include <mcemsrpsink.h>
       
    49 #include <mceoutsession.h>
       
    50 #include <mceinsessionobserver.h>
       
    51 #include <mceinsession.h>
       
    52 #include <mceDataSinkObserver.h>
       
    53 #include <qcontactmanager.h>
       
    54 
       
    55 
       
    56 //Profile agent, SIP stack inclusions
       
    57 #include <sipprofileregistryobserver.h>
       
    58 #include <sipprofile.h>
       
    59 #include <sip.h>
       
    60 #include <sipobserver.h>
       
    61 
       
    62 //#include "rcschatengine_globals.h"
       
    63 
       
    64 class TMsrpChatSession;
       
    65 class CContactItem;
       
    66 class ChatContactManager;
       
    67 class ContactView;
       
    68 
       
    69 
       
    70 
       
    71 QTM_BEGIN_NAMESPACE
       
    72 class QContact;
       
    73 class QContactDetailFilterPrivate;
       
    74 QTM_END_NAMESPACE
       
    75 
       
    76 QTM_USE_NAMESPACE 
       
    77 
       
    78 const TInt KGranularity = 12;
       
    79 const TInt KAcceptSize = 24;
       
    80 /* Interface implementation of MChatContactIntf */
       
    81 class ChatContactManagerImpl:   public QObject,
       
    82                                 public MMceSessionObserver, 
       
    83                                 public MSIPProfileRegistryObserver,  // for CSIPProfileRegistry
       
    84                                 public MSIPObserver, // for CSIP
       
    85                                 public MMceInSessionObserver, // for incoming sessions from MCE
       
    86                                 public MMceDataSinkObserver
       
    87                       
       
    88 {
       
    89  public:
       
    90 	ChatContactManagerImpl(ChatContactManager *apCntManager);
       
    91 	~ChatContactManagerImpl();
       
    92 	
       
    93 	
       
    94 		
       
    95 	/* Setup MCE Manager */		
       
    96 	RcsIMLib::RcsChatId createChatSession(QContactLocalId contactId, QString initMsg);	
       
    97 	void closeSession(RcsIMLib::RcsChatId sessID);
       
    98 	void acceptIncomingSession(RcsIMLib::RcsChatId sessID);
       
    99 	
       
   100 	
       
   101 	// From MMceSessionObserver
       
   102 	void SessionStateChanged(CMceSession& aSession, TMceTransactionDataContainer* aContainer);
       
   103 	void SessionConnectionStateChanged(CMceSession& aSession, TBool aActive );
       
   104 	void Failed( CMceSession& aSession, TInt aError );
       
   105     void UpdateFailed(CMceSession& aSession, TMceTransactionDataContainer* aContainer );
       
   106     
       
   107 	// From MSIPProfileAgentObserver
       
   108     void ProfileRegistryEventOccurred(TUint32 aProfileId, TEvent aEvent);
       
   109 	void ProfileRegistryErrorOccurred(TUint32 aProfileId, TInt aError);
       
   110 	        
       
   111 	// From MSIPObserver
       
   112     void IncomingRequest(TUint32 aIapId, CSIPServerTransaction* aTransaction);
       
   113     void TimedOut(CSIPServerTransaction& aTransaction); 
       
   114 
       
   115     // From MMceInSessionObserver
       
   116     void IncomingSession(CMceInSession* aSession, TMceTransactionDataContainer* aContainer );
       
   117 	void IncomingUpdate(CMceSession& aOrigSession, CMceInSession* aUpdatedSession, TMceTransactionDataContainer* aContainer );	        
       
   118 	void DataReceived(CMceMediaStream& aStream,CMceMediaSink& aSink, const TDesC8& aData);
       
   119 
       
   120  private:
       
   121      void setupMceManagerL();
       
   122      RcsIMLib::RcsChatId createChatSessionL(QContactLocalId contactId, QString initMsg);
       
   123      void GetStreams(CMceSession& aSession, CMceMessageStream*& aUplinkStr, CMceMessageStream*& aDownlinkStr );
       
   124 	
       
   125  private:     
       
   126 	//Variables here
       
   127 	QContactManager                    *mManager;
       
   128 	ChatContactManager                 *mParent;    
       
   129 	//SYM Specific Headers
       
   130 	CMceManager                        *mMceMgr;
       
   131 	CSIP                               *mSip;
       
   132 	CSIPProfileRegistry                *mProfileReg;
       
   133 	CSIPProfile                        *mProfile;
       
   134 	RPointerArray<CMceSession>         mMceSessions;
       
   135 	RPointerArray<TMsrpChatSession>    mChatSessionArray;
       
   136 	TMceTransactionDataContainer       mDataContainer;
       
   137 	RPointerArray<CSIPProfile>         mAllprofiles;
       
   138 	//QList<QContact>                    mAllContacts;
       
   139 	//QList<QContact>                    mAllSIPContacts;
       
   140 	//QContactLocalId                    mMyID;
       
   141 	//QContactLocalId                    mMyBuddyID;
       
   142 	//QString                            mMyFirstName;
       
   143 	//QContactDetailFilter               mFilter;
       
   144 	HBufC8                             *mOriginatorUri;
       
   145 	
       
   146 
       
   147 };
       
   148 #endif //__CHATCONTACT_MANAGER_IMPL_SYM_H__