usbuis/usbuinotif/inc/usbuinqueriesnotifier.h
branchRCL_3
changeset 80 e02eb84a14d2
equal deleted inserted replaced
79:25fce757be94 80:e02eb84a14d2
       
     1 /*
       
     2  * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  Declares USB UI Queries notifier.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef USBUINQUERIESNOTIFIER_H
       
    19 #define USBUINQUERIESNOTIFIER_H
       
    20 
       
    21 // INCLUDES
       
    22 
       
    23 #include "usbnotifier.h"      // Base class
       
    24 #include <AknQueryDialog.h>   // AVKON component
       
    25 
       
    26 // CLASS DECLARATION
       
    27 
       
    28 /**
       
    29  *  This class is used to show USB query dialogs.
       
    30  *
       
    31  *  @lib
       
    32  */
       
    33 NONSHARABLE_CLASS(CUSBUIQueriesNotifier) : public CUSBUINotifierBase
       
    34     {
       
    35 public:
       
    36     // Constructors and destructor
       
    37 
       
    38     /**
       
    39      * Two-phased constructor.
       
    40      */
       
    41     static CUSBUIQueriesNotifier* NewL();
       
    42 
       
    43     /**
       
    44      * Destructor.
       
    45      */
       
    46     virtual ~CUSBUIQueriesNotifier();
       
    47 
       
    48 
       
    49 private:
       
    50     // Functions from base class
       
    51 
       
    52     /**
       
    53      * From CUSBUINotifierBase Called when a notifier is first loaded.        
       
    54      * @param None.
       
    55      * @return A structure containing priority and channel info.
       
    56      */
       
    57     TNotifierInfo RegisterL();
       
    58 
       
    59     /**
       
    60      * From CUSBUINotifierBase The notifier has been deactivated 
       
    61      * so resources can be freed and outstanding messages completed.
       
    62      * @param None.
       
    63      * @return None.
       
    64      */
       
    65     void Cancel();
       
    66 
       
    67     /**
       
    68      * From CUSBUINotifierBase Gets called when a request completes.
       
    69      * @param None.
       
    70      * @return None.
       
    71      */
       
    72     void RunL();
       
    73 
       
    74     /**
       
    75      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
       
    76      * store received parameters into members variables and 
       
    77      * make needed initializations.
       
    78      * @param aBuffer A buffer containing received parameters
       
    79      * @param aReplySlot A reply slot.
       
    80      * @param aMessage Should be completed when the notifier is deactivated.
       
    81      * @return None.
       
    82      */
       
    83     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
       
    84             const RMessagePtr2& aMessage);
       
    85 
       
    86 private:
       
    87 
       
    88     /**
       
    89      *  C++ default constructor.
       
    90      */
       
    91     CUSBUIQueriesNotifier();
       
    92 
       
    93 private:
       
    94     // New functions
       
    95 
       
    96 
       
    97     /**
       
    98      * Show query dialog 
       
    99      * @param aStringHolder   The string for the query. 
       
   100      * @param aCoverDialogId  The dialog ID for the cover UI.
       
   101      * @param aIsCancelKey    Does the dialog show Cancel key.
       
   102      * @return KErrNone - accepted, KErrCancel - Cancel or End call key
       
   103      */
       
   104     TInt QueryUserResponseL(const TDesC& aStringHolder, TInt aCoverDialogId,
       
   105             TBool aIsCancelKey);
       
   106 
       
   107     /**
       
   108      * Get attributes for the query dialog
       
   109      * The query type is idenfied by the member variable iQueryType.
       
   110      * The caller should pop and destroy the returned heap descriptor 
       
   111      * when it is no longer needed.
       
   112      * @param aCoverDialogId  Returned dialog ID for the cover UI.
       
   113      * @param aIsCancelKey    Returned info about showing the Cancel key.
       
   114      * @return                The string holder for the query. 
       
   115      */
       
   116     HBufC* GetQueryAttributesLC(TInt& aCoverDialogId, TBool& aIsCancelKey);
       
   117 
       
   118 private:
       
   119     // Data
       
   120     /**
       
   121      * Query
       
   122      * Not own, destroys self when lauched.
       
   123      */
       
   124     CAknQueryDialog* iUSBQueryDlg;  
       
   125     TUSBUIQueries iQueryType; // To store the type of the query
       
   126     TInt iDriveLetter; // For MMC locked case
       
   127 
       
   128     };
       
   129 #endif // USBUINQUERIESNOTIFIER_H