imservices/ossprotocoladaptation/inc/cossprotocolconnectionmanager.h
branchRCL_3
changeset 14 7797b2f86d2b
parent 13 b6f2a363adf7
child 16 cfe5eb8bb9ca
equal deleted inserted replaced
13:b6f2a363adf7 14:7797b2f86d2b
     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:  connection manager
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __COSSPROTOCOLCONNECTIONMANAGER_H__
       
    19 #define __COSSPROTOCOLCONNECTIONMANAGER_H__
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <flogger.h>
       
    24 #include <ximpstatus.h>
       
    25 #include "mossprotocolconnectionmanager.h"
       
    26 #include "waittimer.h"
       
    27 #include "cpresencenotificationhandler.h"
       
    28 #include "creceivemessagehandler.h"
       
    29 #include "cossprotocolservererrorhandler.h"
       
    30 #include "caddcontactenotificationhandler.h"
       
    31 #include "cosscontactmanager.h"
       
    32 #include "msg_enums.h"
       
    33 #include <ximperrors.hrh>
       
    34 #include "csearchkeystore.h"
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 
       
    38 class MXIMPServiceInfo;
       
    39 
       
    40 class MXIMPProtocolConnectionHost;
       
    41 
       
    42 class MOSSProtocolConnectionManager;
       
    43 
       
    44 class CXmppParameters;
       
    45 
       
    46 class CWaitTimer;
       
    47 class MProtocolImDataHost ;
       
    48 class MProtocolSearchDataHost;
       
    49 class CContactSyncHandler;
       
    50 
       
    51 _LIT(KColon,":");
       
    52 
       
    53 /**
       
    54  * COSSProtocolConnectionManager
       
    55  *
       
    56  * Every XIMPFW-OSS Connection has Connection Manager Object.
       
    57  *
       
    58  *
       
    59  */
       
    60 NONSHARABLE_CLASS ( COSSProtocolConnectionManager ) : public CBase,
       
    61 		public MOSSProtocolConnectionManager
       
    62 		// implement session status observer callback
       
    63 	{
       
    64 
       
    65 public:
       
    66 
       
    67 	static COSSProtocolConnectionManager* NewL();
       
    68 	virtual ~COSSProtocolConnectionManager();
       
    69 
       
    70 
       
    71 private:
       
    72 
       
    73 	COSSProtocolConnectionManager();
       
    74 	void ConstructL();
       
    75 
       
    76 
       
    77 public: // From MOSSProtocolConnectionManager
       
    78 	
       
    79     /**
       
    80 	 * @see MOSSProtocolConnectionManager
       
    81 	 */
       
    82 	CXmppParameters& XmppParams();
       
    83 	
       
    84 	/**
       
    85 	 * @see MOSSProtocolConnectionManager
       
    86 	 */
       
    87 	CWaitTimer& DataHandler();
       
    88 	
       
    89 	/**
       
    90 	 * @see MOSSProtocolConnectionManager
       
    91 	 */
       
    92 	MXIMPProtocolConnectionHost& HandleToHost();
       
    93 	
       
    94 	/**
       
    95 	 * @see MOSSProtocolConnectionManager
       
    96 	 */
       
    97 	void ManufactureDataHandlerL() ;
       
    98 	
       
    99 	/**
       
   100 	 * @see MOSSProtocolConnectionManager
       
   101 	 */
       
   102 	RArray< HBufC >* PresenceAuthGrantReqList();
       
   103 	
       
   104 public: // new methods
       
   105 
       
   106 	/**
       
   107      * set protocol connection host
       
   108      * @param aHost protocol connection host
       
   109      */
       
   110 	void SetHost ( MXIMPProtocolConnectionHost& aHost );
       
   111 
       
   112 	/**
       
   113      * set connection parameters
       
   114      * @param aUserName user account
       
   115      * @param aPassword password
       
   116      * @param aServiceId ,service id
       
   117      */
       
   118 	void SetConnectionParamsL ( const TDesC& aUserName,
       
   119 	                            const TDesC& aPassword,
       
   120 	                            const TInt32 aServiceId );
       
   121 
       
   122 	 /**
       
   123 	  * set connection parameters
       
   124 	  * @param aServiceId, service id
       
   125 	  * @param aReadNedded, EFalse if need not to red from xmpp settings
       
   126 	  * @return error if any
       
   127 	  */
       
   128 	TInt SetConnectionParamsL ( const TUint32 aServiceId, TBool aReadNeeded = ETrue );
       
   129 	
       
   130 	
       
   131 	/**
       
   132      * set protocol im data host
       
   133      * @param aHost protocol im data host
       
   134      */
       
   135 	void SetImHost(MProtocolImDataHost& aHost);
       
   136 	
       
   137 	/**
       
   138      * Get protocol im data host
       
   139      * @param aHost protocol im data host
       
   140      */
       
   141 	MProtocolImDataHost& GetImHost() ;
       
   142 	
       
   143 	/**
       
   144 	 * Get add notification handler
       
   145 	 * @param iAddnotificationhandler 
       
   146 	 */
       
   147 	CAddContactNotificationHandler& GetAddNotificationHandler();
       
   148 	/**
       
   149      * set protocol search data host
       
   150      * @param aHost protocol search data host
       
   151      */
       
   152 	void SetSearchHost(MProtocolSearchDataHost& aHost);
       
   153 	
       
   154 	/**
       
   155      * Get protocol search data host
       
   156      * @param aHost protocol search data host
       
   157      */
       
   158 	MProtocolSearchDataHost& GetSearchHost() ;
       
   159 	
       
   160 	/**
       
   161 	 * Release Connection
       
   162 	 *  send killing request to isoserver
       
   163 	 */
       
   164 	void ReleaseConnectionL();
       
   165 	
       
   166 
       
   167 	/**
       
   168 	 *  return ETrue if server disconnect has happen
       
   169 	 */
       
   170 	TBool IsServerDisconnect();
       
   171 	
       
   172 	/*!	/brief Gets a handle to search key store
       
   173 	 *	/return A handle to search key store
       
   174 	 */
       
   175 	CSearchKeyStore& GetSearchKeyStore();
       
   176 		    
       
   177 public:
       
   178 
       
   179     /**
       
   180 	 *  Get id
       
   181 	 *  @return id
       
   182 	 */
       
   183 	TInt32 IapId();
       
   184 	
       
   185 	/**
       
   186 	 *  Get username
       
   187 	 *  @return username
       
   188 	 */
       
   189 	TDesC& UserName();
       
   190 	
       
   191 	/**
       
   192 	 *  Get password
       
   193 	 *  @return password
       
   194 	 */
       
   195 	TDesC& Password();
       
   196 	
       
   197 	/**
       
   198 	 *  Get groupid
       
   199 	 *  @return groupid
       
   200 	 */
       
   201 	TDesC& GroupId();
       
   202 	/**
       
   203 	 *  Get service name
       
   204 	 *  @return servicename
       
   205 	 */
       
   206 	const TDesC& ServiceName();   	
       
   207 	/**
       
   208 	 *  Set group id
       
   209 	 *  @param group id
       
   210 	 */
       
   211 	void SetGroupIDL(TDesC& aGroupId);
       
   212 	
       
   213 	/**
       
   214 	 * gets the contactmanager
       
   215 	 * @return iContactManager
       
   216 	 */
       
   217 	COSSContactManager& GetContactManager();
       
   218 	
       
   219 	
       
   220 private: // data
       
   221     
       
   222     /**
       
   223 	 * Stores settings
       
   224 	 * Own
       
   225 	 */
       
   226 	CXmppParameters* iXmppParams;
       
   227 	
       
   228 	/**
       
   229 	 * REF: protocol connection host
       
   230 	 */
       
   231 	MXIMPProtocolConnectionHost* iHostHandle;
       
   232 	
       
   233 	/**
       
   234 	 * Server address:
       
   235 	 * Own
       
   236 	 */
       
   237 	HBufC* iServerAddress;
       
   238 	
       
   239 	/**
       
   240 	 * UserName:
       
   241 	 * Own
       
   242 	 */
       
   243 	HBufC* iUserName;
       
   244 	
       
   245 	/**
       
   246 	 * UserName:
       
   247 	 * Own
       
   248 	 */
       
   249 	HBufC* iPassword;
       
   250 	
       
   251 	/**
       
   252 	 * Group id:
       
   253 	 * Own
       
   254 	 */
       
   255 	HBufC* iGroupId;
       
   256 	
       
   257 	/**
       
   258 	 * wait scheduler:
       
   259 	 * Own
       
   260 	 */
       
   261 	CActiveSchedulerWait* iWaitScheduler;
       
   262 	
       
   263 	/**
       
   264 	 * wait timer:
       
   265 	 * Own
       
   266 	 */
       
   267 	CWaitTimer* iTimer;
       
   268 	
       
   269 	/**
       
   270 	 * Presence notifier:
       
   271 	 * Own
       
   272 	 */
       
   273 	CPresenceNotificationHandler* iNotifier;
       
   274 	
       
   275 	/**
       
   276 	 * Recieve message handler:
       
   277 	 * Own
       
   278 	 */
       
   279 	CReceiveMessageHandler* iRecvHandler;
       
   280 	
       
   281 	/**
       
   282 	 * Server intiated error hanlder:
       
   283 	 * Own
       
   284 	 */
       
   285 	COssprotocolServerErrorHandler* iServerErrorHandler;
       
   286 	
       
   287 	/**
       
   288 	 * Add notifications handler
       
   289 	 * Own
       
   290 	 */
       
   291 	CAddContactNotificationHandler* iAddNotificationHanlder;
       
   292 	
       
   293 	/**
       
   294 	 * Contact synchronisation handler:
       
   295 	 * Own
       
   296 	 */
       
   297 	CContactSyncHandler*    iContactSyncHandler;
       
   298 	
       
   299 	/**
       
   300 	 * stores data handler readyness value
       
   301 	 * Own
       
   302 	 */
       
   303 	TBool iIsDataHandlerReady; 
       
   304 	
       
   305 	/**
       
   306 	 * Search key store
       
   307 	 * Own
       
   308 	 */
       
   309 	CSearchKeyStore* iSearchKeyStore;
       
   310 	
       
   311 	/**
       
   312 	 * Protocol im data host
       
   313 	 * Doesn't own
       
   314 	 */
       
   315 	MProtocolImDataHost *iHost ; 
       
   316 	
       
   317 	/**
       
   318 	 * Protocl search data host
       
   319 	 * Doesn't own
       
   320 	 */
       
   321 	MProtocolSearchDataHost *iSearchHost ; 
       
   322 	
       
   323 	/**
       
   324 	 * local contact manager
       
   325 	 * own
       
   326 	 */
       
   327 	COSSContactManager* iContactManager;
       
   328 	/**
       
   329 	 * service name for presence cache updation
       
   330 	 * Own
       
   331 	 */
       
   332 	HBufC* iServiceName;	
       
   333 public:	
       
   334     /**
       
   335 	 * Presence authorisation grant list
       
   336 	 * Doesn't own
       
   337 	 */
       
   338 	RArray< HBufC > iPresenceAuthGrantReqList;
       
   339 	
       
   340 	
       
   341 	};
       
   342 
       
   343 
       
   344 #endif // __COSSPROTOCOLCONNECTIONMANAGER_H__