usbuis/usbuinotif/inc/usbuinotifotgwarning.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 connection notifier.
    14 * Description:  Declares USB OTG Warning notifier.
    15  *
    15  *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #ifndef USBUINOTIFOTGWARNING_H
    19 #ifndef USBUINOTIFOTGWARNING_H
    20 #define USBUINOTIFOTGWARNING_H
    20 #define USBUINOTIFOTGWARNING_H
    21 
    21 
    22 // INCLUDES
    22 // INCLUDES
    23 #include <aknnotewrappers.h>
    23 
    24 #include <usbuinotif.h>
    24 #include <usbuinotif.h>
       
    25 #include <hb/hbwidgets/hbdevicemessageboxsymbian.h>
    25 
    26 
    26 #include "usbnotifier.h"   // Base class
    27 #include "usbnotifier.h"   // Base class
    27 #define KUsbUiNotifOtgGeneralNoteGranularity 1
    28 #define KUsbUiNotifOtgGeneralNoteGranularity 1
    28 // CLASS DECLARATION
    29 // CLASS DECLARATION
    29 
    30 
    30 /**
    31 /**
    31  *  This class is used to show general USB note.
    32  *  This class is used to show general USB note.
    32  *  Synchronous call is enouph.
    33  *  Synchronous call is enouph.
    33  * 
    34  * 
    34  */
    35  */
    35 NONSHARABLE_CLASS(CUsbUiNotifOtgWarning) : public CUSBUINotifierBase
    36 NONSHARABLE_CLASS(CUsbUiNotifOtgWarning) : 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 ~CUsbUiNotifOtgWarning();
    50     virtual ~CUsbUiNotifOtgWarning();
       
    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);
    49 
    58 
    50 protected:
    59 protected:
    51 
    60 
    52     /**
    61     /**
    53      * Second phase contructor
    62      * Second phase contructor
    70      * so resources can be freed and outstanding messages completed.
    79      * so resources can be freed and outstanding messages completed.
    71      */
    80      */
    72     void Cancel();
    81     void Cancel();
    73 
    82 
    74     /**
    83     /**
    75      * From CUSBUINotifierBase. Gets called when a request completes.
       
    76      * @param None.
       
    77      * @return None.
       
    78      */
       
    79     void RunL();
       
    80 
       
    81     /**
       
    82      * From CUSBUINotifierBase. Used in asynchronous notifier launch to 
    84      * From CUSBUINotifierBase. Used in asynchronous notifier launch to 
    83      * store received parameters into members variables and 
    85      * store received parameters into members variables and 
    84      * make needed initializations.
    86      * make needed initializations.
    85      * @param aBuffer A buffer containing received parameters
    87      * @param aBuffer A buffer containing received parameters
    86      * @param aReplySlot A reply slot.
    88      * @param aReplySlot A reply slot.
    87      * @param aMessage Should be completed when the notifier is deactivated.
    89      * @param aMessage Should be completed when the notifier is deactivated.
    88      * @return None.
    90      * @return None.
    89      */
    91      */
    90     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
    92     void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot,
    91             const RMessagePtr2& aMessage);
    93             const RMessagePtr2& aMessage);
    92 
    94 
    93 private:
    95 private:
    94 
    96 
    95     /**
    97     /**
    96      *  C++ default constructor.
    98      *  C++ default constructor.
    97      */
    99      */
    98     CUsbUiNotifOtgWarning();
   100     CUsbUiNotifOtgWarning();
    99 
   101 
   100     /**
       
   101      * Publish the dialog to the cover UI
       
   102      * The cover UI may use the personality ID or the localized
       
   103      * personality name e.g. "Mass storage". 
       
   104      * @param aNote           The dialog to be published.
       
   105      * @param aPersonalityId  The personality ID.
       
   106      * @param aLocalizedPersonalityDescriptor The personality as a string.
       
   107      */
       
   108     void
       
   109             PublishToCoverUiL(CAknResourceNoteDialog* aNote,
       
   110                     TInt aPersonalityId,
       
   111                     const HBufC* aLocalizedPersonalityDescriptor);
       
   112 
       
   113 private:
   102 private:
   114     // data
   103     // data
   115     RArray<TInt> iStringIds;
   104     CDesCArrayFlat* iStringIds;
   116 
   105 
   117     //Own
   106     //Own
   118     CAknResourceNoteDialog* iNote;
   107     CHbDeviceMessageBoxSymbian* iNote;
   119 
   108 
   120     TInt iNoteId;
   109     TInt iNoteId;
   121     };
   110     };
   122 #endif // USBUINOTIFOTGWARNING_H
   111 #endif // USBUINOTIFOTGWARNING_H
   123 // End of file
   112 // End of file