usbuis/usbuinotif/inc/usbuinotifmsmmerror.h
branchGCC_SURGE
changeset 63 ef2686f7597e
parent 25 8c311f9acc5e
parent 56 f45583a69686
equal deleted inserted replaced
40:e84fb4c9218b 63:ef2686f7597e
     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 <hb/hbwidgets/hbdevicenotificationdialogsymbian.h>
       
    25 #include "usbnotifier.h"      // Base class
    23 
    26 
    24 #include "usbnotifier.h"      // Base class
    27 
    25 #include <AknQueryDialog.h>   // AVKON component
       
    26 #define KUsbUiNotifOtgGeneralQueryGranularity 3
       
    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,
       
    38                                           public MHbDeviceNotificationDialogObserver
    36     {
    39     {
    37 public:
    40 public:
    38 
    41 
    39 /**
    42     /**
    40  * Possible parameter values for KUsbUiNotifMSMMError
    43      * Indexes for the strings used in KUsbUiNotifMSMMError which are mapped to 5 errors.
    41  */
    44      */
    42 enum TUsbUiNotifMSMMError
    45     enum TUsbUiNotifMSMMError
    43     {
    46         {
    44     EUsbMSMMGeneralError,	
    47         EUsbMSMMGeneralError,	
    45     EUsbMSMMUnknownFileSystem,
    48         EUsbMSMMUnknownFileSystem,
    46     EUsbMSMMOutOfMemory
    49         EUsbMSMMOutOfMemory,
    47     };
    50         EUsbMSMMSafeToRemove,
       
    51         EUsbMSMMUnableToEject
       
    52         };
       
    53 
    48     // Constructors and destructor
    54     // Constructors and destructor
    49 
    55 
    50     /**
    56     /**
    51      * Two-phased constructor.
    57      * Two-phased constructor.
    52      */
    58      */
    54 
    60 
    55     /**
    61     /**
    56      * Destructor.
    62      * Destructor.
    57      */
    63      */
    58     virtual ~CUsbUiNotifMSMMError();
    64     virtual ~CUsbUiNotifMSMMError();
       
    65 
       
    66     /**
       
    67      * Call back function to observe device message box closing.
       
    68      * @param aMessageBox Pointer to the closing message box instance.
       
    69      * @param aButton Button that was pressed.
       
    70      */
       
    71     void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox,
       
    72         CHbDeviceMessageBoxSymbian::TButtonId aButton);
    59 
    73 
    60 protected:
    74 protected:
    61 
    75 
    62     /**
    76     /**
    63      * Second phase contructor
    77      * Second phase contructor
    79      * so resources can be freed and outstanding messages completed.
    93      * so resources can be freed and outstanding messages completed.
    80      */
    94      */
    81     void Cancel();
    95     void Cancel();
    82 
    96 
    83     /**
    97     /**
    84      * From CUSBUINotifierBase Gets called when a request completes.
       
    85      */
       
    86     void RunL();
       
    87 
       
    88     /**
       
    89      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    98      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    90      * store received parameters into members variables and 
    99      * store received parameters into members variables and 
    91      * make needed initializations.
   100      * make needed initializations.
    92      * @param aBuffer A buffer containing received parameters
   101      * @param aBuffer A buffer containing received parameters
    93      * @param aReplySlot A reply slot.
   102      * @param aReplySlot A reply slot.
    94      * @param aMessage Should be completed when the notifier is deactivated.
   103      * @param aMessage Should be completed when the notifier is deactivated.
    95      */
   104      */
    96     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
   105     void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot,
    97             const RMessagePtr2& aMessage);
   106             const RMessagePtr2& aMessage);
    98 
   107 
    99 private:
   108 private:
   100 
   109 
   101     /**
   110     /**
   102      *  C++ default constructor.
   111      *  C++ default constructor.
   103      */
   112      */
   104     CUsbUiNotifMSMMError();
   113     CUsbUiNotifMSMMError();
   105 
   114 
   106 private:
   115 private:
   107     // New functions
   116     // functions from MHbDeviceNotificationDialogObserver
   108 
       
   109     /**
   117     /**
   110      * Show query dialog     
   118      * Callback function which is called when the dialog is tapped
   111      * @return KErrNone - accepted, KErrCancel - Cancel or End call key
       
   112      */
   119      */
   113     TInt QueryUserResponseL();
   120     void NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog);
       
   121     /**
       
   122      * Callback function which is called when the dialog is closed
       
   123      */
       
   124     void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog,
       
   125             TInt aCompletionCode);
   114 
   126 
   115 private:
   127 private:
   116     // Data
   128     // Data
   117     /**
   129     CHbDeviceMessageBoxSymbian* iQuery;
   118      *  Query
   130     CHbDeviceNotificationDialogSymbian* iDiscreet; 
   119      *  Not own, destroys self when lauched.
   131     CDesCArrayFlat* iStringIds;
   120      */
   132      };
   121     CAknQueryDialog* iQuery; 
       
   122     RArray<TInt> iStringIds;
       
   123     TInt iErrorId;
       
   124     };
       
   125 #endif // USBUINOTIFMSMMERROR_H
   133 #endif // USBUINOTIFMSMMERROR_H