usbuis/usbuinotif/inc/usbuinotifotgerror.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 USB UI OTG Errors notifier.
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #ifndef USBUINOTIFOTGERROR_H
    19 #ifndef USBUINOTIFOTGERROR_H
    20 #define USBUINOTIFOTGERROR_H
    20 #define USBUINOTIFOTGERROR_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
    26 
    25 #include <AknQueryDialog.h>   // AVKON component
       
    26 #define KUsbUiNotifOtgGeneralQueryGranularity 3
    27 #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 OTG errors
    31  *  Asynchronous call is required.
    32  *  Asynchronous call is required.
    32  *
    33  *
    33  *  @lib
    34  *  @lib
    34  */
    35  */
    35 NONSHARABLE_CLASS(CUsbUiNotifOtgError) : public CUSBUINotifierBase
    36 NONSHARABLE_CLASS(CUsbUiNotifOtgError) : public CUSBUINotifierBase, 
       
    37                                         public MHbDeviceMessageBoxObserver
    36     {
    38     {
    37 public:
    39 public:
    38     // Constructors and destructor
    40     // Constructors and destructor
    39 
    41 
    40     /**
    42     /**
    44 
    46 
    45     /**
    47     /**
    46      * Destructor.
    48      * Destructor.
    47      */
    49      */
    48     virtual ~CUsbUiNotifOtgError();
    50     virtual ~CUsbUiNotifOtgError();
    49 
    51    
       
    52     /**
       
    53      * Call back function to observe device message box closing.
       
    54      * @param aMessageBox Pointer to the closing message box instance.
       
    55      * @param aButton Button that was pressed.
       
    56      */
       
    57     void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox,
       
    58             CHbDeviceMessageBoxSymbian::TButtonId aButton);
    50 protected:
    59 protected:
    51 
    60 
    52     /**
    61     /**
    53      * Second phase contructor
    62      * Second phase contructor
    54      */
    63      */
    69      * so resources can be freed and outstanding messages completed.
    78      * so resources can be freed and outstanding messages completed.
    70      */
    79      */
    71     void Cancel();
    80     void Cancel();
    72 
    81 
    73     /**
    82     /**
    74      * From CUSBUINotifierBase Gets called when a request completes.
       
    75      */
       
    76     void RunL();
       
    77 
       
    78     /**
       
    79      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    83      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    80      * store received parameters into members variables and 
    84      * store received parameters into members variables and 
    81      * make needed initializations.
    85      * make needed initializations.
    82      * @param aBuffer A buffer containing received parameters
    86      * @param aBuffer A buffer containing received parameters
    83      * @param aReplySlot A reply slot.
    87      * @param aReplySlot A reply slot.
    84      * @param aMessage Should be completed when the notifier is deactivated.
    88      * @param aMessage Should be completed when the notifier is deactivated.
    85      */
    89      */
    86     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
    90     void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot,
    87             const RMessagePtr2& aMessage);
    91             const RMessagePtr2& aMessage);
    88 
    92 
    89 private:
    93 private:
    90 
    94 
    91     /**
    95     /**
    92      *  C++ default constructor.
    96      *  C++ default constructor.
    93      */
    97      */
    94     CUsbUiNotifOtgError();
    98     CUsbUiNotifOtgError();
    95 
    99 
    96 private:
   100 private:
    97     // New functions
       
    98 
       
    99     /**
       
   100      * Show query dialog     
       
   101      * @return KErrNone - accepted, KErrCancel - Cancel or End call key
       
   102      */
       
   103     TInt QueryUserResponseL();
       
   104 
       
   105 private:
       
   106     // Data
   101     // Data
   107     /**
   102     /**
   108      *  Query
   103      *  Query
   109      *  Not own, destroys self when lauched.
   104      *  Owned
   110      */
   105      */
   111     CAknQueryDialog* iQuery; 
   106     CHbDeviceMessageBoxSymbian* iQuery; 
   112     RArray<TInt> iStringIds;
   107     CDesCArrayFlat* iStringIds;
   113     TInt iErrorId;
       
   114     };
   108     };
   115 #endif // USBUINOTIFOTGERROR_H
   109 #endif // USBUINOTIFOTGERROR_H