|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef M_NATFWCONNECTIVITYOBSERVER_H |
|
22 #define M_NATFWCONNECTIVITYOBSERVER_H |
|
23 |
|
24 #include <e32base.h> |
|
25 |
|
26 class CNATFWCandidatePair; |
|
27 class CNATFWCandidate; |
|
28 |
|
29 /** |
|
30 * Observer interface for clients to receive events from NATFW. |
|
31 * |
|
32 * @lib natconfw.lib |
|
33 * @since S60 v3.2 |
|
34 */ |
|
35 class MNATFWConnectivityObserver |
|
36 { |
|
37 |
|
38 public: |
|
39 |
|
40 /** NAT connectivity framework events. */ |
|
41 enum TNATFWConnectivityEvent |
|
42 { |
|
43 /** Completing event for CreateSessionL. */ |
|
44 ESessionCreated = 0x0001, |
|
45 |
|
46 /** This event is triggered when a new local candidate has been |
|
47 found. Eventdata is an instance of CNATFWCandidate class. Ownership |
|
48 of the candidate is transferred. */ |
|
49 ELocalCandidateFound = 0x0002, |
|
50 |
|
51 /** Completing event for FetchCandidate(s). */ |
|
52 EFetchingCompleted = 0x0004, |
|
53 |
|
54 /** Completing event for SetReceivingStateL. */ |
|
55 EReceivingActivated = 0x0008, |
|
56 |
|
57 /** Completing event for SetReceivingStateL. */ |
|
58 EReceivingDeactivated = 0x0010, |
|
59 |
|
60 /** Completing event for SetSendingStateL. */ |
|
61 ESendingActivated = 0x0020, |
|
62 |
|
63 /** Completing event for SetSendingStateL. */ |
|
64 ESendingDeactivated = 0x0040, |
|
65 |
|
66 /** This event is triggered when a new working ICE candidate pair |
|
67 has been found. Eventdata is an instance of CNATFWCandidatePair class. |
|
68 Ownership of the candidate pair is transferred.*/ |
|
69 ECandidatePairFound = 0x0080, |
|
70 |
|
71 /** Completing event for PerformConnectivityChecksL. */ |
|
72 EConnChecksCompleted = 0x0100, |
|
73 |
|
74 /** This event is triggered when an error within a stream has occured |
|
75 and no asynchnorous operation is ongoing. Error during asynchronous |
|
76 operation is reported by completing that operation with error code.*/ |
|
77 EGeneralError = 0x0200, |
|
78 |
|
79 /** Defines all the supported events. Can only be used for registering |
|
80 and unregistering observers for events.*/ |
|
81 EAllEvents = 0x03ff |
|
82 |
|
83 }; |
|
84 |
|
85 /** |
|
86 * Notifies about NAT connectivity framework events. |
|
87 * |
|
88 * @since S60 v3.2 |
|
89 * @param aSessionId The session identifier |
|
90 * @param aStreamId The stream identifier |
|
91 * @param aEvent The event |
|
92 * @param aError The error code |
|
93 * @param aEventData Optional event data specified by particular event |
|
94 */ |
|
95 virtual void EventOccured( TUint aSessionId, TUint aStreamId, |
|
96 TNATFWConnectivityEvent aEvent, TInt aError, TAny* aEventData ) = 0; |
|
97 }; |
|
98 |
|
99 #endif // M_NATFWCONNECTIVITYOBSERVER_H |