|
1 /* |
|
2 * Copyright (c) 2002-2004 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 the License "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: BrowserLauncherExtension |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef BROWSERLAUNCHEREXTENSION_H |
|
21 #define BROWSERLAUNCHEREXTENSION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <e32base.h> |
|
26 #include <AknServerApp.h> |
|
27 #include "LauncherClientService.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CBrowserLauncher; |
|
31 class CLauncherCommandAbsorbingControl; |
|
32 //class MLaunchedServerObserver; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Browser Launcher extension class. |
|
38 */ |
|
39 class CBrowserLauncherExtension : public CActive, |
|
40 public MLaunchedServerObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 static CBrowserLauncherExtension* NewL( CBrowserLauncher& aLauncher ); |
|
45 virtual ~CBrowserLauncherExtension(); |
|
46 |
|
47 public: // New functions |
|
48 |
|
49 /** |
|
50 * Wait for the Browser to finish the asynchronous execution. |
|
51 * This method uses CActiveSchedulerWait! |
|
52 * @return Exit code. |
|
53 */ |
|
54 TInt WaitBrowserToFinish(); |
|
55 |
|
56 /** |
|
57 * Set the packed laucher data. Ownership transferred. |
|
58 */ |
|
59 void SetPackedLauncherData( HBufC8* aBuf ); |
|
60 |
|
61 private: // Functions from CActive |
|
62 |
|
63 virtual void DoCancel(); |
|
64 virtual void RunL(); |
|
65 virtual TInt RunError( TInt aError ); |
|
66 |
|
67 private: // From MLaunchedServerObserver |
|
68 |
|
69 virtual void HandleServerAppExit( TInt aReason ); |
|
70 virtual void HandleReceivedDataL( TRequestStatus aStatus ); |
|
71 |
|
72 private: // Constructors |
|
73 |
|
74 CBrowserLauncherExtension( CBrowserLauncher& aLauncher ); |
|
75 void ConstructL(); |
|
76 |
|
77 public: // Data members |
|
78 |
|
79 CBrowserLauncher& iLauncher; ///< Reference to the Launcher. |
|
80 MAknServerAppExitObserver* iBrowserLauncherClientExitObserver; // uses-a |
|
81 CActiveSchedulerWait iWait; |
|
82 TInt iExitCode; |
|
83 MDownloadedContentHandler *iDownloadedContentHandler; // uses-a |
|
84 // Buffer to hold the data, that the server sends. |
|
85 // The buffer should be allocated by the client, on receiving |
|
86 // server HandleReceivedDataL() events. |
|
87 HBufC8* iReceiveBuffer; |
|
88 // The size of the buffer, which the client should allocate, to |
|
89 // create iReceiveBuffer. This value is set on handling |
|
90 // HandleReceivedDataL() event. |
|
91 TInt iBufferSize; |
|
92 // The prev member packed into a ptr |
|
93 TPckg<TInt> iBufferSizeP; |
|
94 RLauncherClientService iLauncherClientService; |
|
95 TFileName iDownloadedFileName; |
|
96 HBufC8* iPackedLauncherData; // Owned. |
|
97 |
|
98 private: |
|
99 CLauncherCommandAbsorbingControl* iCommandAbsorber; |
|
100 }; |
|
101 |
|
102 #endif // BROWSERLAUNCHEREXTENSION_H |