usbuis/usbuinotif/inc/usbuincableconnectednotifier.h
branchRCL_3
changeset 24 e02eb84a14d2
parent 23 25fce757be94
equal deleted inserted replaced
23:25fce757be94 24:e02eb84a14d2
     1 /*
     1 /*
     2  * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     3  * All rights reserved.
     3  * All rights reserved.
     4  * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5  * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6  * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    18 #ifndef USBUINCABLECONNECTEDNOTIFIER_H
    18 #ifndef USBUINCABLECONNECTEDNOTIFIER_H
    19 #define USBUINCABLECONNECTEDNOTIFIER_H
    19 #define USBUINCABLECONNECTEDNOTIFIER_H
    20 
    20 
    21 // INCLUDES
    21 // INCLUDES
    22 
    22 
    23 #include <hb/hbcore/hbdevicedialogsymbian.h>
    23 #include <aknlistquerydialog.h> 
    24 #include <hb/hbwidgets/hbdevicenotificationdialogsymbian.h>
    24 #include <AknQueryDialog.h>
    25 
    25 
    26 #include "usbnotifier.h" // Base class
    26 #include "usbnotifier.h" // Base class
    27 // CLASS DECLARATION
    27 // CLASS DECLARATION
    28 
    28 
    29 /**
    29 /**
    30  *  This class is used to show query related to the USB cable connection
    30  *  This class is used to show query related to the USB cable connection
    31  *
    31  *
    32  *  @lib
    32  *  @lib
    33  */
    33  */
    34 NONSHARABLE_CLASS(CUSBUICableConnectedNotifier) : public CUSBUINotifierBase, 
    34 NONSHARABLE_CLASS(CUSBUICableConnectedNotifier) : public CUSBUINotifierBase,
    35     public MHbDeviceNotificationDialogObserver
    35        public MEikCommandObserver
    36     {
    36     {
    37 public:
    37 public:
    38     // Constructors and destructor
    38     // Constructors and destructor
    39 
    39 
    40     /**
    40     /**
    64      * @return None.
    64      * @return None.
    65      */
    65      */
    66     void Cancel();
    66     void Cancel();
    67 
    67 
    68     /**
    68     /**
       
    69      * From CUSBUINotifierBase Gets called when a request completes.
       
    70      * @param None.
       
    71      * @return None.
       
    72      */
       
    73     void RunL();
       
    74 
       
    75     /**
    69      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    76      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
    70      * store received parameters into members variables and 
    77      * store received parameters into members variables and 
    71      * make needed initializations.
    78      * make needed initializations.
    72      * @param aBuffer A buffer containing received parameters
    79      * @param aBuffer A buffer containing received parameters
    73      * @param aReplySlot a Reply slot.
    80      * @param aReplySlot a Reply slot.
    74      * @param aMessage Should be completed when the notifier is deactivated.
    81      * @param aMessage Should be completed when the notifier is deactivated.
    75      * @return None.
    82      * @return None.
    76      */
    83      */
    77     void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot,
    84     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
    78             const RMessagePtr2& aMessage);
    85             const RMessagePtr2& aMessage);
    79  
    86  
    80        
       
    81 private:
       
    82     // functions from MHbDeviceNotificationDialogObserver
       
    83     /**
    87     /**
    84      * Callback function which is called when the dialog is tapped
    88      * Handles the command on USB connected note
    85      */
    89      */
    86     void NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog);
    90     void ProcessCommandL(TInt aCommandId);
    87     /**
       
    88      * Callback function which is called when the dialog is closed
       
    89      */
       
    90     void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog,
       
    91             TInt aCompletionCode);
       
    92 
    91 
    93 private:
    92 private:
    94     //New functions
    93     //New functions
    95      /**
    94      /**
    96      * Get the ID for current USB personality mode
    95      * Get the ID for current USB personality mode
    97      * @param aCurrentPersonality current personality id
    96      * @param aCurrentPersonality current personality id
    98      */
    97      */
    99     void GetCurrentIdL(TInt& aCurrentPersonality);
    98     void GetCurrentIdL(TInt& aCurrentPersonality);
       
    99 
   100     /**
   100     /**
   101      * Get the mode name and header for current personality
   101      * Get the mode name and header for current personality
   102      * The parameters are pushed to the cleanup stack in order
       
   103      * aDescription, aHeader.
       
   104      * @param aDescription The returned current personality string.
   102      * @param aDescription The returned current personality string.
   105      * @param aHeader The header string for message query.
   103      * @param aHeader The header string for message query.
   106      */
   104      */
   107     void GetPersonalityStringLC(HBufC*& aHeader,HBufC*& aDescription );
   105     void GetPersonalityStringL(HBufC*& aHeader,HBufC*& aDescription );
   108 
   106 
   109      /**
   107     /**
   110      * launches the (USB) application
   108      * Runs the connected discreet note
   111      * @param aProcessName The process name (*.exe)
   109      */
       
   110     void RunQueryL();
       
   111   
       
   112     /**
       
   113      * creates the USB UI setting view
       
   114      * @param aProcessName The process name (USBClassChangeUI.exe)
   112      * @param TUidType 
   115      * @param TUidType 
   113      */
   116      */
   114     void LaunchApplication(const TDesC & aProcessName,const TUidType & aUidType) const;
   117     void CreateChosenViewL(const TDesC & aProcessName,const TUidType & aUidType) const;
   115 
   118 
   116 private:
   119 private:
   117     /**
   120     /**
   118      *  C++ default constructor.
   121      *  C++ default constructor.
   119      */
   122      */
   120     CUSBUICableConnectedNotifier();
   123     CUSBUICableConnectedNotifier();
   121     
   124     
   122     CHbDeviceNotificationDialogSymbian* iDialog; 
   125     /**
       
   126      * Waiter for canceling notifier. Canceling is not posible when note is visible
       
   127      */
       
   128     CActiveSchedulerWait    iNoteWaiter;    
       
   129     
       
   130     /**
       
   131      * Note visible
       
   132      */
       
   133     TBool   iNoteVisible;
       
   134 
       
   135     /**
       
   136      * Note tapped
       
   137      */
       
   138     TBool   iNoteTapped;
   123 
   139 
   124     };
   140     };
       
   141 
   125 #endif // USBUINCABLECONNECTEDNOTIFIER_H
   142 #endif // USBUINCABLECONNECTEDNOTIFIER_H