|
1 /* |
|
2 * Copyright (c) 1997-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 * |
|
16 */ |
|
17 |
|
18 #ifndef __ACMPORTFACTORY_H__ |
|
19 #define __ACMPORTFACTORY_H__ |
|
20 |
|
21 #include <cs_port.h> |
|
22 #include "AcmPortObserver.h" |
|
23 #include "RegistrationPort.h" |
|
24 #include "acmcontroller.h" |
|
25 #include <e32property.h> |
|
26 #include <usb/acmconfig.h> |
|
27 |
|
28 class CCdcAcmClass; |
|
29 class CAcmPort; |
|
30 class CAcmServer; |
|
31 |
|
32 NONSHARABLE_CLASS(CAcmPortFactory) : public CSerial, |
|
33 public MAcmController, |
|
34 public MAcmPortObserver |
|
35 /** |
|
36 * Definition of concrete CSerial-derived type. |
|
37 */ |
|
38 { |
|
39 public: |
|
40 static CAcmPortFactory* NewL(); |
|
41 ~CAcmPortFactory(); |
|
42 |
|
43 private: |
|
44 CAcmPortFactory(); |
|
45 void ConstructL(); |
|
46 |
|
47 private: // from CSerial |
|
48 TSecurityPolicy PortPlatSecCapability(TUint aPort) const; |
|
49 virtual CPort* NewPortL(const TUint aUnit); |
|
50 virtual void Info(TSerialInfo &aSerialInfo); |
|
51 |
|
52 private: // from MAcmController |
|
53 TInt CreateFunctions(const TUint aNoAcms, const TUint8 aProtocolNum, const TDesC16& aAcmControlIfcName, const TDesC16& aAcmDataIfcName); |
|
54 void DestroyFunctions(const TUint aNoAcms); |
|
55 |
|
56 private: // from MAcmPortObserver |
|
57 void AcmPortClosed(const TUint aUnit); |
|
58 |
|
59 private: // utility |
|
60 void CreateFunctionL(const TUint8 aProtocolNum, const TDesC16& aAcmControlIfcName, const TDesC16& aAcmDataIfcName); |
|
61 void CheckAcmArray(); |
|
62 void LogPortsAndFunctions(); |
|
63 void PublishAcmConfig(); |
|
64 |
|
65 private: // unowned |
|
66 RPointerArray<CAcmPort> iAcmPortArray; |
|
67 |
|
68 private: // owned |
|
69 RPointerArray<CCdcAcmClass> iAcmClassArray; |
|
70 CAcmServer* iAcmServer; |
|
71 RProperty iAcmProperty; |
|
72 TPckgBuf<TPublishedAcmConfigs> iConfigBuf; |
|
73 TBool iOwned; |
|
74 }; |
|
75 |
|
76 #endif // __ACMPORTFACTORY_H__ |