usbuis/usbuinotif/src/usbuinotifotgerror.cpp
author William Roberts <williamr@symbian.org>
Thu, 22 Jul 2010 16:44:03 +0100
branchGCC_SURGE
changeset 63 ef2686f7597e
parent 26 0ae0f29418cd
parent 38 218231f2b3b3
permissions -rw-r--r--
Catchup to latest Symbian^4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2007, 2009 Nokia Corporation and/or its subsidiary(-ies).
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  USB UI queries notifier class.
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
 *
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
// INCLUDE FILES
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    20
#include <hb/hbwidgets/hbdevicemessageboxsymbian.h>      // dialog
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    21
#include <hb/hbcore/hbtextresolversymbian.h>
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include <usbuinotif.h>                     // pck
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include "usbuinotifotgerror.h"             // Own class definition
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include "usbuinotifdebug.h"                // Debugging macros
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    25
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    26
// CONSTANTS
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    27
/** granularity for allocating error strings */
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    28
const TInt KUsbOtgErrorGranularity = 7; 
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    29
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    30
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
// ================= MEMBER FUNCTIONS =========================================
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
// CUsbUiNotifOtgError::NewL
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
// Two-phased constructor.
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
CUsbUiNotifOtgError* CUsbUiNotifOtgError::NewL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
    CUsbUiNotifOtgError* self = new (ELeave) CUsbUiNotifOtgError();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
    CleanupStack::PushL( self );
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
    self->ConstructL();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
    CleanupStack::Pop( self );
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
    return self;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
// CUsbUiNotifOtgError::CUsbUiNotifOtgError
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
// C++ default constructor can NOT contain any code, that
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
// might leave.
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
CUsbUiNotifOtgError::CUsbUiNotifOtgError() :
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    54
    iStringIds(NULL)
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
// Destructor
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
CUsbUiNotifOtgError::~CUsbUiNotifOtgError()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
    //Make sure that the request is completed. Note that inside the destructor,
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
    //this virtual function call is to local CUsbUiNotifOtgError::Cancel, 
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
    //not to any possibly derived class implementation. 
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    67
    delete iStringIds;
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
    Cancel();
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
void CUsbUiNotifOtgError::ConstructL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
    CUSBUINotifierBase::ConstructL();
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    74
    iStringIds = new (ELeave) CDesCArrayFlat(KUsbOtgErrorGranularity);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    75
    _LIT(KCurrentLimit, "txt_usb_info_error_in_usb_connection_disconnect_d");
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    76
    _LIT(KTooMuchCurrent, "txt_usb_info_unsupported_usb_device_disconnect_de");
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    77
    _LIT(KUnsupported, "txt_usb_info_unsupported_usb_device_disconnect_de");
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    78
    _LIT(KHubUnsupported, "txt_usb_info_hubs_are_not_supported_disconnect_us");
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    79
    _LIT(KUnRecoverable, "txt_usb_info_error_in_usb_connection_disconnect_d");
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    80
    _LIT(KAttachTimeOut, "txt_usb_info_remove_usb_cable_or_connect_a_device");
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    81
    _LIT(KNotEnoughMemory, "txt_usb_info_memory_full_close_some_applications");
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    82
    iStringIds->AppendL( KCurrentLimit);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    83
    iStringIds->AppendL( KTooMuchCurrent);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    84
    iStringIds->AppendL( KUnsupported);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    85
    iStringIds->AppendL( KHubUnsupported);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    86
    iStringIds->AppendL( KUnRecoverable);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    87
    iStringIds->AppendL( KAttachTimeOut);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    88
    iStringIds->AppendL( KNotEnoughMemory);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
    89
   
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
// CUsbUiNotifOtgError::RegisterL
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
// Register notifier.
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
CUsbUiNotifOtgError::TNotifierInfo CUsbUiNotifOtgError::RegisterL()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
    iInfo.iUid = KUsbUiNotifOtgError;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
    iInfo.iChannel = KUsbUiNotifOtgError;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
    iInfo.iPriority = ENotifierPriorityVHigh;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
    return iInfo;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
// CUsbUiNotifOtgError::GetParamsL
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
//  Jump to RunL as soon as possible.
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
//
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   110
void CUsbUiNotifOtgError::StartDialogL(const TDesC8& aBuffer, TInt aReplySlot,
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
        const RMessagePtr2& aMessage)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
    {
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   113
    FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::StartDialogL"));
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   114
    if (iReplySlot != 0 || iNeedToCompleteMessage)
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
        {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
        User::Leave( KErrInUse );
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
        }
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   118
  
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   119
    InitializeTextResolver();
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
    
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   121
    TInt errorId = 0;
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   122
    TPckgC<TInt> pckg( errorId );
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
    pckg.Set( aBuffer );
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   124
    errorId = pckg();
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
    
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   126
    FTRACE(FPrint(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::GetParamsL iErrorId: %d"), errorId ));  
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   127
    if ( errorId < 0 || errorId >= iStringIds->MdcaCount())
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
        {        
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
        User::Leave( KErrArgument);        
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
        }    
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
    iMessage = aMessage;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
    iNeedToCompleteMessage = ETrue;
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   133
    iReplySlot = aReplySlot;
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   134
   
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   135
    if (iQuery)
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   136
            {
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   137
            delete iQuery;
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   138
            iQuery = NULL;
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   139
            }
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   140
        
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   141
        iQuery = CHbDeviceMessageBoxSymbian::NewL(
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   142
                CHbDeviceMessageBoxSymbian::EWarning, this);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   143
        iQuery->SetTimeout(0);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   144
        HBufC* stringHolder = HbTextResolverSymbian::LoadLC(iStringIds->MdcaPoint(errorId) );
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   145
        iQuery->SetTextL(*stringHolder);
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   146
        iQuery->ShowL();
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   147
        CleanupStack::PopAndDestroy( stringHolder );
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   148
            
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   149
    
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   150
    FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::StartDialogL completed"));
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
// CUsbUiNotifOtgError::Cancel
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
// Release all own resources (member variables)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
//
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
void CUsbUiNotifOtgError::Cancel()
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
    {
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
    FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::Cancel"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
    if (iQuery)
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
        {
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   163
        iQuery->Close();
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
        delete iQuery;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
        iQuery = NULL;
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
        }
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   167
    CUSBUINotifierBase::Cancel();
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
    FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::Cancel() completed"));
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
// ----------------------------------------------------------------------------
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   172
// Call back function to observe device message box closing.
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
// ----------------------------------------------------------------------------
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
//
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   175
void CUsbUiNotifOtgError::MessageBoxClosed(
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   176
        const CHbDeviceMessageBoxSymbian* /*aMessageBox*/,
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   177
        CHbDeviceMessageBoxSymbian::TButtonId aButton)
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
    {
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   179
    FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed"));
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   180
    int returnValue = KErrNone;
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   181
    
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   182
    //iQuery will be deleted in Cancel. If Cancel is not called, it will be
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   183
    //deleted next time the query is shown. 
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   185
    if (aButton == CHbDeviceMessageBoxSymbian::EAcceptButton) 
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
        {
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   187
        returnValue = KErrNone;
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   188
        } 
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   189
    else 
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   190
        {
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   191
        returnValue = KErrCancel;
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
        }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   194
    CompleteMessage( returnValue );
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   195
    
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   196
    FLOG(_L("[USBUINOTIF]\t CUsbUiNotifMSMMError::MessageBoxClosed completed"));    
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
    }
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
38
218231f2b3b3 Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 35
diff changeset
   199
35
9d8b04ca6939 Revert last code drop.
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
// End of File