sl@0: /* sl@0: * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #include "controller.h" sl@0: sl@0: CController::CController(MKeyToolView& aView) : iView(aView) sl@0: { sl@0: sl@0: } sl@0: sl@0: MKeyToolView& CController::GetView() sl@0: { sl@0: return iView; sl@0: } sl@0: sl@0: void CController::DisplayErrorL(const TDesC& aError, TInt aErrorCode, TBool aPageWise) sl@0: { sl@0: iView.DisplayErrorL(aError, aErrorCode, aPageWise); sl@0: } sl@0: sl@0: sl@0: void CController::DisplayErrorL(const TDesC& aError, TBool aPageWise) sl@0: { sl@0: iView.DisplayErrorL(aError, aPageWise); sl@0: } sl@0: sl@0: sl@0: void CController::DisplayLocalisedMsgL(TInt aResourceId, TInt aErrorCode) sl@0: { sl@0: HBufC8* buf = NULL; sl@0: buf = iResourceFile.AllocReadL(aResourceId); sl@0: TBuf<512> bPtr; sl@0: sl@0: bPtr.Copy(reinterpret_cast(buf->Ptr()), buf->Size()/2); sl@0: iView.DisplayErrorL(bPtr, aErrorCode, 0); sl@0: delete buf; sl@0: } sl@0: sl@0: sl@0: void CController::DisplayLocalisedMsgL(TInt aResourceId) sl@0: { sl@0: HBufC8* buf = NULL; sl@0: buf = iResourceFile.AllocReadL(aResourceId); sl@0: TBuf<512> bPtr; sl@0: sl@0: // resource file having rls_string which is 16-bit Unicode string sl@0: // So we can cast it to get a 8 bit without changing the data. sl@0: bPtr.Copy(reinterpret_cast(buf->Ptr()), buf->Size()/2); sl@0: iView.DisplayErrorL(bPtr, 0); sl@0: delete buf; sl@0: } sl@0: sl@0: void CController::DisplayKeyL(CCTKeyInfo& aKey, TBool aIsDetailed, TBool aPageWise) sl@0: { sl@0: iView.DisplayKeyInfoL(aKey, aIsDetailed, aPageWise); sl@0: } sl@0: sl@0: sl@0: void CController::DisplayCertL(CCTCertInfo& aCert, CCertificate& aCertificate, RUidArray aApps, TBool aTrusted, TBool aIsDetailed, TBool aPageWise) sl@0: { sl@0: iView.DisplayCertL(aCert, aCertificate, aApps, aTrusted, aIsDetailed, aPageWise); sl@0: } sl@0: sl@0: CController::~CController() sl@0: { sl@0: iResourceFile.Close(); sl@0: iFsSession.Close(); sl@0: } sl@0: sl@0: