|
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 #ifndef __CUPNPSUBSCRIBE_H_ |
|
18 #define __CUPNPSUBSCRIBE_H_ |
|
19 |
|
20 #include <e32base.h> |
|
21 #include <e32math.h> |
|
22 #include <pnpparameterbundle.h> |
|
23 |
|
24 #include "cupnpelementarray.h" |
|
25 #include "ccallbackargument.h" |
|
26 #include "ctimermappeduri.h" |
|
27 |
|
28 /* This class is used to send subscribe requests to the service point.Also the |
|
29 responses are conveyed back to the client code. |
|
30 @internalComponent |
|
31 */ |
|
32 class CUPnPSubscribe: public CBase |
|
33 { |
|
34 public: |
|
35 static CUPnPSubscribe* NewL( RSubConnection& aSubConnection , RHostResolver& aResolver); |
|
36 void SubmitRequestL( const RPnPParameterBundle& aServiceInfo ); |
|
37 void NotifyResultsL(TUint32 aFamilyId, RPnPParameterBundleBase& aBundle); |
|
38 void CancelSubscribeL( const RPnPParameterBundle& aServiceInfo); |
|
39 ~CUPnPSubscribe(); |
|
40 |
|
41 private: |
|
42 void ConstructL(); |
|
43 CUPnPSubscribe ( RSubConnection& aSubConnection , RHostResolver& aResolver); |
|
44 static TInt OnTimerExpiry( TAny* aPtr ); |
|
45 void CreateTimerEntryL(const TDesC8& aUri ,TInt aExpiryTime); |
|
46 TInt AdjustedDelay(TInt aTime); |
|
47 void MakeBundleAndNotifyL(MPnPObserver* aObserver, HBufC8* aUri); |
|
48 |
|
49 inline CUPnPElementArray* ElementArrayHandle(); |
|
50 inline RPointerArray<CTimerMappedUri>& GetTimerArray(); |
|
51 inline RPointerArray<CCallbackArgument>& GetArgumentArray(); |
|
52 |
|
53 private: |
|
54 RSubConnection& iSubConnection; |
|
55 CUPnPElementArray* iElementArray; |
|
56 RPointerArray<CTimerMappedUri> iTimerMappedArray; |
|
57 RPointerArray<CCallbackArgument> iCallbackArray; |
|
58 |
|
59 |
|
60 TCallBack iCallBack; |
|
61 TDeltaTimerEntry* iTimerEntry; |
|
62 CDeltaTimer* iDeltaTimer; |
|
63 RHostResolver& iResolver; |
|
64 CTimerMappedUri* iMappedUri; |
|
65 TBool iDuplicateStatus; |
|
66 |
|
67 }; |
|
68 |
|
69 CUPnPElementArray* CUPnPSubscribe::ElementArrayHandle() |
|
70 { |
|
71 return iElementArray; |
|
72 } |
|
73 |
|
74 /* inline method to return the RPointerArray */ |
|
75 RPointerArray<CTimerMappedUri>& CUPnPSubscribe::GetTimerArray() |
|
76 { |
|
77 return iTimerMappedArray; |
|
78 } |
|
79 RPointerArray<CCallbackArgument>& CUPnPSubscribe::GetArgumentArray() |
|
80 { |
|
81 return iCallbackArray; |
|
82 } |
|
83 |
|
84 #endif /*CUPNPSUBSCRIPTION_H_*/ |