59
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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: Base class for CSecuiDialog operations
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "secuidialogoperation.h" // CSecuiDialogOperation
|
|
19 |
#include "secuidialogoperationobserver.h" // MSecuiDialogOperationObserver
|
|
20 |
#include <hb/hbwidgets/hbdevicemessageboxsymbian.h> // CHbDeviceMessageBoxSymbian
|
|
21 |
#include "secuidialogstrace.h" // TRACE macro
|
|
22 |
|
|
23 |
|
|
24 |
// ======== MEMBER FUNCTIONS ========
|
|
25 |
|
|
26 |
// ---------------------------------------------------------------------------
|
|
27 |
// CSecuiDialogOperation::CSecuiDialogOperation()
|
|
28 |
// ---------------------------------------------------------------------------
|
|
29 |
//
|
|
30 |
CSecuiDialogOperation::CSecuiDialogOperation(
|
|
31 |
MSecuiDialogOperationObserver& aObserver, const RMessage2& aMessage,
|
|
32 |
TInt aReplySlot ) : CActive( CActive::EPriorityStandard ), iObserver( aObserver ),
|
|
33 |
iMessage( aMessage ), iReplySlot( aReplySlot )
|
|
34 |
{
|
|
35 |
TRACE( "CSecuiDialogOperation::CSecuiDialogOperation, iMessage 0x%08x",
|
|
36 |
iMessage.Handle() );
|
|
37 |
CActiveScheduler::Add( this );
|
|
38 |
}
|
|
39 |
|
|
40 |
// ---------------------------------------------------------------------------
|
|
41 |
// CSecuiDialogOperation::~CSecuiDialogOperation()
|
|
42 |
// ---------------------------------------------------------------------------
|
|
43 |
//
|
|
44 |
CSecuiDialogOperation::~CSecuiDialogOperation()
|
|
45 |
{
|
|
46 |
TRACE( "CSecuiDialogOperation::~CSecuiDialogOperation, begin" );
|
|
47 |
Cancel();
|
|
48 |
TRACE( "CSecuiDialogOperation::~CSecuiDialogOperation, end" );
|
|
49 |
}
|
|
50 |
|
|
51 |
// ---------------------------------------------------------------------------
|
|
52 |
// CSecuiDialogOperation::RunError()
|
|
53 |
// ---------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
TInt CSecuiDialogOperation::RunError( TInt aError )
|
|
56 |
{
|
|
57 |
TRACE( "CSecuiDialogOperation::RunError, aError=%d", aError );
|
|
58 |
if( !iMessage.IsNull() )
|
|
59 |
{
|
|
60 |
TRACE( "CSecuiDialogOperation::RunError, completing message 0x%08x",
|
|
61 |
iMessage.Handle() );
|
|
62 |
iMessage.Complete( aError );
|
|
63 |
}
|
|
64 |
return KErrNone;
|
|
65 |
}
|
|
66 |
|
|
67 |
// ---------------------------------------------------------------------------
|
|
68 |
// CSecuiDialogOperation::ShowWarningNoteL()
|
|
69 |
// ---------------------------------------------------------------------------
|
|
70 |
//
|
|
71 |
void CSecuiDialogOperation::ShowWarningNoteL( const TDesC& aMessage )
|
|
72 |
{
|
|
73 |
CHbDeviceMessageBoxSymbian *note =
|
|
74 |
CHbDeviceMessageBoxSymbian::NewL( CHbDeviceMessageBoxSymbian::EWarning );
|
|
75 |
CleanupStack::PushL( note );
|
|
76 |
note->SetTextL( aMessage );
|
|
77 |
(void)note->ExecL(); // waits for response or timeout
|
|
78 |
CleanupStack::PopAndDestroy( note );
|
|
79 |
}
|
|
80 |
|