commondrm/drmui/drmuidialogs/src/drmuidialogs.cpp
author hgs
Thu, 24 Jun 2010 12:39:58 +0300
changeset 49 69d8e75812b7
permissions -rw-r--r--
201025_01
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49
69d8e75812b7 201025_01
hgs
parents:
diff changeset
     1
/*
69d8e75812b7 201025_01
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
69d8e75812b7 201025_01
hgs
parents:
diff changeset
     3
* All rights reserved.
69d8e75812b7 201025_01
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
69d8e75812b7 201025_01
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
69d8e75812b7 201025_01
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
69d8e75812b7 201025_01
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
69d8e75812b7 201025_01
hgs
parents:
diff changeset
     8
*
69d8e75812b7 201025_01
hgs
parents:
diff changeset
     9
* Initial Contributors:
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    11
*
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    12
* Contributors:
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    13
*
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    14
* Description:  Implementation of CDrmUIDialogs class.
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    15
*
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    16
*/
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    17
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    18
#include "drmuidialogs.h"                       // CDrmUIDialogs
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    19
#include <hb/hbcore/hbsymbianvariant.h>         // CHbSymbianVariantMap
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    20
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    21
// Identifier of DRM UI device notification dialog plugin
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    22
_LIT( KDrmUIDeviceDialogPlugin, "com.nokia.hb.drmuidialog/1.0" );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    23
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    24
// Keys for the parameters passed to notification dialog plugin
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    25
_LIT( KDrmUIDialogId, "dialogId" );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    26
_LIT( KDrmUIInsertText, "insertText" );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    27
_LIT( KDrmUIInsertInt, "insertInt" );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    28
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    29
// Keys name for result sent from notification dialog plugin
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    30
_LIT( KDrmUIDialogResult, "result");
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    31
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    32
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    33
// ======== MEMBER FUNCTIONS ========
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    34
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    35
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    36
// CDrmUIDialogs::NewLC()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    37
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    38
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    39
EXPORT_C CDrmUIDialogs* CDrmUIDialogs::NewLC()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    40
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    41
    CDrmUIDialogs* self = new( ELeave ) CDrmUIDialogs();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    42
    CleanupStack::PushL( self );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    43
    self->ConstructL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    44
    return self;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    45
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    46
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    47
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    48
// CDrmUIDialogs::NewL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    49
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    50
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    51
EXPORT_C CDrmUIDialogs* CDrmUIDialogs::NewL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    52
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    53
    CDrmUIDialogs* self = CDrmUIDialogs::NewLC();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    54
    CleanupStack::Pop( self );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    55
    return self;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    56
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    57
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    58
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    59
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    60
// CDrmUIDialogs::~CDrmUIDialogs()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    61
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    62
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    63
CDrmUIDialogs::~CDrmUIDialogs()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    64
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    65
    Cancel();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    66
    delete iWait;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    67
    delete iDeviceDialog;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    68
    delete iVariantMap;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    69
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    70
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    71
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    72
// CDrmUIDialogs::ShowNoteL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    73
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    74
EXPORT_C TInt CDrmUIDialogs::ShowNoteL( TInt aDialogId, const TDesC& aString, TInt aValue )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    75
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    76
    // Add the dialog id to the variant map
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    77
    AddParamL( KDrmUIDialogId, aDialogId );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    78
    
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    79
    // Add the string to the variant map if it exists
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    80
    if ( aString.Compare( KNullDesC ) )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    81
        {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    82
        AddParamL( KDrmUIInsertText, aString );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    83
        }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    84
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    85
    // Add the int to the variant map
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    86
    if ( aValue >= 0 )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    87
        {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    88
        AddParamL( KDrmUIInsertInt, aValue );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    89
        }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    90
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    91
    DisplayDeviceDialogL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    92
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    93
    TInt error = WaitUntilDeviceDialogClosed();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    94
    User::LeaveIfError( error );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    95
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    96
    return iReturnValue;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    97
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    98
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    99
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   100
// CDrmUIDialogs::DoCancel()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   101
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   102
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   103
void CDrmUIDialogs::DoCancel()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   104
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   105
    if( iWait && iWait->IsStarted() && iWait->CanStopNow() )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   106
        {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   107
        iCompletionCode = KErrCancel;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   108
        iWait->AsyncStop();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   109
        }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   110
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   111
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   112
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   113
// CDrmUIDialogs::RunL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   114
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   115
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   116
void CDrmUIDialogs::RunL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   117
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   118
    if( iWait )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   119
        {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   120
        iWait->AsyncStop();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   121
        }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   122
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   123
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   124
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   125
// CDrmUIDialogs::DataReceived()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   126
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   127
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   128
void CDrmUIDialogs::DataReceived( CHbSymbianVariantMap& aData )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   129
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   130
    const CHbSymbianVariant* resultVariant = aData.Get( KDrmUIDialogResult );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   131
 
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   132
    if( resultVariant )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   133
        {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   134
        TInt* result = resultVariant->Value<TInt>();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   135
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   136
        if( result )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   137
            {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   138
            iReturnValue = *result;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   139
            }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   140
        }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   141
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   142
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   143
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   144
// CDrmUIDialogs::DeviceDialogClosed()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   145
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   146
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   147
void CDrmUIDialogs::DeviceDialogClosed( TInt aCompletionCode )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   148
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   149
    iCompletionCode = aCompletionCode;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   150
    iIsDisplayingDialog = EFalse;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   151
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   152
    TRequestStatus* status( &iStatus );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   153
    User::RequestComplete( status, KErrNone );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   154
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   155
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   156
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   157
// CDrmUIDialogs::CDrmUIDialogs()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   158
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   159
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   160
CDrmUIDialogs::CDrmUIDialogs() : CActive( CActive::EPriorityStandard )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   161
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   162
    CActiveScheduler::Add( this );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   163
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   164
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   165
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   166
// CDrmUIDialogs::ConstructL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   167
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   168
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   169
void CDrmUIDialogs::ConstructL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   170
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   171
    iReturnValue = KErrNone;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   172
    iWait = new( ELeave ) CActiveSchedulerWait;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   173
    iDeviceDialog = CHbDeviceDialogSymbian::NewL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   174
    iVariantMap = CHbSymbianVariantMap::NewL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   175
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   176
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   177
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   178
// CDrmUIDialogs::ClearParamsL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   179
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   180
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   181
void CDrmUIDialogs::ClearParamsL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   182
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   183
    if( iVariantMap )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   184
        {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   185
        delete iVariantMap;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   186
        iVariantMap = NULL;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   187
        }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   188
    iVariantMap = CHbSymbianVariantMap::NewL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   189
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   190
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   191
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   192
// CDrmUIDialogs::ClearParamsAndSetDialogIdL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   193
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   194
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   195
void CDrmUIDialogs::ClearParamsAndSetDialogIdL( TInt aDialogId )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   196
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   197
    ClearParamsL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   198
    AddParamL( KDrmUIDialogId, aDialogId );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   199
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   200
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   201
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   202
// CDrmUIDialogs::AddParamL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   203
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   204
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   205
void CDrmUIDialogs::AddParamL( const TDesC& aKey, TInt aValue )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   206
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   207
    CHbSymbianVariant* variant = NULL;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   208
    variant = CHbSymbianVariant::NewL( &aValue, CHbSymbianVariant::EInt );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   209
    iVariantMap->Add( aKey, variant );  // Takes ownership of variant
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   210
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   211
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   212
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   213
// CDrmUIDialogs::AddParamL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   214
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   215
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   216
void CDrmUIDialogs::AddParamL( const TDesC& aKey, const TDesC& aValue )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   217
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   218
    CHbSymbianVariant* variant = NULL;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   219
    variant = CHbSymbianVariant::NewL( &aValue, CHbSymbianVariant::EDes );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   220
    iVariantMap->Add( aKey, variant );  // Takes ownership of variant
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   221
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   222
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   223
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   224
// CDrmUIDialogs::DisplayDeviceDialogL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   225
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   226
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   227
void CDrmUIDialogs::DisplayDeviceDialogL()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   228
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   229
    if( iIsDisplayingDialog )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   230
        {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   231
        iDeviceDialog->Update( *iVariantMap );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   232
        }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   233
    else
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   234
        {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   235
        iDeviceDialog->Show( KDrmUIDeviceDialogPlugin, *iVariantMap, this );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   236
        iIsDisplayingDialog = ETrue;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   237
        }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   238
    }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   239
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   240
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   241
// CDrmUIDialogs::WaitUntilDeviceDialogClosed()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   242
// ---------------------------------------------------------------------------
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   243
//
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   244
TInt CDrmUIDialogs::WaitUntilDeviceDialogClosed()
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   245
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   246
    iCompletionCode = KErrInUse;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   247
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   248
    if( !IsActive() && iWait && !iWait->IsStarted() )
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   249
        {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   250
        iStatus = KRequestPending;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   251
        SetActive();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   252
        iWait->Start();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   253
        }
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   254
    return iCompletionCode;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
   255
    }