securitydialogs/secuidialognotifiersrv/src/secuidialogoperation.cpp
author hgs
Tue, 28 Sep 2010 14:03:54 +0300
changeset 59 881d92421467
child 63 989397f9511c
permissions -rw-r--r--
201037_03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
59
881d92421467 201037_03
hgs
parents:
diff changeset
     1
/*
881d92421467 201037_03
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
881d92421467 201037_03
hgs
parents:
diff changeset
     3
* All rights reserved.
881d92421467 201037_03
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
881d92421467 201037_03
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
881d92421467 201037_03
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
881d92421467 201037_03
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
881d92421467 201037_03
hgs
parents:
diff changeset
     8
*
881d92421467 201037_03
hgs
parents:
diff changeset
     9
* Initial Contributors:
881d92421467 201037_03
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
881d92421467 201037_03
hgs
parents:
diff changeset
    11
*
881d92421467 201037_03
hgs
parents:
diff changeset
    12
* Contributors:
881d92421467 201037_03
hgs
parents:
diff changeset
    13
*
881d92421467 201037_03
hgs
parents:
diff changeset
    14
* Description:  Base class for CSecuiDialog operations
881d92421467 201037_03
hgs
parents:
diff changeset
    15
*
881d92421467 201037_03
hgs
parents:
diff changeset
    16
*/
881d92421467 201037_03
hgs
parents:
diff changeset
    17
881d92421467 201037_03
hgs
parents:
diff changeset
    18
#include "secuidialogoperation.h"    // CSecuiDialogOperation
881d92421467 201037_03
hgs
parents:
diff changeset
    19
#include "secuidialogoperationobserver.h" // MSecuiDialogOperationObserver
881d92421467 201037_03
hgs
parents:
diff changeset
    20
#include <hb/hbwidgets/hbdevicemessageboxsymbian.h> // CHbDeviceMessageBoxSymbian
881d92421467 201037_03
hgs
parents:
diff changeset
    21
#include "secuidialogstrace.h"       // TRACE macro
881d92421467 201037_03
hgs
parents:
diff changeset
    22
881d92421467 201037_03
hgs
parents:
diff changeset
    23
881d92421467 201037_03
hgs
parents:
diff changeset
    24
// ======== MEMBER FUNCTIONS ========
881d92421467 201037_03
hgs
parents:
diff changeset
    25
881d92421467 201037_03
hgs
parents:
diff changeset
    26
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    27
// CSecuiDialogOperation::CSecuiDialogOperation()
881d92421467 201037_03
hgs
parents:
diff changeset
    28
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    29
//
881d92421467 201037_03
hgs
parents:
diff changeset
    30
CSecuiDialogOperation::CSecuiDialogOperation(
881d92421467 201037_03
hgs
parents:
diff changeset
    31
        MSecuiDialogOperationObserver& aObserver, const RMessage2& aMessage,
881d92421467 201037_03
hgs
parents:
diff changeset
    32
        TInt aReplySlot ) : CActive( CActive::EPriorityStandard ), iObserver( aObserver ),
881d92421467 201037_03
hgs
parents:
diff changeset
    33
        iMessage( aMessage ), iReplySlot( aReplySlot )
881d92421467 201037_03
hgs
parents:
diff changeset
    34
    {
881d92421467 201037_03
hgs
parents:
diff changeset
    35
    TRACE( "CSecuiDialogOperation::CSecuiDialogOperation, iMessage 0x%08x",
881d92421467 201037_03
hgs
parents:
diff changeset
    36
            iMessage.Handle() );
881d92421467 201037_03
hgs
parents:
diff changeset
    37
    CActiveScheduler::Add( this );
881d92421467 201037_03
hgs
parents:
diff changeset
    38
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    39
881d92421467 201037_03
hgs
parents:
diff changeset
    40
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    41
// CSecuiDialogOperation::~CSecuiDialogOperation()
881d92421467 201037_03
hgs
parents:
diff changeset
    42
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    43
//
881d92421467 201037_03
hgs
parents:
diff changeset
    44
CSecuiDialogOperation::~CSecuiDialogOperation()
881d92421467 201037_03
hgs
parents:
diff changeset
    45
    {
881d92421467 201037_03
hgs
parents:
diff changeset
    46
    TRACE( "CSecuiDialogOperation::~CSecuiDialogOperation, begin" );
881d92421467 201037_03
hgs
parents:
diff changeset
    47
    Cancel();
881d92421467 201037_03
hgs
parents:
diff changeset
    48
    TRACE( "CSecuiDialogOperation::~CSecuiDialogOperation, end" );
881d92421467 201037_03
hgs
parents:
diff changeset
    49
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    50
881d92421467 201037_03
hgs
parents:
diff changeset
    51
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    52
// CSecuiDialogOperation::RunError()
881d92421467 201037_03
hgs
parents:
diff changeset
    53
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    54
//
881d92421467 201037_03
hgs
parents:
diff changeset
    55
TInt CSecuiDialogOperation::RunError( TInt aError )
881d92421467 201037_03
hgs
parents:
diff changeset
    56
    {
881d92421467 201037_03
hgs
parents:
diff changeset
    57
    TRACE( "CSecuiDialogOperation::RunError, aError=%d", aError );
881d92421467 201037_03
hgs
parents:
diff changeset
    58
    if( !iMessage.IsNull() )
881d92421467 201037_03
hgs
parents:
diff changeset
    59
        {
881d92421467 201037_03
hgs
parents:
diff changeset
    60
        TRACE( "CSecuiDialogOperation::RunError, completing message 0x%08x",
881d92421467 201037_03
hgs
parents:
diff changeset
    61
                iMessage.Handle() );
881d92421467 201037_03
hgs
parents:
diff changeset
    62
        iMessage.Complete( aError );
881d92421467 201037_03
hgs
parents:
diff changeset
    63
        }
881d92421467 201037_03
hgs
parents:
diff changeset
    64
    return KErrNone;
881d92421467 201037_03
hgs
parents:
diff changeset
    65
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    66
881d92421467 201037_03
hgs
parents:
diff changeset
    67
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    68
// CSecuiDialogOperation::ShowWarningNoteL()
881d92421467 201037_03
hgs
parents:
diff changeset
    69
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    70
//
881d92421467 201037_03
hgs
parents:
diff changeset
    71
void CSecuiDialogOperation::ShowWarningNoteL( const TDesC& aMessage )
881d92421467 201037_03
hgs
parents:
diff changeset
    72
    {
881d92421467 201037_03
hgs
parents:
diff changeset
    73
    CHbDeviceMessageBoxSymbian *note =
881d92421467 201037_03
hgs
parents:
diff changeset
    74
            CHbDeviceMessageBoxSymbian::NewL( CHbDeviceMessageBoxSymbian::EWarning );
881d92421467 201037_03
hgs
parents:
diff changeset
    75
    CleanupStack::PushL( note );
881d92421467 201037_03
hgs
parents:
diff changeset
    76
    note->SetTextL( aMessage );
881d92421467 201037_03
hgs
parents:
diff changeset
    77
    (void)note->ExecL();    // waits for response or timeout
881d92421467 201037_03
hgs
parents:
diff changeset
    78
    CleanupStack::PopAndDestroy( note );
881d92421467 201037_03
hgs
parents:
diff changeset
    79
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    80