|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 /** |
|
19 @file |
|
20 @publishedPartner |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef __ACMSERVER_H__ |
|
25 #define __ACMSERVER_H__ |
|
26 |
|
27 #include <e32base.h> |
|
28 |
|
29 class CAcmServerImpl; |
|
30 |
|
31 /** |
|
32 Client interface to the ACM server to create new ACM functions. |
|
33 This class is intended to be used both inside and outside Symbian to bring up |
|
34 and tear down ACM functions. |
|
35 */ |
|
36 NONSHARABLE_CLASS(RAcmServer) |
|
37 { |
|
38 public: |
|
39 /** |
|
40 Standard constructor. Does not connect the handle to the service provider. |
|
41 */ |
|
42 IMPORT_C RAcmServer(); |
|
43 |
|
44 /** |
|
45 Standard destructor. Does not disconnect the handle from the service |
|
46 provider. |
|
47 */ |
|
48 IMPORT_C ~RAcmServer(); |
|
49 |
|
50 public: |
|
51 /** |
|
52 Connects this handle to the service provider. |
|
53 @return Error. |
|
54 */ |
|
55 IMPORT_C TInt Connect(); |
|
56 |
|
57 /** |
|
58 Closes this handle to the service provider. If the handle has been |
|
59 successfully Connected, it must eventually be Closed. |
|
60 */ |
|
61 IMPORT_C void Close(); |
|
62 |
|
63 public: |
|
64 /** |
|
65 Creates aNoAcms ACM functions using the default settings. |
|
66 The default setting includes KDefaultAcmProtocolNum- protocol code 0x01 |
|
67 (Hayes compatible, from USBCDC 1.1 Table 17). |
|
68 @param aNoAcms Number of ACM functions to be created. |
|
69 @return Error. |
|
70 */ |
|
71 IMPORT_C TInt CreateFunctions(const TUint aNoAcms); |
|
72 |
|
73 /** |
|
74 Creates aNoAcms ACM functions using the protocol number given (as defined |
|
75 in USBCDC 1.1 - Table 17). |
|
76 @param aNoAcms Number of ACM functions to be created. |
|
77 @param aProtocolNum Protocol setting for the ACM functions to be created. |
|
78 @return Error. |
|
79 */ |
|
80 IMPORT_C TInt CreateFunctions(const TUint aNoAcms, const TUint8 aProtocolNum); |
|
81 |
|
82 /** |
|
83 Creates aNoAcms ACM functions using the protocol number given (as defined |
|
84 in USBCDC 1.1 - Table 17). |
|
85 @param aNoAcms Number of ACM functions to be created. |
|
86 @param aProtocolNum Protocol setting for the ACM function to be created. |
|
87 @param aAcmControlIfcName Control Interface Name for the ACM function to be created. |
|
88 @param aAcmDataIfcName Data Interface Name for the ACM function to be created. |
|
89 @return Error. |
|
90 */ |
|
91 IMPORT_C TInt CreateFunctions(const TUint aNoAcms, const TUint8 aProtocolNum, const TDesC& aAcmControlIfcName, const TDesC& aAcmDataIfcName); |
|
92 |
|
93 /** |
|
94 Destroys aNoAcms ACM functions. |
|
95 Class Controllers MUST NOT destroy more ACM functions than they have |
|
96 successfully created. |
|
97 @param aNoAcms Number of ACM interfaces to destroy. |
|
98 @return Error. |
|
99 */ |
|
100 IMPORT_C TInt DestroyFunctions(const TUint aNoAcms); |
|
101 |
|
102 private: |
|
103 /** |
|
104 Private copy constructor to avoid problems with multiple ownership of |
|
105 RAcmServerImpls. |
|
106 */ |
|
107 RAcmServer(const RAcmServer& aObjectToCopy); |
|
108 |
|
109 private: // owned |
|
110 // The 'body' used by this handle. |
|
111 CAcmServerImpl* iImpl; |
|
112 }; |
|
113 |
|
114 #endif // __ACMSERVER_H__ |