|
1 /* |
|
2 * Copyright (c) 2007 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: Observer class that the client must implement to receive notifications about |
|
15 * incoming and outgoing messages. Allows observer to observe and |
|
16 * make modifications to offered messages. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef M_MNCMMESSAGEOBSERVER_H |
|
24 #define M_MNCMMESSAGEOBSERVER_H |
|
25 |
|
26 #include <e32base.h> |
|
27 |
|
28 |
|
29 /** |
|
30 * Observer class that the client must implement to receive notifications about |
|
31 * incoming and outgoing messages. Allows observer to observe and |
|
32 * make modifications to offered messages |
|
33 * |
|
34 * @lib connectionmux.lib |
|
35 * @since S60 v3.2 |
|
36 */ |
|
37 class MNcmMessageObserver |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Called by Connection Multiplexer when incoming message is found. |
|
44 * Allows connection observer to observe and make modifications to found |
|
45 * message by offering an own copy of content with modification(s). |
|
46 * |
|
47 * @since S60 v3.2 |
|
48 * @param aStreamId The ID identifying stream |
|
49 * @param aMessage Message is a reference to constant message |
|
50 * @param aLocalAddr A stream local address. |
|
51 * @param aFromAddr A remote source address. ( From socket ) |
|
52 * @param aPeerRemoteAddr A peer remote address. |
|
53 * @return Pointer to a heap descriptor with new content for message, |
|
54 * otherwise NULL is returned. Ownership of the heap descriptor is |
|
55 * transferred to connection multiplexer ( from observer ). |
|
56 */ |
|
57 virtual HBufC8* IncomingMessageNotify( TUint aStreamId, |
|
58 const TDesC8& aMessage, const TInetAddr& aLocalAddr, |
|
59 const TInetAddr& aFromAddr, TInetAddr& aPeerRemoteAddr ) = 0; |
|
60 |
|
61 |
|
62 /** |
|
63 * Called by Connection Multiplexer when outgoing message is found. |
|
64 * Allows connection observer to observe and make modifications to found |
|
65 * message by offering an own copy of content with modification(s). |
|
66 * |
|
67 * @since S60 v3.2 |
|
68 * @param aStreamId The ID identifying stream |
|
69 * @param aConnectionId The ID identifying connection |
|
70 * @param aDestinationAddress Destination address where the packet |
|
71 * is being sent to. |
|
72 * @param aMessage Message is a reference to constant message |
|
73 * which was found |
|
74 * @return pointer to a heap descriptor with new content for message, |
|
75 * otherwise NULL is returned. Ownership of the heap descriptor is |
|
76 * transferred to multiplexer (from observer). |
|
77 */ |
|
78 virtual HBufC8* OutgoingMessageNotify( TUint aStreamId, |
|
79 TUint aConnectionId, const TInetAddr& aDestinationAddress, |
|
80 const TDesC8& aMessage ) = 0; |
|
81 }; |
|
82 |
|
83 |
|
84 #endif // M_MNCMMESSAGEOBSERVER_H |