|
1 // Copyright (c) 2007-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 // A class sending SUPL INIT messages via UDP |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __TE_LBSSUPLSMSTRIGGERSENDER_H__ |
|
19 #define __TE_LBSSUPLSMSTRIGGERSENDER_H__ |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalComponent |
|
24 @prototype |
|
25 */ |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <es_sock.h> |
|
29 #include <in_sock.h> |
|
30 |
|
31 |
|
32 /** |
|
33 An observer for getting notifications about the UDP messages sent. |
|
34 */ |
|
35 class MTe_LbsSuplSmsTriggerSenderObserver |
|
36 { |
|
37 public: |
|
38 /** |
|
39 Reports the result of the message sending. |
|
40 |
|
41 @param aError [In] The error code or KErrNone if successful. |
|
42 */ |
|
43 virtual void OnMessageSent(TInt aError) = 0; |
|
44 }; |
|
45 |
|
46 |
|
47 /** |
|
48 An utility class for sending UDP messages on the specified port and reporting about |
|
49 sent messages to the observer. |
|
50 */ |
|
51 class CTe_LbsSuplSmsTriggerSender : public CActive |
|
52 { |
|
53 public: |
|
54 static CTe_LbsSuplSmsTriggerSender* NewL(TInt aPort, MTe_LbsSuplSmsTriggerSenderObserver& aObserver); |
|
55 static CTe_LbsSuplSmsTriggerSender* NewLC(TInt aPort, MTe_LbsSuplSmsTriggerSenderObserver& aObserver); |
|
56 |
|
57 virtual ~CTe_LbsSuplSmsTriggerSender(); |
|
58 |
|
59 void SendMessage(const TDesC8& aMessage); |
|
60 |
|
61 private: |
|
62 CTe_LbsSuplSmsTriggerSender(MTe_LbsSuplSmsTriggerSenderObserver& aObserver); |
|
63 void ConstructL(TInt aPort); |
|
64 |
|
65 virtual void RunL(); |
|
66 virtual void DoCancel(); |
|
67 |
|
68 private: |
|
69 MTe_LbsSuplSmsTriggerSenderObserver& iObserver; |
|
70 RSocket iSocket; |
|
71 RSocketServ iSocketServ; |
|
72 TInetAddr iAddr; |
|
73 }; |
|
74 |
|
75 #endif //__TE_LBSSUPLSMSTRIGGERSENDER_H__ |
|
76 |
|
77 |