|
1 /* |
|
2 * Copyright (c) 2002-2008 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: synchronous wrapper for ROAP |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CROAPSYNCWRAPPER_H |
|
21 #define CROAPSYNCWRAPPER_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <roapobserver.h> |
|
25 |
|
26 /** |
|
27 * Synchronous wrapper for ROAP protocol suite. |
|
28 * |
|
29 * @since Series 60 3.0 |
|
30 */ |
|
31 NONSHARABLE_CLASS(CRoapSyncWrapper) : public CActive, public Roap::MRoapObserver |
|
32 { |
|
33 public: |
|
34 |
|
35 IMPORT_C static CRoapSyncWrapper* NewL(); |
|
36 IMPORT_C virtual ~CRoapSyncWrapper(); |
|
37 |
|
38 /** |
|
39 * Handle a ROAP trigger synchronously |
|
40 * |
|
41 * @since S60 3.1 |
|
42 * @param aTrigger ROAP Trigger |
|
43 */ |
|
44 IMPORT_C void HandleTriggerL( const TDesC8& aTrigger ); |
|
45 |
|
46 |
|
47 |
|
48 /** |
|
49 * Handle a ROAP trigger synchronously without user interaction |
|
50 * |
|
51 * @since S60 3.1 |
|
52 * @param aTrigger ROAP Trigger |
|
53 * @return EFalse if the trigger cannot be handled silently, e.g. no RI |
|
54 * context exists |
|
55 */ |
|
56 IMPORT_C TBool HandleTriggerSilentlyL( const TDesC8& aTrigger ); |
|
57 |
|
58 /** |
|
59 * Handle ROAP error |
|
60 * |
|
61 * @since S60 3.1 |
|
62 * @param aError Error value returned from HandleTriggerL |
|
63 * @param aErrorUrl Buffer for error url |
|
64 */ |
|
65 IMPORT_C HBufC8* GetErrorUrlL( const TInt aError, TInt& aErrorType ); |
|
66 |
|
67 /** |
|
68 * Getter for ROAP metering postResponseUrl |
|
69 * |
|
70 * @since S60 3.2 |
|
71 * @return post reponse URL |
|
72 */ |
|
73 IMPORT_C HBufC8* GetPostResponseUrlL(); |
|
74 |
|
75 |
|
76 // From CActive. |
|
77 |
|
78 void DoCancel(); |
|
79 void RunL(); |
|
80 |
|
81 // From MRoapObserver |
|
82 |
|
83 TBool ConnectionConfL(); |
|
84 TBool ContactRiConfL(); |
|
85 TBool TransIdConfL(); |
|
86 void RightsObjectDetailsL( const RPointerArray<CDRMRights>& aRightsList ); |
|
87 void ContentDownloadInfoL( TPath& aTempFolder, TFileName& aContentName, TInt& aMaxSize ); |
|
88 void ContentDetailsL( const TDesC& aPath, const TDesC8& aType,const TUid& aAppUid ); |
|
89 void RoapProgressInfoL( const TInt aProgressInfo ); |
|
90 void ErrorUrlL( const TDesC8& aErrorUrl ); |
|
91 void PostResponseUrlL( const TDesC8& aPostResponseUrl ); |
|
92 |
|
93 private: |
|
94 |
|
95 CRoapSyncWrapper(); |
|
96 void ConstructL(); |
|
97 |
|
98 private: |
|
99 |
|
100 // Used to make asynchronous call synchronous |
|
101 CActiveSchedulerWait iWait; |
|
102 HBufC8* iErrorUrl; |
|
103 HBufC8* iPostResponseUrl; |
|
104 }; |
|
105 |
|
106 #endif // CROAPSYNCWRAPPER_H |
|
107 |
|
108 // End of File |