usbuis/usbuinotif/inc/usbuinqueriesnotifiermdrv.h
changeset 0 1e05558e2206
child 3 47c263f7e521
equal deleted inserted replaced
-1:000000000000 0:1e05558e2206
       
     1 /*
       
     2  * Copyright (c) 2005-2009 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 // CLASS DECLARATION
       
    26 
       
    27 /**
       
    28  *  This class is used to show USB query dialogs.
       
    29  *
       
    30  *  @lib 
       
    31  *  @since S60 3.0
       
    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 private:
       
    49     // Functions from base class
       
    50 
       
    51     /**
       
    52      * From CUSBUINotifierBase Called when a notifier is first loaded.        
       
    53      * @param None.
       
    54      * @return A structure containing priority and channel info.
       
    55      */
       
    56     TNotifierInfo RegisterL();
       
    57 
       
    58     /**
       
    59      * From CUSBUINotifierBase The notifier has been deactivated 
       
    60      * so resources can be freed and outstanding messages completed.
       
    61      * @param None.
       
    62      * @return None.
       
    63      */
       
    64     void Cancel();
       
    65 
       
    66     /**
       
    67      * From CUSBUINotifierBase Gets called when a request completes.
       
    68      * @param None.
       
    69      * @return None.
       
    70      */
       
    71     void RunL();
       
    72 
       
    73     /**
       
    74      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
       
    75      * store received parameters into members variables and 
       
    76      * make needed initializations.
       
    77      * @param aBuffer A buffer containing received parameters
       
    78      * @param aReplySlot A reply slot.
       
    79      * @param aMessage Should be completed when the notifier is deactivated.
       
    80      * @return None.
       
    81      */
       
    82     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
       
    83             const RMessagePtr2& aMessage);
       
    84 
       
    85 private:
       
    86     /*
       
    87      * From MEikSrvNotifierBase2 Synchronic notifier launch.        
       
    88      * @param aBuffer Received parameter data.
       
    89      * @return A pointer to return value.
       
    90      */
       
    91     virtual TPtrC8 StartL(const TDesC8& aBuffer);
       
    92 
       
    93     /**
       
    94      *  C++ default constructor.
       
    95      */
       
    96     CUSBUIQueriesNotifier();
       
    97 
       
    98 private:
       
    99     // New functions
       
   100 
       
   101     /**
       
   102      * Show query dialog 
       
   103      * @param aStringHolder   The string for the query. 
       
   104      * @param aCoverDialogId  The dialog ID for the cover UI.
       
   105      * @param aIsCancelKey    Does the dialog show Cancel key.
       
   106      * @return KErrNone - accepted, KErrCancel - Cancel or End call key
       
   107      */
       
   108     TInt QueryUserResponseL(const TDesC& aStringHolder, TInt aCoverDialogId,
       
   109             TBool aIsCancelKey);
       
   110 
       
   111     /**
       
   112      * Get attributes for the query dialog
       
   113      * The query type is idenfied by the member variable iQueryType.
       
   114      * The caller should pop and destroy the returned heap descriptor 
       
   115      * when it is no longer needed.
       
   116      * @param aCoverDialogId  Returned dialog ID for the cover UI.
       
   117      * @param aIsCancelKey    Returned info about showing the Cancel key.
       
   118      * @return                The string holder for the query. 
       
   119      */
       
   120     HBufC* GetQueryAttributesLC(TInt& aCoverDialogId, TBool& aIsCancelKey);
       
   121 
       
   122 private:
       
   123     // Data
       
   124     
       
   125     /**
       
   126     * Not own, destroys self when lauched.
       
   127     */
       
   128     CAknQueryDialog* iUSBQueryDlg;
       
   129     TUSBUIQueries iQueryType; // To store the type of the query
       
   130 
       
   131     };
       
   132 #endif // USBUINQUERIESNOTIFIER_H