multimediacommsengine/tsrc/MCETestUI/MCETestUIEngine/src/TMCETestUIEngineCmdNotifyEvent.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2005 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.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDES
       
    22 
       
    23 #include "TMCETestUIEngineCmdNotifyEvent.h"
       
    24 #include "CMCETestUIEngineInEvent.h"
       
    25 #include "CMCETestUIQuestionSingleSelection.h"
       
    26 #include "CMCETestUIQuestionDataQuery.h"
       
    27 #include <MCEInEvent.h>
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // TMCETestUIEngineCmdNotifyEvent::TMCETestUIEngineCmdNotifyEvent
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 TMCETestUIEngineCmdNotifyEvent::TMCETestUIEngineCmdNotifyEvent( 
       
    34 		            CMCETestUIEngine& aEngine,
       
    35 		            CMCETestUIEngineInEvent& aInEvent )
       
    36     : TMCETestUIEngineCmdBase( aEngine ),
       
    37       iInEvent( aInEvent )		            
       
    38     {
       
    39     }
       
    40 
       
    41 // -----------------------------------------------------------------------------
       
    42 // TMCETestUIEngineCmdNotifyEvent::ExecuteL
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 EXPORT_C void TMCETestUIEngineCmdNotifyEvent::ExecuteL()
       
    46 	{
       
    47 
       
    48 	TNotifyValues notifyValues;
       
    49     if( iEngine.NotifyValues( notifyValues) )
       
    50     	{
       
    51     	CDesC8Array* headers;
       
    52     	headers = new (ELeave) CDesC8ArrayFlat( 1 );
       
    53     	CleanupStack::PushL( headers );
       
    54 
       
    55 		CMCETestUIQuestionDataQuery* question = 
       
    56     			CMCETestUIQuestionDataQuery::NewLC();
       
    57 		question->SetCaptionL( KUserQuestionInputEventHeader );
       
    58 		question->SetDefaultValueL(notifyValues.headers  );
       
    59 		question->SetAnswerL( notifyValues.headers );
       
    60 		TBufC8<100> headersbuffer( question->Answer8() );
       
    61 		CleanupStack::PopAndDestroy( question );
       
    62 		headers->AppendL( headersbuffer );
       
    63 
       
    64 /*
       
    65         CMCETestUIQuestionDataQuery* question2 = 
       
    66 		    CMCETestUIQuestionDataQuery::NewLC();
       
    67 		    
       
    68         question2->SetCaptionL( KUserQuestionInputEventContentType );
       
    69     	question2->SetDefaultValueL(notifyValues.contentType  );
       
    70     	question2->SetAnswerL( notifyValues.contentType  );
       
    71     	
       
    72     	HBufC8 *contentType = HBufC8::NewLC( question2->Answer8().Length() );
       
    73     	contentType->Des().Copy( question2->Answer8() );
       
    74     	    	
       
    75     	CleanupStack::PopAndDestroy( question2 );
       
    76 
       
    77         CMCETestUIQuestionDataQuery* question3 = 
       
    78 		    CMCETestUIQuestionDataQuery::NewLC();
       
    79 		    
       
    80         question3->SetCaptionL( KUserQuestionInputEventContent );
       
    81     	question3->SetDefaultValueL(notifyValues.contentType  );
       
    82     	question3->SetAnswerL( notifyValues.contentType  );
       
    83     	HBufC8 *content = HBufC8::NewLC( question3->Answer8().Length() );
       
    84     	content->Des().Copy( question3->Answer8() );
       
    85     	
       
    86     	
       
    87     	CleanupStack::PopAndDestroy( question3 );
       
    88     	
       
    89     	CleanupStack::Pop( content );
       
    90     	CleanupStack::Pop( contentType );
       
    91    */
       
    92     	
       
    93     	
       
    94     	
       
    95     	HBufC8 *contentType = HBufC8::NewLC( KNotifyContentType().Length() );
       
    96     	contentType->Des().Copy( KNotifyContentType );
       
    97     	
       
    98     	HBufC8 *content = HBufC8::NewLC( KNotifyContent().Length() );
       
    99     	content->Des().Copy( KNotifyContent );
       
   100     	
       
   101     	CleanupStack::Pop( content );
       
   102     	CleanupStack::Pop( contentType );
       
   103     	CleanupStack::Pop( headers );
       
   104     	
       
   105     	iInEvent.InEvent().NotifyL( headers, contentType, content );
       
   106     	iEngine.EngineStateChangedL();
       
   107 	    }
       
   108 	}
       
   109 // -----------------------------------------------------------------------------
       
   110 // TMCETestUIEngineCmdNotifyEvent::Caption
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 EXPORT_C const TDesC& TMCETestUIEngineCmdNotifyEvent::Caption() const
       
   114 	{
       
   115 	return KCommandCaptionNotifyEvent;
       
   116 	}
       
   117 
       
   118 
       
   119 
       
   120 
       
   121 // End of File