|
1 /** @file |
|
2 * Copyright (c) 2005-2006 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: Subscribes for IP events from ipeventnotifier module |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_UPNPIPEVENTNOTIFIER_H |
|
22 #define C_UPNPIPEVENTNOTIFIER_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <e32property.h> |
|
26 #include <in_sock.h> |
|
27 |
|
28 /** |
|
29 * Observer class for getting information about IP events |
|
30 * |
|
31 * @since S60 v3.1 |
|
32 */ |
|
33 class MUpnpIPEventObserver |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * This function will be invoke if IPEvent occurs (IPAddressReady) |
|
38 */ |
|
39 virtual void IPEventOccursL() = 0; |
|
40 }; |
|
41 |
|
42 |
|
43 /** |
|
44 * Class responsible for subscribe for IP event from ipeventnotifier module. |
|
45 * We register to get notification about IPEvent::EIPReady |
|
46 * for specific interface index |
|
47 * (it has to be specific during constrution of this class). |
|
48 * To see more detail infromation please check: |
|
49 * \src\common\generic\networking\ipeventnotifier |
|
50 * |
|
51 * @since S60 v3.1 |
|
52 */ |
|
53 class CUpnpIPEventNotifier : public CActive |
|
54 { |
|
55 public: |
|
56 |
|
57 /** |
|
58 * Create a CUpnpIPEventNotifier object using two phase construction, |
|
59 * and return a pointer to the created object |
|
60 * @param aInterfaceIndex Interface index |
|
61 * @result pointer to new event notifier |
|
62 */ |
|
63 static CUpnpIPEventNotifier* NewL( TInt aInterfaceIndex ); |
|
64 |
|
65 /** |
|
66 * Destroy the object and release all memory objects |
|
67 */ |
|
68 virtual ~CUpnpIPEventNotifier(); |
|
69 |
|
70 /** |
|
71 * Subscribes for IP events |
|
72 * @param observer for notification |
|
73 */ |
|
74 void Subscribe( MUpnpIPEventObserver* aObserver ); |
|
75 |
|
76 private: |
|
77 |
|
78 /** |
|
79 * Simply constructor |
|
80 */ |
|
81 CUpnpIPEventNotifier(); |
|
82 |
|
83 /** |
|
84 * 2nd constructor |
|
85 * @param interface index |
|
86 */ |
|
87 void ConstructL( TInt aInterfaceIndex ); |
|
88 |
|
89 private: // from CActive |
|
90 |
|
91 /** |
|
92 * Invoke when asynchronous request will be completed |
|
93 * @since S60 S60 v3.1 |
|
94 */ |
|
95 void RunL(); |
|
96 |
|
97 /** |
|
98 * Invoke when asynchronous RunL leaves |
|
99 */ |
|
100 TInt RunError( TInt aErr ); |
|
101 |
|
102 /** |
|
103 * Invoke for canceling asynchronous request |
|
104 * @since S60 S60 v3.1 |
|
105 */ |
|
106 void DoCancel(); |
|
107 |
|
108 private: |
|
109 |
|
110 /* @var iProperty Property containing current IP address */ |
|
111 RProperty iProperty; |
|
112 |
|
113 /* @var iObserver Observer which should be informed in case of changes */ |
|
114 MUpnpIPEventObserver* iObserver; |
|
115 |
|
116 }; |
|
117 |
|
118 |
|
119 #endif // C_UPNPIPEVENTNOTIFIER_H |