securitydialogs/secuidialognotifier/src/secuidialognotifier.cpp
author hgs
Thu, 14 Oct 2010 13:56:11 +0300
changeset 63 989397f9511c
parent 59 881d92421467
permissions -rw-r--r--
201039_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:  Secui dialog notifier
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 "secuidialognotifier.h"     // CSecuiDialogNotifier
881d92421467 201037_03
hgs
parents:
diff changeset
    19
#include "secuidialogs.h"            // CSecuiDialogs
881d92421467 201037_03
hgs
parents:
diff changeset
    20
#include "secuidialogstrace.h"       // TRACE macro
881d92421467 201037_03
hgs
parents:
diff changeset
    21
881d92421467 201037_03
hgs
parents:
diff changeset
    22
881d92421467 201037_03
hgs
parents:
diff changeset
    23
// ======== MEMBER FUNCTIONS ========
881d92421467 201037_03
hgs
parents:
diff changeset
    24
881d92421467 201037_03
hgs
parents:
diff changeset
    25
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    26
// CSecuiDialogNotifier::~CSecuiDialogNotifier()
881d92421467 201037_03
hgs
parents:
diff changeset
    27
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    28
//
881d92421467 201037_03
hgs
parents:
diff changeset
    29
CSecuiDialogNotifier::~CSecuiDialogNotifier()
881d92421467 201037_03
hgs
parents:
diff changeset
    30
    {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
    31
    RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
    32
    Cancel();
881d92421467 201037_03
hgs
parents:
diff changeset
    33
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    34
881d92421467 201037_03
hgs
parents:
diff changeset
    35
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    36
// CSecuiDialogNotifier::NewL()
881d92421467 201037_03
hgs
parents:
diff changeset
    37
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    38
//
881d92421467 201037_03
hgs
parents:
diff changeset
    39
CSecuiDialogNotifier* CSecuiDialogNotifier::NewL()
881d92421467 201037_03
hgs
parents:
diff changeset
    40
    {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
    41
		RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
    42
    CSecuiDialogNotifier* self = new( ELeave ) CSecuiDialogNotifier;
881d92421467 201037_03
hgs
parents:
diff changeset
    43
    CleanupStack::PushL( self );
881d92421467 201037_03
hgs
parents:
diff changeset
    44
    self->ConstructL();
881d92421467 201037_03
hgs
parents:
diff changeset
    45
    CleanupStack::Pop( self );
881d92421467 201037_03
hgs
parents:
diff changeset
    46
    return self;
881d92421467 201037_03
hgs
parents:
diff changeset
    47
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    48
881d92421467 201037_03
hgs
parents:
diff changeset
    49
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    50
// CSecuiDialogNotifier::Release()
881d92421467 201037_03
hgs
parents:
diff changeset
    51
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    52
//
881d92421467 201037_03
hgs
parents:
diff changeset
    53
void CSecuiDialogNotifier::Release()
881d92421467 201037_03
hgs
parents:
diff changeset
    54
    {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
    55
    RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
    56
    delete this;
881d92421467 201037_03
hgs
parents:
diff changeset
    57
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    58
881d92421467 201037_03
hgs
parents:
diff changeset
    59
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    60
// CSecuiDialogNotifier::RegisterL()
881d92421467 201037_03
hgs
parents:
diff changeset
    61
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    62
//
881d92421467 201037_03
hgs
parents:
diff changeset
    63
CSecuiDialogNotifier::TNotifierInfo CSecuiDialogNotifier::RegisterL()
881d92421467 201037_03
hgs
parents:
diff changeset
    64
    {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
    65
		RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
    66
    return Info();
881d92421467 201037_03
hgs
parents:
diff changeset
    67
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    68
881d92421467 201037_03
hgs
parents:
diff changeset
    69
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    70
// CSecuiDialogNotifier::Info()
881d92421467 201037_03
hgs
parents:
diff changeset
    71
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    72
//
881d92421467 201037_03
hgs
parents:
diff changeset
    73
CSecuiDialogNotifier::TNotifierInfo CSecuiDialogNotifier::Info() const
881d92421467 201037_03
hgs
parents:
diff changeset
    74
    {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
    75
		RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
    76
881d92421467 201037_03
hgs
parents:
diff changeset
    77
    TNotifierInfo info;
881d92421467 201037_03
hgs
parents:
diff changeset
    78
    static const TUid KUidSecuiDialogNotifier = { 0x10005988 };
881d92421467 201037_03
hgs
parents:
diff changeset
    79
    info.iUid = KUidSecuiDialogNotifier;
881d92421467 201037_03
hgs
parents:
diff changeset
    80
    const TUid KSecAuthChannel = {0x00000602};
881d92421467 201037_03
hgs
parents:
diff changeset
    81
    info.iChannel = KSecAuthChannel;
881d92421467 201037_03
hgs
parents:
diff changeset
    82
    info.iPriority = ENotifierPriorityAbsolute;
881d92421467 201037_03
hgs
parents:
diff changeset
    83
    return info;
881d92421467 201037_03
hgs
parents:
diff changeset
    84
    }
881d92421467 201037_03
hgs
parents:
diff changeset
    85
881d92421467 201037_03
hgs
parents:
diff changeset
    86
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    87
// CSecuiDialogNotifier::StartL()
881d92421467 201037_03
hgs
parents:
diff changeset
    88
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
    89
//
881d92421467 201037_03
hgs
parents:
diff changeset
    90
void CSecuiDialogNotifier::StartL( const TDesC8& aBuffer, TInt aReplySlot,
881d92421467 201037_03
hgs
parents:
diff changeset
    91
        const RMessagePtr2& aMessage )
881d92421467 201037_03
hgs
parents:
diff changeset
    92
    {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
    93
    RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
    94
881d92421467 201037_03
hgs
parents:
diff changeset
    95
    TRAPD( err, DoStartL( aBuffer, aReplySlot, aMessage ) );
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
    96
    RDEBUG("err", err);
59
881d92421467 201037_03
hgs
parents:
diff changeset
    97
    if( err )
881d92421467 201037_03
hgs
parents:
diff changeset
    98
        {
881d92421467 201037_03
hgs
parents:
diff changeset
    99
        if( iSecuiDialogs && !iIsSecuiDialogsDeleted )
881d92421467 201037_03
hgs
parents:
diff changeset
   100
            {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
   101
            RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
   102
            delete iSecuiDialogs;
881d92421467 201037_03
hgs
parents:
diff changeset
   103
            iSecuiDialogs = NULL;
881d92421467 201037_03
hgs
parents:
diff changeset
   104
            }
881d92421467 201037_03
hgs
parents:
diff changeset
   105
        if( !aMessage.IsNull() )
881d92421467 201037_03
hgs
parents:
diff changeset
   106
            {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
   107
            RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
   108
            aMessage.Complete( err );
881d92421467 201037_03
hgs
parents:
diff changeset
   109
            }
881d92421467 201037_03
hgs
parents:
diff changeset
   110
        }
881d92421467 201037_03
hgs
parents:
diff changeset
   111
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
   112
    RDEBUG("0x99", 0x99);
59
881d92421467 201037_03
hgs
parents:
diff changeset
   113
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   114
881d92421467 201037_03
hgs
parents:
diff changeset
   115
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   116
// CSecuiDialogNotifier::StartL()
881d92421467 201037_03
hgs
parents:
diff changeset
   117
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   118
//
881d92421467 201037_03
hgs
parents:
diff changeset
   119
TPtrC8 CSecuiDialogNotifier::StartL( const TDesC8& /*aBuffer*/ )
881d92421467 201037_03
hgs
parents:
diff changeset
   120
    {
881d92421467 201037_03
hgs
parents:
diff changeset
   121
    return KNullDesC8();
881d92421467 201037_03
hgs
parents:
diff changeset
   122
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   123
881d92421467 201037_03
hgs
parents:
diff changeset
   124
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   125
// CSecuiDialogNotifier::Cancel()
881d92421467 201037_03
hgs
parents:
diff changeset
   126
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   127
//
881d92421467 201037_03
hgs
parents:
diff changeset
   128
void CSecuiDialogNotifier::Cancel()
881d92421467 201037_03
hgs
parents:
diff changeset
   129
    {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
   130
    RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
   131
    if( iSecuiDialogs && !iIsSecuiDialogsDeleted )
881d92421467 201037_03
hgs
parents:
diff changeset
   132
        {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
   133
        RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
   134
        delete iSecuiDialogs;
881d92421467 201037_03
hgs
parents:
diff changeset
   135
        iSecuiDialogs = NULL;
881d92421467 201037_03
hgs
parents:
diff changeset
   136
        }
881d92421467 201037_03
hgs
parents:
diff changeset
   137
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   138
881d92421467 201037_03
hgs
parents:
diff changeset
   139
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   140
// CSecuiDialogNotifier::UpdateL()
881d92421467 201037_03
hgs
parents:
diff changeset
   141
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   142
//
881d92421467 201037_03
hgs
parents:
diff changeset
   143
TPtrC8 CSecuiDialogNotifier::UpdateL( const TDesC8& /*aBuffer*/ )
881d92421467 201037_03
hgs
parents:
diff changeset
   144
    {
881d92421467 201037_03
hgs
parents:
diff changeset
   145
    return KNullDesC8();
881d92421467 201037_03
hgs
parents:
diff changeset
   146
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   147
881d92421467 201037_03
hgs
parents:
diff changeset
   148
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   149
// CSecuiDialogNotifier::CSecuiDialogNotifier()
881d92421467 201037_03
hgs
parents:
diff changeset
   150
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   151
//
881d92421467 201037_03
hgs
parents:
diff changeset
   152
CSecuiDialogNotifier::CSecuiDialogNotifier()
881d92421467 201037_03
hgs
parents:
diff changeset
   153
    {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
   154
    RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
   155
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   156
881d92421467 201037_03
hgs
parents:
diff changeset
   157
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   158
// CSecuiDialogNotifier::ConstructL()
881d92421467 201037_03
hgs
parents:
diff changeset
   159
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   160
//
881d92421467 201037_03
hgs
parents:
diff changeset
   161
void CSecuiDialogNotifier::ConstructL()
881d92421467 201037_03
hgs
parents:
diff changeset
   162
    {
881d92421467 201037_03
hgs
parents:
diff changeset
   163
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   164
881d92421467 201037_03
hgs
parents:
diff changeset
   165
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   166
// CSecuiDialogNotifier::DoStartL()
881d92421467 201037_03
hgs
parents:
diff changeset
   167
// ---------------------------------------------------------------------------
881d92421467 201037_03
hgs
parents:
diff changeset
   168
//
881d92421467 201037_03
hgs
parents:
diff changeset
   169
void CSecuiDialogNotifier::DoStartL( const TDesC8& aBuffer, TInt aReplySlot,
881d92421467 201037_03
hgs
parents:
diff changeset
   170
        const RMessagePtr2& aMessage )
881d92421467 201037_03
hgs
parents:
diff changeset
   171
    {
63
989397f9511c 201039_03
hgs
parents: 59
diff changeset
   172
		RDEBUG("0", 0);
59
881d92421467 201037_03
hgs
parents:
diff changeset
   173
881d92421467 201037_03
hgs
parents:
diff changeset
   174
    iSecuiDialogs = CSecuiDialogs::NewL( iIsSecuiDialogsDeleted );
881d92421467 201037_03
hgs
parents:
diff changeset
   175
    iSecuiDialogs->StartLD( aBuffer, aReplySlot, aMessage );
881d92421467 201037_03
hgs
parents:
diff changeset
   176
    }
881d92421467 201037_03
hgs
parents:
diff changeset
   177