usbuis/usbuinotif/inc/usbuinotifotgwarning.h
branchGCC_SURGE
changeset 63 ef2686f7597e
parent 3 47c263f7e521
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 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 // CLASS DECLARATION
    28 // CLASS DECLARATION
    29 
    29 
    30 /**
    30 /**
    31  *  This class is used to show general USB note.
    31  *  This class is used to show general USB note.
    32  *  Synchronous call is enouph.
    32  *  Synchronous call is enouph.
    33  * 
    33  * 
    34  */
    34  */
    35 NONSHARABLE_CLASS(CUsbUiNotifOtgWarning) : public CUSBUINotifierBase
    35 NONSHARABLE_CLASS(CUsbUiNotifOtgWarning) : 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 ~CUsbUiNotifOtgWarning();
    49     virtual ~CUsbUiNotifOtgWarning();
       
    50     /**
       
    51        * Call back function to observe device message box closing.
       
    52        * @param aMessageBox Pointer to the closing message box instance.
       
    53        * @param aButton Button that was pressed.
       
    54        */
       
    55     void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox,
       
    56           CHbDeviceMessageBoxSymbian::TButtonId aButton);
    49 
    57 
    50 protected:
    58 protected:
    51 
    59 
    52     /**
    60     /**
    53      * Second phase contructor
    61      * Second phase contructor
    70      * so resources can be freed and outstanding messages completed.
    78      * so resources can be freed and outstanding messages completed.
    71      */
    79      */
    72     void Cancel();
    80     void Cancel();
    73 
    81 
    74     /**
    82     /**
    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 
    83      * From CUSBUINotifierBase. Used in asynchronous notifier launch to 
    83      * store received parameters into members variables and 
    84      * store received parameters into members variables and 
    84      * make needed initializations.
    85      * make needed initializations.
    85      * @param aBuffer A buffer containing received parameters
    86      * @param aBuffer A buffer containing received parameters
    86      * @param aReplySlot A reply slot.
    87      * @param aReplySlot A reply slot.
    87      * @param aMessage Should be completed when the notifier is deactivated.
    88      * @param aMessage Should be completed when the notifier is deactivated.
    88      * @return None.
    89      * @return None.
    89      */
    90      */
    90     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
    91     void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot,
    91             const RMessagePtr2& aMessage);
    92             const RMessagePtr2& aMessage);
    92 
    93 
    93 private:
    94 private:
    94 
    95 
    95     /**
    96     /**
    96      *  C++ default constructor.
    97      *  C++ default constructor.
    97      */
    98      */
    98     CUsbUiNotifOtgWarning();
    99     CUsbUiNotifOtgWarning();
    99 
   100 
   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:
   101 private:
   114     // data
   102     // data
   115     RArray<TInt> iStringIds;
   103     CDesCArrayFlat* iStringIds;
   116 
   104 
   117     //Own
   105     //Own
   118     CAknResourceNoteDialog* iNote;
   106     CHbDeviceMessageBoxSymbian* iNote;
   119 
   107 
   120     TInt iNoteId;
   108     TInt iNoteId;
   121     };
   109     };
   122 #endif // USBUINOTIFOTGWARNING_H
   110 #endif // USBUINOTIFOTGWARNING_H
   123 // End of file
   111 // End of file