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