usbuis/usbuinotif/inc/usbuinotifmsmmerror.h
branchRCL_3
changeset 80 e02eb84a14d2
parent 79 25fce757be94
equal deleted inserted replaced
79:25fce757be94 80:e02eb84a14d2
     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 MSMM error notifier.
    14 * Description:  Declares USB UI Queries 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>
    23 
    24 #include <hb/hbwidgets/hbdevicenotificationdialogsymbian.h>
       
    25 #include "usbnotifier.h"      // Base class
    24 #include "usbnotifier.h"      // Base class
       
    25 #include <AknQueryDialog.h>   // AVKON component
       
    26 #include "usbuinotifdialerwatcher.h"
    26 
    27 
    27 
    28 #define KUsbUiNotifOtgGeneralQueryGranularity 3
    28 // CLASS DECLARATION
    29 // CLASS DECLARATION
    29 
    30 
    30 /**
    31 /**
    31  *  This class is used to show general USB query.
    32  *  This class is used to show general USB query.
    32  *  Asynchronous call is required.
    33  *  Asynchronous call is required.
    33  *
    34  *
    34  *  @lib
    35  *  @lib
    35  */
    36  */
    36 NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase,
    37 NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase, public MDialerNotifier
    37                                           public MHbDeviceMessageBoxObserver,
       
    38                                           public MHbDeviceNotificationDialogObserver
       
    39     {
    38     {
    40 public:
    39 public:
    41 
    40 
    42     /**
    41 /**
    43      * Indexes for the strings used in KUsbUiNotifMSMMError which are mapped to 5 errors.
    42  * Possible parameter values for KUsbUiNotifMSMMError
    44      */
    43  */
    45     enum TUsbUiNotifMSMMError
    44 enum TUsbUiNotifMSMMError
    46         {
    45     {
    47         EUsbMSMMGeneralError,	
    46     EUsbMSMMGeneralError,	
    48         EUsbMSMMUnknownFileSystem,
    47     EUsbMSMMUnknownFileSystem,
    49         EUsbMSMMOutOfMemory,
    48     EUsbMSMMOutOfMemory
    50         EUsbMSMMSafeToRemove,
    49     };
    51         EUsbMSMMUnableToEject
       
    52         };
       
    53 
       
    54     // Constructors and destructor
    50     // Constructors and destructor
    55 
    51 
    56     /**
    52     /**
    57      * Two-phased constructor.
    53      * Two-phased constructor.
    58      */
    54      */
    60 
    56 
    61     /**
    57     /**
    62      * Destructor.
    58      * Destructor.
    63      */
    59      */
    64     virtual ~CUsbUiNotifMSMMError();
    60     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);
       
    73 
    61 
    74 protected:
    62 protected:
    75 
    63 
    76     /**
    64     /**
    77      * Second phase contructor
    65      * Second phase contructor
    93      * so resources can be freed and outstanding messages completed.
    81      * so resources can be freed and outstanding messages completed.
    94      */
    82      */
    95     void Cancel();
    83     void Cancel();
    96 
    84 
    97     /**
    85     /**
       
    86      * From CUSBUINotifierBase Gets called when a request completes.
       
    87      */
       
    88     void RunL();
       
    89 
       
    90     /**
    98      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    91      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    99      * store received parameters into members variables and 
    92      * store received parameters into members variables and 
   100      * make needed initializations.
    93      * make needed initializations.
   101      * @param aBuffer A buffer containing received parameters
    94      * @param aBuffer A buffer containing received parameters
   102      * @param aReplySlot A reply slot.
    95      * @param aReplySlot A reply slot.
   103      * @param aMessage Should be completed when the notifier is deactivated.
    96      * @param aMessage Should be completed when the notifier is deactivated.
   104      */
    97      */
   105     void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot,
    98     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
   106             const RMessagePtr2& aMessage);
    99             const RMessagePtr2& aMessage);
       
   100     
       
   101 private:
       
   102     
       
   103     /**
       
   104      * From MDialerNotifier     
       
   105      * The function to be when Dialaer is activated
       
   106      *          
       
   107      */
       
   108     void DialerActivated();
       
   109     
       
   110     /**
       
   111      * From MDialerNotifier     
       
   112      * The function to be when Dialaer is deactivated
       
   113      * and note can be shown again
       
   114      *          
       
   115      */
       
   116     void ReActivateDialog();
   107 
   117 
   108 private:
   118 private:
   109 
   119 
   110     /**
   120     /**
   111      *  C++ default constructor.
   121      *  C++ default constructor.
   112      */
   122      */
   113     CUsbUiNotifMSMMError();
   123     CUsbUiNotifMSMMError();
   114 
   124 
   115 private:
   125 private:
   116     // functions from MHbDeviceNotificationDialogObserver
   126     // New functions
       
   127 
   117     /**
   128     /**
   118      * Callback function which is called when the dialog is tapped
   129      * Show query dialog     
       
   130      * @return KErrNone - accepted, KErrCancel - Cancel or End call key
   119      */
   131      */
   120     void NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog);
   132     TInt QueryUserResponseL();
   121     /**
       
   122      * Callback function which is called when the dialog is closed
       
   123      */
       
   124     void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog,
       
   125             TInt aCompletionCode);
       
   126 
   133 
   127 private:
   134 private:
   128     // Data
   135     // Data
   129     CHbDeviceMessageBoxSymbian* iQuery;
   136     /**
   130     CHbDeviceNotificationDialogSymbian* iDiscreet; 
   137      *  Query
   131     CDesCArrayFlat* iStringIds;
   138      *  Not own, destroys self when lauched.
   132      };
   139      */
       
   140     CAknQueryDialog* iQuery; 
       
   141     RArray<TInt> iStringIds;
       
   142     TInt iErrorId;
       
   143     /**
       
   144      * Dialer watcher 
       
   145      * Own.
       
   146      */
       
   147     CUsbuinotifDialerWatcher* iDialerWatcher;
       
   148     /**
       
   149      * Dialog is dismissed. 
       
   150      */
       
   151     TBool iDismissed;
       
   152     };
   133 #endif // USBUINOTIFMSMMERROR_H
   153 #endif // USBUINOTIFMSMMERROR_H