usbuis/usbuinotif/src/usbuinqueriesnotifiermdrv.cpp
author hgs
Mon, 17 May 2010 11:03:15 +0300
changeset 52 831068540b07
parent 46 0ffee699d6c7
permissions -rw-r--r--
201019_1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
     2
 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
 * All rights reserved.
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
 *
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
 * Initial Contributors:
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
 *
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
 * Contributors:
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
 *
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
 * Description:  USB UI queries notifier class.
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
 *
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
 */
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
// INCLUDE FILES
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
    20
#include <hb/hbwidgets/hbdevicemessageboxsymbian.h>
831068540b07 201019_1
hgs
parents: 46
diff changeset
    21
#include <hb/hbcore/hbtextresolversymbian.h>
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <usbuinotif.h>                     // pck
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include "usbuinqueriesnotifiermdrv.h"      // Own class definition
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include "usbuinotifdebug.h"                // Debugging macros
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
// ================= MEMBER FUNCTIONS =========================================
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
// CUSBUIQueriesNotifier::NewL
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
// Two-phased constructor.
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
//
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
CUSBUIQueriesNotifier* CUSBUIQueriesNotifier::NewL()
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
    {
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
        FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::NewL"));
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
    CUSBUIQueriesNotifier* self = new (ELeave) CUSBUIQueriesNotifier();
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
    CleanupStack::PushL( self );
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
    self->ConstructL();
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
    CleanupStack::Pop( self );
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
    return self;
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
    }
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
// CUSBUIQueriesNotifier::CUSBUIQueriesNotifier
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
// C++ default constructor can NOT contain any code, that
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
// might leave.
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
//
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
CUSBUIQueriesNotifier::CUSBUIQueriesNotifier()
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
    {
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
    }
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
// Destructor
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
//
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
CUSBUIQueriesNotifier::~CUSBUIQueriesNotifier()
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
    {
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
    //Make sure that the request is completed. Note that inside the destructor,
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
    //this virtual function call is to local CUSBUIQueriesNotifier::Cancel, 
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
    //not to any possibly derived class implementation. 
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
    Cancel();
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
    }
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
// CUSBUIQueriesNotifier::RegisterL
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
// Register notifier.
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
//
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
CUSBUIQueriesNotifier::TNotifierInfo CUSBUIQueriesNotifier::RegisterL()
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
    {
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
    FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::RegisterL"));
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
    iInfo.iUid = KQueriesNotifier;
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
    iInfo.iChannel = KQueriesNotifier;
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
    iInfo.iPriority = ENotifierPriorityVHigh; // must be higher than the one 
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
        // in cableconnected notifier
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
    FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::RegisterL completed"));
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
    return iInfo;
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
    }
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
// CUSBUIQueriesNotifier::GetParamsL
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
//
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
    86
