messagingappbase/obexmtms/TObexMTM/SRC/obexgetpasswordstate.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // $Workfile: obexgetpasswordstate.cpp $
       
    15 // $Author: Stevep $
       
    16 // $Revision: 4 $
       
    17 // $Date: 27/03/02 10:24 $
       
    18 // 
       
    19 //
       
    20 
       
    21 
       
    22 #include "obexgetpasswordstate.h"
       
    23 
       
    24 #include "obexharness.h"
       
    25 #include "obextestutils.h"  // CObexTestUtils
       
    26 
       
    27 
       
    28 CObexGetPasswordState::CObexGetPasswordState(CObexClientTest& aClientTest) :
       
    29  iClientTest(aClientTest)
       
    30     {
       
    31     }
       
    32 
       
    33 void CObexGetPasswordState::StartL(TRequestStatus& aStatus)
       
    34 	{
       
    35 	HBufC* password = iClientTest.ObexTestUtils().GetCurrentObexMtmPasswordLC();
       
    36 	
       
    37 	if (password->Length())
       
    38 		{
       
    39 		_LIT(KPasswordIsString, "Password currently set to: ");
       
    40 		HBufC* message = HBufC::NewLC(password->Length() + (&KPasswordIsString)->Length());
       
    41 		TPtr messagePtr = message->Des();
       
    42 		messagePtr.Append(KPasswordIsString);
       
    43 		messagePtr.Append(*password);
       
    44 		iClientTest.ObexTestUtils().WriteComment(*message);
       
    45 		CleanupStack::PopAndDestroy(message);
       
    46 		}
       
    47 	else
       
    48 		{
       
    49 		_LIT(KNoPasswordWarning, "PASSWORD NOT SET!");
       
    50 		iClientTest.ObexTestUtils().WriteComment(KNoPasswordWarning);
       
    51 		}
       
    52 
       
    53 	CleanupStack::PopAndDestroy(password);
       
    54 
       
    55     TRequestStatus* status = &aStatus;
       
    56 	User::RequestComplete(status, KErrNone);
       
    57 	}
       
    58