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