usbmgmt/usbmgr/usbman/server/INC/CPersonality.h
changeset 0 c9bc50fca66e
child 26 f3a1ae528dee
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /**
       
     2 * Copyright (c) 2004-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:
       
    15 * Implements a utility class which holds the information about a USB descriptor
       
    16 * 
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file
       
    24 */
       
    25 
       
    26 #ifndef __CPERSONALITY_H__
       
    27 #define __CPERSONALITY_H__
       
    28 
       
    29 #include <e32std.h>
       
    30 #include "CUsbDevice.h"
       
    31 
       
    32 NONSHARABLE_CLASS(CPersonality) : public CBase
       
    33 	{
       
    34 public:
       
    35 	static CPersonality* NewL();
       
    36 	~CPersonality();
       
    37 
       
    38 	TInt PersonalityId() const;
       
    39 	const RArray<TUid>& SupportedClasses() const;
       
    40 	TInt ClassSupported(TUid aClassId) const;
       
    41 	const CUsbDevice::TUsbDeviceDescriptor& DeviceDescriptor() const; 	
       
    42 	CUsbDevice::TUsbDeviceDescriptor& DeviceDescriptor(); 	
       
    43 	const TDesC* Manufacturer() const;
       
    44 	const TDesC* Product() const;
       
    45 	const TDesC* Description() const;
       
    46 	TInt AddSupportedClasses(TUid aClassId);
       
    47 	void SetId(TInt aId);
       
    48 	void SetManufacturer(const TDesC* aManufacturer);
       
    49 	void SetProduct(const TDesC* aProduct);
       
    50 	void SetDescription(const TDesC* aDescription);
       
    51 	static TInt Compare(const TUid&  aFirst, const TUid& aSecond);
       
    52 
       
    53 	const TDesC* DetailedDescription() const;
       
    54 	void SetDetailedDescription(const TDesC* aDetailedDescription);
       
    55 
       
    56 	TUint32 Property() const;
       
    57 	void SetProperty(TUint32 aProperty);
       
    58 	
       
    59 	TInt Version() const;
       
    60 	void SetVersion(TInt version);
       
    61     
       
    62 private:
       
    63 	CPersonality();
       
    64 	void ConstructL();
       
    65 
       
    66 private:
       
    67 	// personality id
       
    68 	TInt								iId;
       
    69 	// USB class ids
       
    70 	RArray<TUid>						iClassUids;
       
    71 	// textual description of manufacturer
       
    72 	HBufC*								iManufacturer;
       
    73 	// textual description of product	
       
    74 	HBufC*								iProduct;
       
    75 	// textual description of personality
       
    76 	HBufC*								iDescription;
       
    77 	// USB device descriptor struct	
       
    78 	CUsbDevice::TUsbDeviceDescriptor 	iDeviceDescriptor;
       
    79 	// detailed textual description of personality
       
    80 	HBufC*                              	iDetailedDescription;
       
    81     
       
    82 	TInt                                	iVersion;
       
    83 	TUint32								iProperty;
       
    84 	};
       
    85 
       
    86 #include "CPersonality.inl"
       
    87 	
       
    88 #endif // __CPERSONALITY_H__
       
    89