usbuis/usbuinotif/inc/usbuincableconnectednotifier.h
changeset 34 7858bc6ead78
parent 31 dfdd8240f7c8
child 35 9d8b04ca6939
equal deleted inserted replaced
31:dfdd8240f7c8 34:7858bc6ead78
     1 /*
       
     2  * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  Declares USB Cable Connected notifier class.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef USBUINCABLECONNECTEDNOTIFIER_H
       
    19 #define USBUINCABLECONNECTEDNOTIFIER_H
       
    20 
       
    21 // INCLUDES
       
    22 
       
    23 #include <hbdevicedialogsymbian.h>
       
    24 #include <hbsymbianvariant.h>
       
    25 
       
    26 #include "usbnotifier.h" // Base class
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30  *  This class is used to show query related to the USB cable connection
       
    31  *
       
    32  *  @lib
       
    33  */
       
    34 NONSHARABLE_CLASS(CUSBUICableConnectedNotifier) : public CUSBUINotifierBase, 
       
    35     public MHbDeviceDialogObserver
       
    36     {
       
    37 public:
       
    38     // Constructors and destructor
       
    39 
       
    40     /**
       
    41      * Two-phased constructor.
       
    42      */
       
    43     static CUSBUICableConnectedNotifier* NewL();
       
    44 
       
    45     /**
       
    46      * Destructor.
       
    47      */
       
    48     virtual ~CUSBUICableConnectedNotifier();
       
    49 
       
    50 private:
       
    51     // Functions from base class
       
    52 
       
    53     /**
       
    54      * From CUSBUINotifierBase Called when a notifier is first loaded.        
       
    55      * @param None.
       
    56      * @return A structure containing priority and channel info.
       
    57      */
       
    58     TNotifierInfo RegisterL();
       
    59 
       
    60     /**
       
    61      * From CUSBUINotifierBase The notifier has been deactivated 
       
    62      * so resources can be freed and outstanding messages completed.
       
    63      * @param None.
       
    64      * @return None.
       
    65      */
       
    66     void Cancel();
       
    67 
       
    68     /**
       
    69      * From CUSBUINotifierBase Gets called when a request completes.
       
    70      * @param None.
       
    71      * @return None.
       
    72      */
       
    73     void RunL();
       
    74 
       
    75     /**
       
    76      * From CUSBUINotifierBase Used in asynchronous notifier launch to 
       
    77      * store received parameters into members variables and 
       
    78      * make needed initializations.
       
    79      * @param aBuffer A buffer containing received parameters
       
    80      * @param aReplySlot a Reply slot.
       
    81      * @param aMessage Should be completed when the notifier is deactivated.
       
    82      * @return None.
       
    83      */
       
    84     void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot,
       
    85             const RMessagePtr2& aMessage);
       
    86  
       
    87        
       
    88 private:
       
    89     // functions from MHbDeviceDialogObserver
       
    90    
       
    91     /**
       
    92     * lunches the QT usb ui setting
       
    93     * @param aData is a CHbSymbianVariantMap daya which contains the keys
       
    94     */ 
       
    95     void DataReceived(CHbSymbianVariantMap& aData);
       
    96     /*
       
    97      * Virtual function from MHbDeviceDialogObserver
       
    98      * Not implemented
       
    99      */     
       
   100     void DeviceDialogClosed(TInt aCompletionCode);
       
   101          
       
   102     
       
   103 
       
   104 private:
       
   105     //New functions
       
   106      /**
       
   107      * Get the ID for current USB personality mode
       
   108      * @param aCurrentPersonality current personality id
       
   109      */
       
   110     void GetCurrentIdL(TInt& aCurrentPersonality);
       
   111     /**
       
   112      * Get the mode name and header for current personality
       
   113      * The parameters are pushed to the cleanup stack in order
       
   114      * aDescription, aHeader.
       
   115      * @param aDescription The returned current personality string.
       
   116      * @param aHeader The header string for message query.
       
   117      */
       
   118     void GetPersonalityStringLC(HBufC*& aHeader,HBufC*& aDescription );
       
   119 
       
   120     /**
       
   121      * Runs the connected discreet note
       
   122      */
       
   123     void RunQueryL();
       
   124 
       
   125   
       
   126     /**
       
   127      * launches the (USB) application
       
   128      * @param aProcessName The process name (*.exe)
       
   129      * @param TUidType 
       
   130      */
       
   131     void LaunchApplication(const TDesC & aProcessName,const TUidType & aUidType) const;
       
   132 
       
   133     /**
       
   134      * Adds a parameter to the dialog parameters.
       
   135      */
       
   136     void AddParameterL(
       
   137             CHbSymbianVariantMap* aParameters,
       
   138             const TDesC& aKey,
       
   139             const TAny* aData,
       
   140             CHbSymbianVariant::TType aDataType);
       
   141 
       
   142 private:
       
   143     /**
       
   144      *  C++ default constructor.
       
   145      */
       
   146     CUSBUICableConnectedNotifier();
       
   147     
       
   148     CHbDeviceDialogSymbian* iDialog; 
       
   149 
       
   150     };
       
   151 #endif // USBUINCABLECONNECTEDNOTIFIER_H