usbengines/usbwatcher/src/tusbpersonalityparams.cpp
changeset 0 1e05558e2206
equal deleted inserted replaced
-1:000000000000 0:1e05558e2206
       
     1 /*
       
     2 * Copyright (c) 2006-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:  Container class for personalities
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <usbman.h>
       
    20 #include <cusbpersonalitynotifier.h>
       
    21 #include <tusbpersonalityparams.h>
       
    22 #include "debug.h"
       
    23 
       
    24 // ---------------------------------------------------------------------------
       
    25 // C++ default constructor can NOT contain any code, that might leave.
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 EXPORT_C TUsbPersonalityParams::TUsbPersonalityParams( RUsb& aUsbMan,
       
    29     CUsbPersonalityNotifier& aPersonalityNotifier )
       
    30     : iUsbMan( aUsbMan ),
       
    31       iPersonalityNotifier( aPersonalityNotifier )
       
    32     {
       
    33     LOG_FUNC
       
    34 	
       
    35     }
       
    36     
       
    37 // ---------------------------------------------------------------------------
       
    38 // C++ default destructor.
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 EXPORT_C TUsbPersonalityParams::~TUsbPersonalityParams()
       
    42     {
       
    43     LOG_FUNC
       
    44 	
       
    45     }
       
    46     
       
    47 // ---------------------------------------------------------------------------
       
    48 // Handle to USB Manager.
       
    49 // ---------------------------------------------------------------------------
       
    50 //
       
    51 EXPORT_C RUsb& TUsbPersonalityParams::UsbMan() const
       
    52     {
       
    53     LOG_FUNC
       
    54 	
       
    55     return iUsbMan;
       
    56     }
       
    57     
       
    58 // ---------------------------------------------------------------------------
       
    59 // Handle to personality notifier.
       
    60 // ---------------------------------------------------------------------------
       
    61 //
       
    62 EXPORT_C CUsbPersonalityNotifier& TUsbPersonalityParams::PersonalityNotifier() 
       
    63 	const
       
    64     {
       
    65     LOG_FUNC
       
    66 	
       
    67     return iPersonalityNotifier;    
       
    68     }
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // Set personality id. Set is done by CUsbActivePersonalityHandler.
       
    72 // ---------------------------------------------------------------------------
       
    73 //
       
    74 EXPORT_C void TUsbPersonalityParams::SetPersonalityId( TInt aPersonalityId )
       
    75     {
       
    76     LOG_FUNC
       
    77 	
       
    78     iPersonalityId = aPersonalityId;
       
    79     }
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // Currently loaded personality's id.
       
    83 // ---------------------------------------------------------------------------
       
    84 //
       
    85 EXPORT_C TInt TUsbPersonalityParams::PersonalityId() const
       
    86     {
       
    87     LOG_FUNC
       
    88 	
       
    89     return iPersonalityId;
       
    90     }
       
    91 
       
    92 // End of file