os/security/cryptoservices/filebasedcertificateandkeystores/test/keytool/controller.cpp
First public contribution.
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #include "controller.h"
21 CController::CController(MKeyToolView& aView) : iView(aView)
26 MKeyToolView& CController::GetView()
31 void CController::DisplayErrorL(const TDesC& aError, TInt aErrorCode, TBool aPageWise)
33 iView.DisplayErrorL(aError, aErrorCode, aPageWise);
37 void CController::DisplayErrorL(const TDesC& aError, TBool aPageWise)
39 iView.DisplayErrorL(aError, aPageWise);
43 void CController::DisplayLocalisedMsgL(TInt aResourceId, TInt aErrorCode)
46 buf = iResourceFile.AllocReadL(aResourceId);
49 bPtr.Copy(reinterpret_cast<const TUint16*>(buf->Ptr()), buf->Size()/2);
50 iView.DisplayErrorL(bPtr, aErrorCode, 0);
55 void CController::DisplayLocalisedMsgL(TInt aResourceId)
58 buf = iResourceFile.AllocReadL(aResourceId);
61 // resource file having rls_string which is 16-bit Unicode string
62 // So we can cast it to get a 8 bit without changing the data.
63 bPtr.Copy(reinterpret_cast<const TUint16*>(buf->Ptr()), buf->Size()/2);
64 iView.DisplayErrorL(bPtr, 0);
68 void CController::DisplayKeyL(CCTKeyInfo& aKey, TBool aIsDetailed, TBool aPageWise)
70 iView.DisplayKeyInfoL(aKey, aIsDetailed, aPageWise);
74 void CController::DisplayCertL(CCTCertInfo& aCert, CCertificate& aCertificate, RUidArray aApps, TBool aTrusted, TBool aIsDetailed, TBool aPageWise)
76 iView.DisplayCertL(aCert, aCertificate, aApps, aTrusted, aIsDetailed, aPageWise);
79 CController::~CController()
81 iResourceFile.Close();