1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 @prototype |
|
20 */ |
|
21 |
|
22 #ifndef MILCOMPONENTPORTIF_H |
|
23 #define MILCOMPONENTPORTIF_H |
|
24 |
|
25 #include <e32base.h> |
|
26 #include "ilifbase.h" |
|
27 #include "milcomponentif.h" |
|
28 |
|
29 class MILComponentPortIf; |
|
30 class MILComponentPortIfObserver; |
|
31 |
|
32 class CMMFBuffer; |
|
33 |
|
34 /** |
|
35 IL Component Port interface class |
|
36 */ |
|
37 class MILComponentPortIf |
|
38 { |
|
39 public: |
|
40 |
|
41 /** |
|
42 Asynchronous function used to get data from an output Port. |
|
43 |
|
44 @param aBuffer |
|
45 Reference to the buffer to be filled. |
|
46 @return An error code indicating if the function call was successful. KErrNone on success, otherwise |
|
47 another of the system-wide error codes. |
|
48 */ |
|
49 virtual TInt FillThisBuffer(CMMFBuffer& aBuffer) = 0; |
|
50 |
|
51 /** |
|
52 Asynchronous function used to deliver data to an input Port. |
|
53 |
|
54 @param aBuffer |
|
55 Reference to the buffer to be emptied. |
|
56 @return An error code indicating if the function call was successful. KErrNone on success, otherwise |
|
57 another of the system-wide error codes. |
|
58 */ |
|
59 virtual TInt EmptyThisBuffer(const CMMFBuffer& aBuffer) = 0; |
|
60 |
|
61 /** |
|
62 Called by an IL client to request tunnelling between the component's port represented by this |
|
63 interface and the component's port represented by the port interface passed as a parameter. |
|
64 It can also be called by an IL client to request tearing down an existing tunnel by passing a NULL |
|
65 port argument. |
|
66 |
|
67 @param aPort |
|
68 The port interface representing the port to be tunelled to, or NULL to disconnect tunnel. |
|
69 @return An error code indicating if the function call was successful. KErrNone on success, otherwise |
|
70 another of the system-wide error codes. |
|
71 */ |
|
72 virtual TInt TunnelRequest(MILComponentPortIf* aPort) = 0; |
|
73 |
|
74 /** |
|
75 Called by a component to get the index of this port. |
|
76 |
|
77 @return An integer specifying the index of this port. |
|
78 */ |
|
79 virtual TInt PortIndex() const = 0; |
|
80 |
|
81 /** |
|
82 Called by a component to get the direction of this port. |
|
83 |
|
84 @return The direction of this port |
|
85 */ |
|
86 virtual TPortDirection PortDirection() const = 0; |
|
87 |
|
88 /** |
|
89 Synchronous function used to instruct the port to create a buffer. |
|
90 |
|
91 @param aBufferSize |
|
92 The size of the buffer to be created. |
|
93 @leave KErrNoMemory if not sufficient memory available when creating the buffer. |
|
94 @return A pointer to the newly created buffer. |
|
95 */ |
|
96 virtual CMMFBuffer* CreateBufferL(TInt aBufferSize) = 0; |
|
97 |
|
98 /** |
|
99 Synchronous function used to instruct the Port to use the buffer passed |
|
100 in the function's argument. |
|
101 |
|
102 @param aBuffer |
|
103 A reference to the buffer to be used by the Port. |
|
104 @return An error code indicating if the function call was successful. |
|
105 KErrNone on success, otherwise another of the system-wide error codes. |
|
106 */ |
|
107 virtual TInt UseBuffer(CMMFBuffer& aBuffer) = 0; |
|
108 |
|
109 /** |
|
110 Synchronous function used to instruct the port to free the buffer passed |
|
111 in the function's argument. |
|
112 |
|
113 @param aBuffer |
|
114 The buffer to be freed |
|
115 @return An error code indicating if the function call was successful. |
|
116 KErrNone on success, otherwise another of the system-wide error codes. |
|
117 */ |
|
118 virtual TInt FreeBuffer(CMMFBuffer* aBuffer) = 0; |
|
119 |
|
120 /** |
|
121 Asynchronous function used to flush this port. |
|
122 |
|
123 @return An error code indicating if the function call was successful. |
|
124 KErrNone on success, otherwise another of the system-wide error codes. |
|
125 */ |
|
126 virtual TInt FlushPort() = 0; |
|
127 |
|
128 /** |
|
129 Asynchronous function used to enable this port. |
|
130 |
|
131 @return An error code indicating if the function call was successful. |
|
132 KErrNone on success, otherwise another of the system-wide error codes. |
|
133 */ |
|
134 virtual TInt EnablePort() = 0; |
|
135 |
|
136 /** |
|
137 Asynchronous function used to disable this port. |
|
138 |
|
139 @return An error code indicating if the function call was successful. |
|
140 KErrNone on success, otherwise another of the system-wide error codes. |
|
141 */ |
|
142 virtual TInt DisablePort() = 0; |
|
143 |
|
144 /** |
|
145 Synchronous function that returns a pointer to a component owning this port. |
|
146 |
|
147 @return A pointer to this port's component |
|
148 */ |
|
149 virtual MILComponentIf* PortComponent() const = 0; |
|
150 |
|
151 }; |
|
152 |
|
153 #endif // MILCOMPONENTPORTIF_H |
|