commondrm/drmui/drmuidialogs/inc/drmuidialogs.h
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:  CDrmUIDialogs API can be used to show UI dialogs via 
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    15
* notification dialog plugin.
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    16
*/
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    17
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    18
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    19
#ifndef C_DRMUIDIALOGS_H
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    20
#define C_DRMUIDIALOGS_H
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    21
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    22
#include <e32base.h>                            // CActive
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    23
#include <hb/hbcore/hbdevicedialogsymbian.h>    // MHbDeviceDialogObserver
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    24
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    25
class CHbSymbianVariantMap;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    26
class CActiveSchedulerWait;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    27
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    28
/**
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    29
 * CDrmUIDialogs manages and controls DRM UI notes and queries. 
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    30
 * An Orbit device dialog plugin implements the UI dialogs.
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    31
 *
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    32
 * @dll drmuidialogs.dll
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    33
 * @since 10.1
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    34
 */
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    35
NONSHARABLE_CLASS( CDrmUIDialogs ) : public CActive,
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    36
                                     public MHbDeviceDialogObserver
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    37
    {
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    38
    public:  // constructor and destructor
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    39
        /**
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    40
         * Creates new CDrmUIDialogs object and pushes it into cleanup stack.
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    41
         * @returns CDrmUIDialogs* -- new CDrmUIDialogs object
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    42
         */
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    43
        IMPORT_C static CDrmUIDialogs* NewLC();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    44
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    45
        /**
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    46
         * Creates new CDrmUIDialogs object.
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    47
         * @returns CDrmUIDialogs* -- new CDrmUIDialogs object
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    48
         */
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    49
        IMPORT_C static CDrmUIDialogs* NewL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    50
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    51
        /**
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    52
         * Destructor.
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    53
         */
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    54
        CDrmUIDialogs::~CDrmUIDialogs();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    55
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    56
    public:
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    57
        /**
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    58
        * Displays a note or query dialog synchronously. Synchronous function.
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    59
        * Returns after the user has accepted or cancelled the query.
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    60
        * @param aDialogId  dialog id of dialog to be displayed
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    61
        * @param aString    string that replaces %U in resource string
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    62
        * @param aValue     integer that replaces %N in resource string
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    63
        * @return EOk if user accepted the query, ECancelled otherwise
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    64
        */
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    65
        IMPORT_C TInt ShowNoteL( TInt aDialogId, 
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    66
                                 const TDesC& aString = KNullDesC, 
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    67
                                 TInt aValue = -1 );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    68
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    69
    protected:  // from CActive
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    70
        void DoCancel();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    71
        void RunL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    72
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    73
    private:    // from MHbDeviceDialogObserver
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    74
        void DataReceived( CHbSymbianVariantMap& aData );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    75
        void DeviceDialogClosed( TInt aCompletionCode );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    76
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    77
    private:
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    78
        CDrmUIDialogs();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    79
        void ConstructL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    80
        void ClearParamsL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    81
        void ClearParamsAndSetDialogIdL( TInt aDialogId );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    82
        void AddParamL( const TDesC& aKey, TInt aValue );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    83
        void AddParamL( const TDesC& aKey, const TDesC& aValue );
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    84
        void DisplayDeviceDialogL();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    85
        TInt WaitUntilDeviceDialogClosed();
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    86
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    87
    private:    // data
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    88
        CHbDeviceDialogSymbian* iDeviceDialog; // own
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    89
        CHbSymbianVariantMap* iVariantMap; // own
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    90
        CActiveSchedulerWait* iWait; // own
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    91
        TBool iIsDisplayingDialog;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    92
        TInt iCompletionCode;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    93
        TInt iReturnValue;
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    94
    };
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    95
69d8e75812b7 201025_01
hgs
parents:
diff changeset
    96
#endif  // C_DRMUIDIALOGS_H