void CUSBUIQueriesNotifier::StartDialogL(const TDesC8& aBuffer,
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
        TInt aReplySlot, const RMessagePtr2& aMessage)
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
    {
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
    89
    FLOG(_L("[USBUINOTIF]\t  CUSBUIQueriesNotifier::StartDialogL"));
831068540b07 201019_1
hgs
parents: 46
diff changeset
    90
    if ( iReplySlot != 0 || iNeedToCompleteMessage)
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
        {
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
        User::Leave( KErrInUse );
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
        }
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
    94
        
831068540b07 201019_1
hgs
parents: 46
diff changeset
    95
    InitializeTextResolver();
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
    iMessage = aMessage;
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
    iNeedToCompleteMessage = ETrue;
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
    iReplySlot = aReplySlot;
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
    // Get parameters 
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
    //
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
    TUSBQueriesNotiferParams params; //stores parameters from aBuffer
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
    TPckgC<TUSBQueriesNotiferParams> pckg( params );
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
    pckg.Set( aBuffer );
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
    // Save the type of the query for later use (dialog selection)
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
    //
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
    iQueryType = pckg().iQuery;
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   109
         
831068540b07 201019_1
hgs
parents: 46
diff changeset
   110
    if (iUSBQueryDlg)
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
        {
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   112
        delete iUSBQueryDlg;
831068540b07 201019_1
hgs
parents: 46
diff changeset
   113
        iUSBQueryDlg = NULL;
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
        }
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   115
    iUSBQueryDlg = CHbDeviceMessageBoxSymbian::NewL(
831068540b07 201019_1
hgs
parents: 46
diff changeset
   116
                       CHbDeviceMessageBoxSymbian::EWarning, this);
831068540b07 201019_1
hgs
parents: 46
diff changeset
   117
    iUSBQueryDlg->SetTimeout(0);
831068540b07 201019_1
hgs
parents: 46
diff changeset
   118
    HBufC* stringHolder = NULL;
831068540b07 201019_1
hgs
parents: 46
diff changeset
   119
    switch (iQueryType)
831068540b07 201019_1
hgs
parents: 46
diff changeset
   120
            {
831068540b07 201019_1
hgs
parents: 46
diff changeset
   121
            case EUSBStorageMediaFailure:
831068540b07 201019_1
hgs
parents: 46
diff changeset
   122
                {
831068540b07 201019_1
hgs
parents: 46
diff changeset
   123
                _LIT(KMassStorageFail, "txt_usb_info_unable_to_show_a_memory_to_other_devi");
831068540b07 201019_1
hgs
parents: 46
diff changeset
   124
                stringHolder = HbTextResolverSymbian::LoadLC( KMassStorageFail );
831068540b07 201019_1
hgs
parents: 46
diff changeset
   125
                 break;
831068540b07 201019_1
hgs
parents: 46
diff changeset
   126
                }
831068540b07 201019_1
hgs
parents: 46
diff changeset
   127
            case EUSBDiskFull:
831068540b07 201019_1
hgs
parents: 46
diff changeset
   128
                {
831068540b07 201019_1
hgs
parents: 46
diff changeset
   129
                _LIT(KDiskFull, "txt_usb_info_disk_full_remove_some_files_and_try");
831068540b07 201019_1
hgs
parents: 46
diff changeset
   130
                stringHolder = HbTextResolverSymbian::LoadLC( KDiskFull );
831068540b07 201019_1
hgs
parents: 46
diff changeset
   131
		         break;
831068540b07 201019_1
hgs
parents: 46
diff changeset
   132
                }
831068540b07 201019_1
hgs
parents: 46
diff changeset
   133
            case EUSBNotEnoughRam:
831068540b07 201019_1
hgs
parents: 46
diff changeset
   134
                {
831068540b07 201019_1
hgs
parents: 46
diff changeset
   135
                _LIT(KNotEnoughMemory, "txt_usb_info_memory_full_close_some_applications");
831068540b07 201019_1
hgs
parents: 46
diff changeset
   136
                 stringHolder = HbTextResolverSymbian::LoadLC( KNotEnoughMemory );
831068540b07 201019_1
hgs
parents: 46
diff changeset
   137
                 break;
831068540b07 201019_1
hgs
parents: 46
diff changeset
   138
                }
831068540b07 201019_1
hgs
parents: 46
diff changeset
   139
            default:
831068540b07 201019_1
hgs
parents: 46
diff changeset
   140
                {
831068540b07 201019_1
hgs
parents: 46
diff changeset
   141
                FTRACE( FPrint( _L( "[USBUINOTIF]\t CUSBUIQueriesNotifier::ERROR! Unknown query type: %d" ),iQueryType ) );
831068540b07 201019_1
hgs
parents: 46
diff changeset
   142
                }
831068540b07 201019_1
hgs
parents: 46
diff changeset
   143
            }
831068540b07 201019_1
hgs
parents: 46
diff changeset
   144
   
831068540b07 201019_1
hgs
parents: 46
diff changeset
   145
    if (stringHolder)
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
        {
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   147
        iUSBQueryDlg->SetTextL(*stringHolder);
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
        }
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   149
        
831068540b07 201019_1
hgs
parents: 46
diff changeset
   150
    iUSBQueryDlg->ShowL();
831068540b07 201019_1
hgs
parents: 46
diff changeset
   151
    FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartDialogL() ShowL returned"));     
831068540b07 201019_1
hgs
parents: 46
diff changeset
   152
    
831068540b07 201019_1
hgs
parents: 46
diff changeset
   153
    CleanupStack::PopAndDestroy( stringHolder );
831068540b07 201019_1
hgs
parents: 46
diff changeset
   154
    
831068540b07 201019_1
hgs
parents: 46
diff changeset
   155
    
831068540b07 201019_1
hgs
parents: 46
diff changeset
   156
    FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::StartDialogL completed"));
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
    }
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
// CUSBUIQueriesNotifier::Cancel
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   161
// Release all own resources (member variables)
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
// ----------------------------------------------------------------------------
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
//
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
void CUSBUIQueriesNotifier::Cancel()
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
    {
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
    FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::Cancel"));
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
    if (iUSBQueryDlg)
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
        {
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   169
        iUSBQueryDlg->Close();
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
        delete iUSBQueryDlg;
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
        iUSBQueryDlg = NULL;
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
        }
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   173
 
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
    CUSBUINotifierBase::Cancel();
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
    FLOG(_L("[USBUINOTIF]\t CUSBUIQueriesNotifier::Cancel() completed"));
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
    }
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   179
void CUSBUIQueriesNotifier::MessageBoxClosed(
831068540b07 201019_1
hgs
parents: 46
diff changeset
   180
        const CHbDeviceMessageBoxSymbian* /*aMessageBox*/,
831068540b07 201019_1
hgs
parents: 46
diff changeset
   181
        CHbDeviceMessageBoxSymbian::TButtonId aButton)
831068540b07 201019_1
hgs
parents: 46
diff changeset
   182
    {
831068540b07 201019_1
hgs
parents: 46
diff changeset
   183
    FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed"));
831068540b07 201019_1
hgs
parents: 46
diff changeset
   184
    int returnValue = KErrNone;
831068540b07 201019_1
hgs
parents: 46
diff changeset
   185
    
831068540b07 201019_1
hgs
parents: 46
diff changeset
   186
    //iQuery will be deleted in Cancel. If Cancel is not called, it will be
831068540b07 201019_1
hgs
parents: 46
diff changeset
   187
    //deleted next time the query is shown. 
831068540b07 201019_1
hgs
parents: 46
diff changeset
   188
831068540b07 201019_1
hgs
parents: 46
diff changeset
   189
    if (aButton == CHbDeviceMessageBoxSymbian::EAcceptButton) 
46
hgs
parents: 3
diff changeset
   190
        {
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   191
        returnValue = KErrNone;
831068540b07 201019_1
hgs
parents: 46
diff changeset
   192
        } 
831068540b07 201019_1
hgs
parents: 46
diff changeset
   193
    else 
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
        {
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   195
        returnValue = KErrCancel;
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
        }
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   198
    CompleteMessage( returnValue );
831068540b07 201019_1
hgs
parents: 46
diff changeset
   199
    
831068540b07 201019_1
hgs
parents: 46
diff changeset
   200
    FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed completed"));    
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
    }
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
52
831068540b07 201019_1
hgs
parents: 46
diff changeset
   203
0
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
1e05558e2206 Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
// End of File