usbuis/usbuinotif/inc/usbuinotifmsmmerror.h
branchRCL_3
changeset 79 25fce757be94
parent 8 7e15987c4500
child 80 e02eb84a14d2
--- a/usbuis/usbuinotif/inc/usbuinotifmsmmerror.h	Thu Aug 19 10:54:11 2010 +0300
+++ b/usbuis/usbuinotif/inc/usbuinotifmsmmerror.h	Tue Aug 31 16:13:57 2010 +0300
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  Declares USB UI Queries notifier.
+* Description:  Declares MSMM error notifier.
  *
 */
 
@@ -20,12 +20,11 @@
 #define USBUINOTIFMSMMERROR_H
 
 // INCLUDES
-
+#include <hb/hbwidgets/hbdevicemessageboxsymbian.h>
+#include <hb/hbwidgets/hbdevicenotificationdialogsymbian.h>
 #include "usbnotifier.h"      // Base class
-#include <AknQueryDialog.h>   // AVKON component
-#include "usbuinotifdialerwatcher.h"
 
-#define KUsbUiNotifOtgGeneralQueryGranularity 3
+
 // CLASS DECLARATION
 
 /**
@@ -34,19 +33,24 @@
  *
  *  @lib
  */
-NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase, public MDialerNotifier
+NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase,
+                                          public MHbDeviceMessageBoxObserver,
+                                          public MHbDeviceNotificationDialogObserver
     {
 public:
 
-/**
- * Possible parameter values for KUsbUiNotifMSMMError
- */
-enum TUsbUiNotifMSMMError
-    {
-    EUsbMSMMGeneralError,	
-    EUsbMSMMUnknownFileSystem,
-    EUsbMSMMOutOfMemory
-    };
+    /**
+     * Indexes for the strings used in KUsbUiNotifMSMMError which are mapped to 5 errors.
+     */
+    enum TUsbUiNotifMSMMError
+        {
+        EUsbMSMMGeneralError,	
+        EUsbMSMMUnknownFileSystem,
+        EUsbMSMMOutOfMemory,
+        EUsbMSMMSafeToRemove,
+        EUsbMSMMUnableToEject
+        };
+
     // Constructors and destructor
 
     /**
@@ -59,6 +63,14 @@
      */
     virtual ~CUsbUiNotifMSMMError();
 
+    /**
+     * Call back function to observe device message box closing.
+     * @param aMessageBox Pointer to the closing message box instance.
+     * @param aButton Button that was pressed.
+     */
+    void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox,
+        CHbDeviceMessageBoxSymbian::TButtonId aButton);
+
 protected:
 
     /**
@@ -83,11 +95,6 @@
     void Cancel();
 
     /**
-     * From CUSBUINotifierBase Gets called when a request completes.
-     */
-    void RunL();
-
-    /**
      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
      * store received parameters into members variables and 
      * make needed initializations.
@@ -95,25 +102,8 @@
      * @param aReplySlot A reply slot.
      * @param aMessage Should be completed when the notifier is deactivated.
      */
-    void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
+    void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot,
             const RMessagePtr2& aMessage);
-    
-private:
-    
-    /**
-     * From MDialerNotifier     
-     * The function to be when Dialaer is activated
-     *          
-     */
-    void DialerActivated();
-    
-    /**
-     * From MDialerNotifier     
-     * The function to be when Dialaer is deactivated
-     * and note can be shown again
-     *          
-     */
-    void ReActivateDialog();
 
 private:
 
@@ -123,31 +113,21 @@
     CUsbUiNotifMSMMError();
 
 private:
-    // New functions
-
+    // functions from MHbDeviceNotificationDialogObserver
     /**
-     * Show query dialog     
-     * @return KErrNone - accepted, KErrCancel - Cancel or End call key
+     * Callback function which is called when the dialog is tapped
      */
-    TInt QueryUserResponseL();
+    void NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog);
+    /**
+     * Callback function which is called when the dialog is closed
+     */
+    void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog,
+            TInt aCompletionCode);
 
 private:
     // Data
-    /**
-     *  Query
-     *  Not own, destroys self when lauched.
-     */
-    CAknQueryDialog* iQuery; 
-    RArray<TInt> iStringIds;
-    TInt iErrorId;
-    /**
-     * Dialer watcher 
-     * Own.
-     */
-    CUsbuinotifDialerWatcher* iDialerWatcher;
-    /**
-     * Dialog is dismissed. 
-     */
-    TBool iDismissed;
-    };
+    CHbDeviceMessageBoxSymbian* iQuery;
+    CHbDeviceNotificationDialogSymbian* iDiscreet; 
+    CDesCArrayFlat* iStringIds;
+     };
 #endif // USBUINOTIFMSMMERROR_H