|
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: Base class for event handlers |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "AsyncEventHandlerBase.h" |
|
22 #include "CDownloadMgrUiLibRegistry.h" |
|
23 #include "AsyncEventHandlerArray.h" |
|
24 #include "UiLibLogger.h" |
|
25 #include "DMgrUiLibPanic.h" |
|
26 #include "CUserInteractionsUtils.h" |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CAsyncEventHandlerBase::CAsyncEventHandlerBase |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 CAsyncEventHandlerBase::CAsyncEventHandlerBase |
|
35 ( RHttpDownload& aDownload, THttpDownloadEvent aEvent, |
|
36 MDownloadMgrUiLibRegModel& aRegistryModel, |
|
37 CAsyncEventHandlerArray& aOwner ) |
|
38 : CActive( KUiLibAOPriority ), |
|
39 iDownload( aDownload ), |
|
40 iEvent( aEvent ), |
|
41 iRegistryModel( aRegistryModel ), |
|
42 iOwner( aOwner ) |
|
43 { |
|
44 CActiveScheduler::Add( this ); |
|
45 // Invoke RunL |
|
46 SetActive(); |
|
47 TRequestStatus* status = &iStatus; |
|
48 User::RequestComplete( status, KErrNone ); |
|
49 } |
|
50 |
|
51 // Destructor |
|
52 CAsyncEventHandlerBase::~CAsyncEventHandlerBase() |
|
53 { |
|
54 CLOG_ENTERFN("CAsyncEventHandlerBase::~CAsyncEventHandlerBase"); |
|
55 Cancel(); |
|
56 iOwner.Remove( this ); |
|
57 CLOG_LEAVEFN("CAsyncEventHandlerBase::~CAsyncEventHandlerBase"); |
|
58 } |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // CAsyncEventHandlerBase::Download |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 RHttpDownload& CAsyncEventHandlerBase::Download() |
|
65 { |
|
66 return iDownload; |
|
67 } |
|
68 |
|
69 // ----------------------------------------------------------------------------- |
|
70 // CAsyncEventHandlerBase::Download |
|
71 // ----------------------------------------------------------------------------- |
|
72 // |
|
73 const RHttpDownload& CAsyncEventHandlerBase::Download() const |
|
74 { |
|
75 return iDownload; |
|
76 } |
|
77 |
|
78 // End of file. |