usbuis/usbuinotif/inc/usbuinotifmsmmerror.h
changeset 38 218231f2b3b3
parent 35 9d8b04ca6939
child 56 f45583a69686
equal deleted inserted replaced
35:9d8b04ca6939 38:218231f2b3b3
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  Declares USB UI Queries notifier.
    14 * Description:  Declares MSMM error notifier.
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #ifndef USBUINOTIFMSMMERROR_H
    19 #ifndef USBUINOTIFMSMMERROR_H
    20 #define USBUINOTIFMSMMERROR_H
    20 #define USBUINOTIFMSMMERROR_H
    21 
    21 
    22 // INCLUDES
    22 // INCLUDES
       
    23 #include <hb/hbwidgets/hbdevicemessageboxsymbian.h>
       
    24 #include "usbnotifier.h"      // Base class
    23 
    25 
    24 #include "usbnotifier.h"      // Base class
       
    25 #include <AknQueryDialog.h>   // AVKON component
       
    26 #define KUsbUiNotifOtgGeneralQueryGranularity 3
    26 #define KUsbUiNotifOtgGeneralQueryGranularity 3
       
    27 
    27 // CLASS DECLARATION
    28 // CLASS DECLARATION
    28 
    29 
    29 /**
    30 /**
    30  *  This class is used to show general USB query.
    31  *  This class is used to show general USB query.
    31  *  Asynchronous call is required.
    32  *  Asynchronous call is required.
    32  *
    33  *
    33  *  @lib
    34  *  @lib
    34  */
    35  */
    35 NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase
    36 NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase,
       
    37                                           public MHbDeviceMessageBoxObserver
    36     {
    38     {
    37 public:
    39 public:
    38 
    40 
    39 /**
    41     /**
    40  * Possible parameter values for KUsbUiNotifMSMMError
    42      * Indexes for the strings used in KUsbUiNotifMSMMError which are mapped to 5 errors.
    41  */
    43      */
    42 enum TUsbUiNotifMSMMError
    44     enum TUsbUiNotifMSMMError
    43     {
    45         {
    44     EUsbMSMMGeneralError,	
    46         EUsbMSMMGeneralError,	
    45     EUsbMSMMUnknownFileSystem,
    47         EUsbMSMMUnknownFileSystem,
    46     EUsbMSMMOutOfMemory
    48         EUsbMSMMOutOfMemory
    47     };
    49         };
       
    50 
    48     // Constructors and destructor
    51     // Constructors and destructor
    49 
    52 
    50     /**
    53     /**
    51      * Two-phased constructor.
    54      * Two-phased constructor.
    52      */
    55      */
    54 
    57 
    55     /**
    58     /**
    56      * Destructor.
    59      * Destructor.
    57      */
    60      */
    58     virtual ~CUsbUiNotifMSMMError();
    61     virtual ~CUsbUiNotifMSMMError();
       
    62 
       
    63     /**
       
    64      * Call back function to observe device message box closing.
       
    65      * @param aMessageBox Pointer to the closing message box instance.
       
    66      * @param aButton Button that was pressed.
       
    67      */
       
    68     void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox,
       
    69         CHbDeviceMessageBoxSymbian::TButtonId aButton);
    59 
    70 
    60 protected:
    71 protected:
    61 
    72 
    62     /**
    73     /**
    63      * Second phase contructor
    74      * Second phase contructor
    79      * so resources can be freed and outstanding messages completed.
    90      * so resources can be freed and outstanding messages completed.
    80      */
    91      */
    81     void Cancel();
    92     void Cancel();
    82 
    93 
    83     /**
    94     /**
    84      * From CUSBUINotifierBase Gets called when a request completes.
       
    85      */
       
    86     void RunL();
       
    87 
       
    88     /**
       
    89      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    95      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    90      * store received parameters into members variables and 
    96      * store received parameters into members variables and 
    91      * make needed initializations.
    97      * make needed initializations.
    92      * @param aBuffer A buffer containing received parameters
    98      * @param aBuffer A buffer containing received parameters
    93      * @param aReplySlot A reply slot.
    99      * @param aReplySlot A reply slot.
    94      * @param aMessage Should be completed when the notifier is deactivated.
   100      * @param aMessage Should be completed when the notifier is deactivated.
    95      */
   101      */
    96     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
   102     void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot,
    97             const RMessagePtr2& aMessage);
   103             const RMessagePtr2& aMessage);
    98 
   104 
    99 private:
   105 private:
   100 
   106 
   101     /**
   107     /**
   104     CUsbUiNotifMSMMError();
   110     CUsbUiNotifMSMMError();
   105 
   111 
   106 private:
   112 private:
   107     // New functions
   113     // New functions
   108 
   114 
   109     /**
       
   110      * Show query dialog     
       
   111      * @return KErrNone - accepted, KErrCancel - Cancel or End call key
       
   112      */
       
   113     TInt QueryUserResponseL();
       
   114 
       
   115 private:
   115 private:
   116     // Data
   116     // Data
   117     /**
   117     CHbDeviceMessageBoxSymbian* iQuery;
   118      *  Query
   118     CDesCArrayFlat* iStringIds;
   119      *  Not own, destroys self when lauched.
   119      };
   120      */
       
   121     CAknQueryDialog* iQuery; 
       
   122     RArray<TInt> iStringIds;
       
   123     TInt iErrorId;
       
   124     };
       
   125 #endif // USBUINOTIFMSMMERROR_H
   120 #endif // USBUINOTIFMSMMERROR_H