uiservicetab/vimpstengine/src/cvimpstenginesearchmgrextention.cpp
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     1 /*
       
     2 * Copyright (c) 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: Search manager extension for CVIMPSTEngine
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "cvimpstenginesearchmgrextention.h"
       
    20 
       
    21 #include <ximpcontext.h>
       
    22 #include <ximpcontextobserver.h>
       
    23 #include <presenceobjectfactory.h>
       
    24 #include <ximpidentity.h>
       
    25 #include <ximpobjectfactory.h>
       
    26 #include <ximprequestcompleteevent.h>
       
    27 #include <ximpstatus.h>
       
    28 
       
    29 
       
    30 #include "cvimpstenginerequestmapper.h"
       
    31 #include "cvimpstenginerequest.h"
       
    32 
       
    33 #include "vimpstallerrors.h"
       
    34 #include "tvimpstconsts.h"
       
    35 
       
    36 #include <search.h>
       
    37 #include <searchfeature.h>
       
    38 #include <searchobjectfactory.h>
       
    39 #include <searchelement.h>
       
    40 #include <searchkeysevent.h>
       
    41 #include <searchkeyinfo.h>
       
    42 #include <searchinfo.h>
       
    43 #include <searchevent.h>
       
    44 
       
    45 #include "mvimpstenginesearchextentioneventobserver.h"
       
    46 #include "uiservicetabtracer.h"
       
    47 
       
    48 
       
    49 
       
    50 // ================= MEMBER FUNCTIONS =======================
       
    51 // ---------------------------------------------------------
       
    52 // CVIMPSTEngineSearchMgrExtention::NewL
       
    53 // Two-phased constructor.
       
    54 // ---------------------------------------------------------
       
    55 CVIMPSTEngineSearchMgrExtention* CVIMPSTEngineSearchMgrExtention::NewL(	
       
    56 							MXIMPContext& aPresenceCtx,						
       
    57 							CVIMPSTEngineRequestMapper& aRequestMapper)
       
    58     {
       
    59 	TRACER_AUTO;
       
    60     CVIMPSTEngineSearchMgrExtention* self = 
       
    61     			CVIMPSTEngineSearchMgrExtention::NewLC(
       
    62     											aPresenceCtx, 
       
    63     											aRequestMapper
       
    64     										    );
       
    65     CleanupStack::Pop( self );
       
    66     return self;
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------
       
    70 // CVIMPSTEngineSearchMgrExtention::NewLC
       
    71 // Two-phased constructor.
       
    72 // ---------------------------------------------------------
       
    73 CVIMPSTEngineSearchMgrExtention* CVIMPSTEngineSearchMgrExtention::NewLC(
       
    74 							MXIMPContext& aPresenceCtx,
       
    75 							CVIMPSTEngineRequestMapper& aRequestMapper)
       
    76 	{
       
    77 	TRACER_AUTO;
       
    78 	CVIMPSTEngineSearchMgrExtention* self = new (ELeave) 
       
    79 					CVIMPSTEngineSearchMgrExtention(aPresenceCtx, aRequestMapper);
       
    80 	CleanupStack::PushL( self );
       
    81 	self->ConstructL();
       
    82 	return self;
       
    83 	}
       
    84     
       
    85 // ---------------------------------------------------------
       
    86 // CVIMPSTEngineSearchMgrExtention::ConstructL
       
    87 // ---------------------------------------------------------
       
    88 void CVIMPSTEngineSearchMgrExtention::ConstructL()
       
    89 	{
       
    90 	TRACER_AUTO;
       
    91 
       
    92 	// ximp search plugin
       
    93     iSearchFeature = MSearchFeature::NewL(&iPresenceCtx); 
       
    94     
       
    95 	iSearch = &iSearchFeature->Search();
       
    96 	
       
    97 	iAlreadySubscibed = EFalse;
       
    98 	
       
    99 		
       
   100     }
       
   101 	
       
   102 // ---------------------------------------------------------
       
   103 // CVIMPSTEngineSearchMgrExtention::CVIMPSTEngineSearchMgrExtention
       
   104 // ---------------------------------------------------------	
       
   105 CVIMPSTEngineSearchMgrExtention::CVIMPSTEngineSearchMgrExtention( MXIMPContext& aPresenceCtx,											
       
   106 											CVIMPSTEngineRequestMapper& aRequestMapper)
       
   107 	:iPresenceCtx(aPresenceCtx),
       
   108 	iRequestMapper(aRequestMapper),
       
   109 	iSearchSupported(TVIMPSTEnums::ESupportUnKnown)
       
   110 	{
       
   111 		
       
   112 	}
       
   113 
       
   114 // ---------------------------------------------------------
       
   115 // CVIMPSTEngineSearchMgrExtention::~CVIMPSTEngineSearchMgrExtention
       
   116 // ---------------------------------------------------------
       
   117 CVIMPSTEngineSearchMgrExtention::~CVIMPSTEngineSearchMgrExtention()
       
   118     {
       
   119 	TRACER_AUTO;
       
   120     
       
   121 	iSearchObservers.Reset();
       
   122 	delete iSearchFeature;	
       
   123 	iSearchFeature = NULL;
       
   124     
       
   125     }
       
   126 
       
   127 
       
   128 // ---------------------------------------------------------
       
   129 // CVIMPSTEngineSearchMgrExtention::SearchContactsL
       
   130 // ---------------------------------------------------------
       
   131 TInt CVIMPSTEngineSearchMgrExtention::SearchContactsL( RArray<TVIMPSTSearchKeyData>& aKeyDataArray )
       
   132 	{
       
   133 	TRACER_AUTO;
       
   134 	
       
   135 	TInt err = KErrNotSupported;
       
   136 	if (iSearchSupported == TVIMPSTEnums::ESupported)
       
   137 		{
       
   138 			
       
   139 		TInt keydataCount = aKeyDataArray.Count();
       
   140 		
       
   141 		MXIMPObjectFactory& objFactory = iPresenceCtx.ObjectFactory();
       
   142 		MSearchObjectFactory& searchObjFact= iSearchFeature->SearchObjectFactory();
       
   143 		
       
   144 		MXIMPIdentity* searchId = objFactory.NewIdentityLC();
       
   145 		searchId->SetIdentityL(_L("SEARCH"));
       
   146 		
       
   147 		RPointerArray< MSearchElement > searchList;
       
   148 		CleanupClosePushL( searchList );
       
   149 		
       
   150 		for( TInt i = 0; i<keydataCount; i++  )
       
   151 			{
       
   152 			MXIMPIdentity* searchKeyId = objFactory.NewIdentityLC();
       
   153 			TVIMPSTSearchKeyData data = (aKeyDataArray)[i];
       
   154 			searchKeyId->SetIdentityL( data.iSearchKeyData );	
       
   155 			
       
   156 			MSearchElement* srchElement = searchObjFact.NewSearchElementLC();
       
   157 			if( data.iSearchKey != TVIMPSTEnums::EVIMPSTSearchKeyUknown )
       
   158 				{
       
   159 				srchElement->SetRequestL( *searchKeyId, ConverttoTSearchKey( data.iSearchKey ) );	
       
   160 				}
       
   161 	    	else
       
   162 		    	{
       
   163 		    	MXIMPIdentity* searchLabel = objFactory.NewIdentityLC();	
       
   164 		    	searchLabel->SetIdentityL( data.iSearchLabel );
       
   165 		    	srchElement->SetRequestL( *searchKeyId, *searchLabel );
       
   166 		    	CleanupStack::PopAndDestroy ();//searchLabel
       
   167 		    	}
       
   168 			searchList.Append(srchElement);
       
   169 			
       
   170 			CleanupStack::Pop();//srchElement
       
   171 			CleanupStack::PopAndDestroy();//searchKeyId
       
   172 				
       
   173 			}
       
   174 		
       
   175 		
       
   176 		TXIMPRequestId reqId = iSearch->SearchL(*searchId,searchList,KMaxSearchLimit );
       
   177 		
       
   178 		iRequestMapper.CreateRequestL(reqId, ETrue,EVIMPSTXimpOperationSearchContact);// waite here
       
   179 		
       
   180 		CleanupStack::Pop()	; // searchList
       
   181 		searchList.ResetAndDestroy();//	searchList
       
   182 		CleanupStack::PopAndDestroy ();//searchId 
       
   183 		
       
   184 		err = iReqResult;
       
   185 		}
       
   186 
       
   187 	return err;
       
   188 	}
       
   189 	
       
   190 
       
   191 // -----------------------------------------------------------------------------
       
   192 // CVIMPSTEngineSearchMgrExtention::SubscribeForSearchKeysL()
       
   193 // -----------------------------------------------------------------------------
       
   194 //
       
   195 TInt CVIMPSTEngineSearchMgrExtention::SubscribeForSearchKeysL()
       
   196 	{
       
   197 	TRACER_AUTO;
       
   198 	TRACE( "iSearchSupported: %d" , iSearchSupported );
       
   199 	TRACE( "iAlreadySubscibed: %d" , iAlreadySubscibed );
       
   200 		
       
   201 	if ( (iSearchSupported == TVIMPSTEnums::ENotSupported) || iAlreadySubscibed )
       
   202 		{
       
   203 	   TRACE("inside if " );    
       
   204 		return KErrNone;	
       
   205 		}
       
   206 
       
   207 	if( iSearch )
       
   208 		{
       
   209 	TRACE("inside if(iSearch) " ); 
       
   210 
       
   211 		iAlreadySubscibed = ETrue;
       
   212 		
       
   213 		TXIMPRequestId reqId = iSearch->GetSearchKeysL();			
       
   214 		TRACE( "iSearch->GetSearchKeysL() " );
       
   215 
       
   216 		iRequestMapper.CreateRequestL(reqId, ETrue ,EVIMPSTXimpOperationSubscribeSearchKeys);// waite here
       
   217 		}
       
   218 	
       
   219 	if( ( iReqResult != KPREQUESTERRSUCCESSFUL ) && ( iReqResult != KErrNone ) )
       
   220 		{
       
   221 		iSearchSupported = TVIMPSTEnums::ENotSupported;
       
   222 		}
       
   223 	else
       
   224 	    {
       
   225 	    iSearchSupported = TVIMPSTEnums::ESupported;
       
   226 	    }
       
   227 
       
   228 	return iReqResult;;
       
   229 	}	
       
   230 
       
   231 // -----------------------------------------------------------------------------
       
   232 // CVIMPSTEngineSearchMgrExtention::IsSupported()
       
   233 // -----------------------------------------------------------------------------
       
   234 //
       
   235 TVIMPSTEnums::FeatureSupport CVIMPSTEngineSearchMgrExtention::IsSupported() const 
       
   236 	{
       
   237 	return iSearchSupported;
       
   238 	}
       
   239 
       
   240 // ------------------------------------------------------------------------
       
   241 // CVIMPSTEngineSearchMgrExtention::ConverttoTSearchKey
       
   242 // 
       
   243 // ------------------------------------------------------------------------
       
   244 TSearchKey CVIMPSTEngineSearchMgrExtention::ConverttoTSearchKey(TVIMPSTEnums::TVIMPSTSearchKey aKey)
       
   245     {
       
   246 	TRACER_AUTO;
       
   247     
       
   248     TSearchKey ret = EUserFirstName;
       
   249      switch( aKey )
       
   250 		{
       
   251 		case TVIMPSTEnums::EVIMPSTFirstName :
       
   252 			{
       
   253 			ret = EUserFirstName;	        		
       
   254 			break;		
       
   255 			}
       
   256 		case TVIMPSTEnums::EVIMPSTMiddleName :
       
   257 			{
       
   258 			ret = EUserMiddleName ;	        		
       
   259 			break;		
       
   260 			}
       
   261 		case TVIMPSTEnums::EVIMPSTLastName :
       
   262 			{
       
   263 			ret = EUserLastName;	        		
       
   264 			break;		
       
   265 			}
       
   266 		case TVIMPSTEnums::EVIMPSTFullName :
       
   267 			{
       
   268 			ret = EUserFullName;	        		
       
   269 			break;		
       
   270 			}
       
   271 		case TVIMPSTEnums::EVIMPSTCountry :
       
   272 			{
       
   273 			ret = EUserCountry;	        		
       
   274 			break;		
       
   275 			}
       
   276 		case TVIMPSTEnums::EVIMPSTCity :
       
   277 			{
       
   278 			ret = EUserCity;	        		
       
   279 			break;		
       
   280 			}
       
   281 		case TVIMPSTEnums::EVIMPSTEmailAddress :
       
   282 			{
       
   283 			ret = EUserEmailAddress;	        		
       
   284 			break;		
       
   285 			}
       
   286 		case TVIMPSTEnums::EVIMPSTUser :
       
   287 			{
       
   288 			ret = EUser;	        		
       
   289 			break;		
       
   290 			}
       
   291 		case TVIMPSTEnums::EVIMPSTOrganisation :
       
   292 			{
       
   293 			ret = EOrganisation;	        		
       
   294 			break;		
       
   295 			}
       
   296 			
       
   297 		case  TVIMPSTEnums::EVIMPSTNickName  :
       
   298 			{
       
   299 		    ret =  EUserNickName; 		
       
   300 			break;		
       
   301 			}
       
   302 		case TVIMPSTEnums::EVIMPSTState  :
       
   303 			{
       
   304 			ret =  EState; 	 	        		
       
   305 			break;		
       
   306 			}
       
   307 		case  TVIMPSTEnums::EVIMPSTOrganisationUnit  :
       
   308 			{
       
   309 		    ret = EOrganisationUnit;    		
       
   310 			break;		
       
   311 			}
       
   312 		case TVIMPSTEnums::EVIMPSTBirthday :
       
   313 			{
       
   314 		    ret = EBirthday;     		
       
   315 			break;		
       
   316 			}
       
   317 			
       
   318 		default:
       
   319 			{
       
   320 			ret = EUserFirstName ;	
       
   321 			}
       
   322 
       
   323 		} 
       
   324 	
       
   325 	return ret; 
       
   326     }       	
       
   327 
       
   328 
       
   329 // -----------------------------------------------------------------------------
       
   330 // CVIMPSTEngineSearchMgrExtention::Type()
       
   331 // -----------------------------------------------------------------------------
       
   332 //
       
   333 TVIMPSTEnums::ExtentionType CVIMPSTEngineSearchMgrExtention::Type() const
       
   334 	{
       
   335 	return TVIMPSTEnums::ESearch;
       
   336 	}
       
   337 	
       
   338 
       
   339 // ---------------------------------------------------------
       
   340 // CVIMPSTEngineSearchMgrExtention::RegisterObserver
       
   341 // 
       
   342 // ---------------------------------------------------------
       
   343 void CVIMPSTEngineSearchMgrExtention::RegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver) 
       
   344 	{
       
   345 	TRACER_AUTO;
       
   346 	
       
   347 	TInt index = iSearchObservers.Find(aObserver);
       
   348 	if( index == KErrNotFound )
       
   349 		{
       
   350 		iSearchObservers.Append( aObserver );	
       
   351 		}
       
   352 
       
   353     }
       
   354 	
       
   355 // ---------------------------------------------------------
       
   356 // CVIMPSTEngineSearchMgrExtention::UnRegisterObserver
       
   357 // 
       
   358 // ---------------------------------------------------------
       
   359 void  CVIMPSTEngineSearchMgrExtention::UnRegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver) 
       
   360 	{
       
   361 	TRACER_AUTO;
       
   362 	
       
   363 	TInt index = iSearchObservers.Find(aObserver);
       
   364 	
       
   365 	if( index >=0 )
       
   366 		{
       
   367 		iSearchObservers.Remove( index );
       
   368 		iSearchObservers.Compress();
       
   369 		}
       
   370 		
       
   371     }
       
   372     
       
   373 
       
   374 
       
   375 // ---------------------------------------------------------
       
   376 // CVIMPSTEngineSearchMgrExtention::HandleSessionContextEventL
       
   377 // ---------------------------------------------------------
       
   378 void CVIMPSTEngineSearchMgrExtention::HandleSessionContextEventL(const MXIMPContext& /*aContext*/,
       
   379                                                              const MXIMPBase& aEvent,
       
   380                                                              TXimpOperation aXimpOperation/* = EVIMPSTXimpOperationNoOperation*/ )
       
   381     {
       
   382 	TRACER_AUTO;
       
   383     
       
   384     switch( aEvent.GetInterfaceId() )
       
   385         {
       
   386         
       
   387         case MXIMPRequestCompleteEvent::KInterfaceId:
       
   388         	{
       
   389         	TRACE("InsideCallbackswitch::MXIMPRequestCompleteEvent");
       
   390             if ( (EVIMPSTXimpOperationSearchContact == aXimpOperation) 
       
   391              		|| (EVIMPSTXimpOperationSubscribeSearchKeys == aXimpOperation) )
       
   392 	            {            
       
   393 	            const MXIMPRequestCompleteEvent* event =
       
   394 	                TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( 
       
   395 	                    aEvent, MXIMPBase::EPanicIfUnknown );
       
   396 	            
       
   397 	            iReqResult = event->CompletionResult().ResultCode();
       
   398 	            const TXIMPRequestId& reqId = event->RequestId();
       
   399 	            // Note:FindRequestId does not pass the ownership. hanece req
       
   400 	            // should not be deleted.
       
   401 	            CVIMPSTEngineRequest *req = iRequestMapper.FindRequestId( reqId );                
       
   402 	            
       
   403 	            if ( req )
       
   404 	                {
       
   405 		            req->StopWait() ;   
       
   406 	                iRequestMapper.RemoveRequestId(reqId);
       
   407 	                }
       
   408 	            }
       
   409             break;
       
   410             }
       
   411         
       
   412         case MSearchEvent::KInterfaceId:
       
   413 			{
       
   414 			const MSearchEvent* srchEvent = 
       
   415 			TXIMPGetInterface< const MSearchEvent >::From
       
   416 									(aEvent, MXIMPBase::EPanicIfUnknown);	
       
   417 			TInt count=	srchEvent->SearchResultCount();
       
   418 			const MXIMPIdentity& identity=	srchEvent->SearchId();
       
   419 			TPtrC id=srchEvent->SearchId().Identity();
       
   420 			RArray<TVIMPSTSearchData> resultsArray;
       
   421 			for(TInt i=0;i<count;++i)
       
   422 				{
       
   423 				const MSearchInfo& info=srchEvent->SearchResult(i);
       
   424 				
       
   425 				TVIMPSTSearchData data = 
       
   426 								{
       
   427 								info.GetFieldInfo(EFirstName),
       
   428 								info.GetFieldInfo(ELastName),
       
   429 								info.GetFieldInfo(EEmailAddress)	
       
   430 								};
       
   431 				TRAP_IGNORE( resultsArray.AppendL( data ) );
       
   432 				}
       
   433 	
       
   434 			//should be done in reuqest complete event for search with erro handling
       
   435 			//also first request complete will be received and then search result event
       
   436 			
       
   437 			for(TInt i=0; i< iSearchObservers.Count(); i++  )
       
   438 				    {
       
   439 				    TRAP_IGNORE( iSearchObservers[i]->HandleSearchResultL(resultsArray) );
       
   440 				   	TRAP_IGNORE( iSearchObservers[i]->HandleSearchFinishedL( KErrNone ) );
       
   441 				    }
       
   442 			
       
   443 			resultsArray.Close();	// close the array
       
   444 			break;
       
   445 			}
       
   446 		case MSearchKeysEvent::KInterfaceId:
       
   447             {
       
   448             const MSearchKeysEvent* searchEvent =
       
   449             TXIMPGetInterface< const MSearchKeysEvent >::From ( aEvent,
       
   450                 MXIMPBase::EPanicIfUnknown );
       
   451             TRAP_IGNORE( ProcessSearchKeysEventL( searchEvent ) );
       
   452             break;
       
   453             }
       
   454         default:
       
   455             {
       
   456             break;
       
   457             }
       
   458         }
       
   459     }    
       
   460 
       
   461 
       
   462 // ---------------------------------------------------------
       
   463 // CVIMPSTEngineSearchMgrExtention::ProcessSearchKeysEventL
       
   464 // 
       
   465 // ---------------------------------------------------------
       
   466 void CVIMPSTEngineSearchMgrExtention::ProcessSearchKeysEventL(const MSearchKeysEvent* aSearchKeysEvent)
       
   467     {
       
   468 	TRACER_AUTO;
       
   469     
       
   470     TInt searchKeysCount = aSearchKeysEvent->InfoCount();
       
   471     
       
   472     RArray<TInt> enumKeyArray;
       
   473     RPointerArray<HBufC> labelKeyArray;
       
   474     
       
   475     CleanupClosePushL( enumKeyArray );
       
   476     CleanupClosePushL( labelKeyArray );
       
   477     
       
   478     HBufC* keyLabelText = NULL;
       
   479     for( TInt i = 0; i < searchKeysCount; i++ )
       
   480         {
       
   481         const MSearchKeyInfo& searchKeyInfo = aSearchKeysEvent->SearchKeyInfo ( i );
       
   482         switch( searchKeyInfo.Type() )
       
   483 	        {
       
   484 	        	case EKey:
       
   485 	        		{
       
   486 	        		//change to proper type once done at ximp side
       
   487 	        		TSearchKey keyValue = searchKeyInfo.Key();
       
   488 	        		TVIMPSTEnums::TVIMPSTSearchKey key = ConverttoTVIMPSTSearchKey(keyValue);
       
   489 	        		enumKeyArray.Append(key);
       
   490 	        		break;		
       
   491 	        		}
       
   492 				case ELabel:
       
   493 	        		{
       
   494 	        		keyLabelText = searchKeyInfo.Label().AllocL();
       
   495 	        		
       
   496 	        		labelKeyArray.Append(keyLabelText);
       
   497 	        		break;		
       
   498 	        		}	        		
       
   499 	        	
       
   500 	        }
       
   501         }
       
   502     
       
   503     for(TInt i=0; i< iSearchObservers.Count(); i++  )
       
   504 	    {
       
   505 	    iSearchObservers[i]->HandleSearchKeysEventL(enumKeyArray, labelKeyArray );	
       
   506 	    }
       
   507 	
       
   508     	labelKeyArray.ResetAndDestroy();
       
   509 	CleanupStack::PopAndDestroy(2); //enumKeyArray, labelKeyArray
       
   510     
       
   511     }
       
   512         
       
   513 // ------------------------------------------------------------------------
       
   514 // CVIMPSTEngineSearchMgrExtention::ConverttoTVIMPSTSearchKey
       
   515 // 
       
   516 // ------------------------------------------------------------------------
       
   517 TVIMPSTEnums::TVIMPSTSearchKey CVIMPSTEngineSearchMgrExtention::ConverttoTVIMPSTSearchKey( TSearchKey aKey)
       
   518     {
       
   519 	TRACER_AUTO;
       
   520     
       
   521      TVIMPSTEnums::TVIMPSTSearchKey retKey = TVIMPSTEnums::EVIMPSTFirstName ;
       
   522      switch( aKey )
       
   523 		{
       
   524 		case EUserFirstName:
       
   525 			{
       
   526 			retKey = TVIMPSTEnums::EVIMPSTFirstName;	        		
       
   527 			break;		
       
   528 			}
       
   529 		case EUserMiddleName:
       
   530 			{
       
   531 			retKey = TVIMPSTEnums::EVIMPSTMiddleName;	        		
       
   532 			break;		
       
   533 			}
       
   534 		case EUserLastName:
       
   535 			{
       
   536 			retKey = TVIMPSTEnums::EVIMPSTLastName;	        		
       
   537 			break;		
       
   538 			}
       
   539 		case EUserFullName:
       
   540 			{
       
   541 			retKey = TVIMPSTEnums::EVIMPSTFullName;	        		
       
   542 			break;		
       
   543 			}
       
   544 		case EUserCountry:
       
   545 			{
       
   546 			retKey = TVIMPSTEnums::EVIMPSTCountry;	        		
       
   547 			break;		
       
   548 			}
       
   549 		case EUserCity:
       
   550 			{
       
   551 			retKey = TVIMPSTEnums::EVIMPSTCity;	        		
       
   552 			break;		
       
   553 			}
       
   554 		case EUserEmailAddress:
       
   555 			{
       
   556 			retKey = TVIMPSTEnums::EVIMPSTEmailAddress;	        		
       
   557 			break;		
       
   558 			}
       
   559 		case EUser:
       
   560 			{
       
   561 			retKey = TVIMPSTEnums::EVIMPSTUser;	        		
       
   562 			break;		
       
   563 			}
       
   564 		case EOrganisation:
       
   565 			{
       
   566 			retKey = TVIMPSTEnums::EVIMPSTOrganisation;	        		
       
   567 			break;		
       
   568 			}
       
   569 			
       
   570 		case  EUserNickName :
       
   571 			{
       
   572 		    retKey = TVIMPSTEnums::EVIMPSTNickName; 		
       
   573 			break;		
       
   574 			}
       
   575 		case EState :
       
   576 			{
       
   577 			retKey = TVIMPSTEnums::EVIMPSTState ; 	 	        		
       
   578 			break;		
       
   579 			}
       
   580 		case  EOrganisationUnit :
       
   581 			{
       
   582 		    retKey = TVIMPSTEnums::EVIMPSTOrganisationUnit;    		
       
   583 			break;		
       
   584 			}
       
   585 		case  EBirthday:
       
   586 			{
       
   587 		    retKey = TVIMPSTEnums::EVIMPSTBirthday;     		
       
   588 			break;		
       
   589 			}
       
   590 			
       
   591 		default:
       
   592 			{
       
   593 			retKey = TVIMPSTEnums::EVIMPSTFirstName;	
       
   594 			}
       
   595 
       
   596 		}
       
   597 	
       
   598 	return retKey;  
       
   599     }       	
       
   600 //----------------------------------------------------------------------------
       
   601 // CVIMPSTEngineSearchMgrExtention::SetSupported()
       
   602 // -----------------------------------------------------------------------------
       
   603 //
       
   604 void  CVIMPSTEngineSearchMgrExtention::SetSupported(TVIMPSTEnums::FeatureSupport aSupported)
       
   605     { 
       
   606 	TRACER_AUTO;
       
   607     if ( aSupported == TVIMPSTEnums::ESupportUnKnown)
       
   608         {
       
   609         // at the logout time this flag  has to be set to EFalse
       
   610         iAlreadySubscibed = EFalse;
       
   611         }
       
   612     iSearchSupported = aSupported;
       
   613     }
       
   614 
       
   615 // end of file