usbuis/usbuinotif/inc/usbuinotifotgerror.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 USB UI OTG Errors notifier.
    14 * Description:  Declares USB UI Queries 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>
    23 
    24 #include "usbnotifier.h"      // Base class
    24 #include "usbnotifier.h"      // Base class
       
    25 #include <AknQueryDialog.h>   // AVKON component
       
    26 #include "usbuinotifdialerwatcher.h"
    25 
    27 
    26 
    28 #define KUsbUiNotifOtgGeneralQueryGranularity 3
    27 // CLASS DECLARATION
    29 // CLASS DECLARATION
    28 
    30 
    29 /**
    31 /**
    30  *  This class is used to show general USB OTG errors
    32  *  This class is used to show general USB query.
    31  *  Asynchronous call is required.
    33  *  Asynchronous call is required.
    32  *
    34  *
    33  *  @lib
    35  *  @lib
    34  */
    36  */
    35 NONSHARABLE_CLASS(CUsbUiNotifOtgError) : public CUSBUINotifierBase, 
    37 NONSHARABLE_CLASS(CUsbUiNotifOtgError) : public CUSBUINotifierBase, public MDialerNotifier
    36                                         public MHbDeviceMessageBoxObserver
       
    37     {
    38     {
    38 public:
    39 public:
    39     // Constructors and destructor
    40     // Constructors and destructor
    40 
    41 
    41     /**
    42     /**
    45 
    46 
    46     /**
    47     /**
    47      * Destructor.
    48      * Destructor.
    48      */
    49      */
    49     virtual ~CUsbUiNotifOtgError();
    50     virtual ~CUsbUiNotifOtgError();
    50    
    51 
    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);
       
    58 protected:
    52 protected:
    59 
    53 
    60     /**
    54     /**
    61      * Second phase contructor
    55      * Second phase contructor
    62      */
    56      */
    77      * so resources can be freed and outstanding messages completed.
    71      * so resources can be freed and outstanding messages completed.
    78      */
    72      */
    79     void Cancel();
    73     void Cancel();
    80 
    74 
    81     /**
    75     /**
       
    76      * From CUSBUINotifierBase Gets called when a request completes.
       
    77      */
       
    78     void RunL();
       
    79 
       
    80     /**
    82      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    81      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    83      * store received parameters into members variables and 
    82      * store received parameters into members variables and 
    84      * make needed initializations.
    83      * make needed initializations.
    85      * @param aBuffer A buffer containing received parameters
    84      * @param aBuffer A buffer containing received parameters
    86      * @param aReplySlot A reply slot.
    85      * @param aReplySlot A reply slot.
    87      * @param aMessage Should be completed when the notifier is deactivated.
    86      * @param aMessage Should be completed when the notifier is deactivated.
    88      */
    87      */
    89     void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot,
    88     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
    90             const RMessagePtr2& aMessage);
    89             const RMessagePtr2& aMessage);
       
    90     
       
    91 private:
       
    92     
       
    93     /**
       
    94      * From MDialerNotifier     
       
    95      * The function to be when Dialaer is activated
       
    96      *          
       
    97      */
       
    98     void DialerActivated();
       
    99     
       
   100     /**
       
   101      * From MDialerNotifier     
       
   102      * The function to be when Dialaer is deactivated
       
   103      * and note can be shown again
       
   104      *          
       
   105      */
       
   106     void ReActivateDialog();
    91 
   107 
    92 private:
   108 private:
    93 
   109 
    94     /**
   110     /**
    95      *  C++ default constructor.
   111      *  C++ default constructor.
    96      */
   112      */
    97     CUsbUiNotifOtgError();
   113     CUsbUiNotifOtgError();
    98 
   114 
    99 private:
   115 private:
       
   116     // New functions
       
   117 
       
   118     /**
       
   119      * Show query dialog     
       
   120      * @return KErrNone - accepted, KErrCancel - Cancel or End call key
       
   121      */
       
   122     TInt QueryUserResponseL();
       
   123 
       
   124 private:
   100     // Data
   125     // Data
   101     /**
   126     /**
   102      *  Query
   127      *  Query
   103      *  Owned
   128      *  Not own, destroys self when lauched.
   104      */
   129      */
   105     CHbDeviceMessageBoxSymbian* iQuery; 
   130     CAknQueryDialog* iQuery; 
   106     CDesCArrayFlat* iStringIds;
   131     RArray<TInt> iStringIds;
       
   132     TInt iErrorId;
       
   133     /**
       
   134      * Dialer watcher 
       
   135      * Own.
       
   136      */
       
   137     CUsbuinotifDialerWatcher* iDialerWatcher;
       
   138     /**
       
   139      * Dialog is dismissed. 
       
   140      */
       
   141     TBool iDismissed;
   107     };
   142     };
   108 #endif // USBUINOTIFOTGERROR_H
   143 #endif // USBUINOTIFOTGERROR_H