|
1 /* |
|
2 * Copyright (c) 2008-2009 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: Download commmand handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 /** |
|
23 * @internal reviewed 26/06/2007 by Rowland Cook |
|
24 */ |
|
25 |
|
26 // CLASS HEADER |
|
27 #include "glxcommandhandlerdownload.h" |
|
28 |
|
29 |
|
30 // EXTERNAL INCLUDES |
|
31 #include <FavouritesLimits.h> // for favourites context IDs |
|
32 #include <BrowserLauncher.h> |
|
33 |
|
34 // INTERNAL INCLUDES |
|
35 #include <glxcommandhandlers.hrh> // for EGlxCmdDownloadImages, |
|
36 // and EGlxCmdDownloadVideos |
|
37 #include <glxlog.h> // for debug logging |
|
38 |
|
39 |
|
40 |
|
41 // LOCAL FUNCTIONS AND CONSTANTS |
|
42 |
|
43 |
|
44 |
|
45 // ---------------------------------------------------------------------------- |
|
46 // Two-phased constructor. |
|
47 // ---------------------------------------------------------------------------- |
|
48 EXPORT_C CGlxCommandHandlerDownload* CGlxCommandHandlerDownload::NewL() |
|
49 { |
|
50 CGlxCommandHandlerDownload* self = |
|
51 new (ELeave) CGlxCommandHandlerDownload(); |
|
52 CleanupStack::PushL(self); |
|
53 self->ConstructL(); |
|
54 CleanupStack::Pop(self); |
|
55 return self; |
|
56 } |
|
57 |
|
58 // ---------------------------------------------------------------------------- |
|
59 // C++ default constructor |
|
60 // ---------------------------------------------------------------------------- |
|
61 CGlxCommandHandlerDownload::CGlxCommandHandlerDownload():CGlxCommandHandler() |
|
62 { |
|
63 // nothing to do |
|
64 } |
|
65 |
|
66 // ---------------------------------------------------------------------------- |
|
67 // Symbian 2nd phase constructor can leave. |
|
68 // ---------------------------------------------------------------------------- |
|
69 void CGlxCommandHandlerDownload::ConstructL() |
|
70 { |
|
71 // No implemenation required |
|
72 } |
|
73 |
|
74 |
|
75 // ---------------------------------------------------------------------------- |
|
76 // Destructor |
|
77 // ---------------------------------------------------------------------------- |
|
78 EXPORT_C CGlxCommandHandlerDownload::~CGlxCommandHandlerDownload() |
|
79 { |
|
80 // No implemenation required |
|
81 } |
|
82 |
|
83 |
|
84 |
|
85 // ---------------------------------------------------------------------------- |
|
86 // ExecuteL |
|
87 // ---------------------------------------------------------------------------- |
|
88 TBool CGlxCommandHandlerDownload::ExecuteL(TInt aCommandId) |
|
89 { |
|
90 GLX_FUNC("CGlxCommandHandlerDownload::ExecuteL"); |
|
91 TInt contextId = KFavouritesNullContextId; |
|
92 if(aCommandId == EGlxCmdDownloadImages) |
|
93 { |
|
94 contextId = KFavouritesImageContextId; |
|
95 } |
|
96 else if(aCommandId == EGlxCmdDownloadVideos) |
|
97 { |
|
98 contextId = KFavouritesVideoContextId; |
|
99 } |
|
100 |
|
101 if(contextId != KFavouritesNullContextId) |
|
102 { |
|
103 |
|
104 // Launches the browser with specific context id |
|
105 CBrowserLauncher* browserLauncher = CBrowserLauncher::NewLC(); |
|
106 browserLauncher->LaunchBrowserSyncEmbeddedL( contextId ) ; |
|
107 CleanupStack::PopAndDestroy(browserLauncher); // browserLauncher; |
|
108 |
|
109 return ETrue; |
|
110 } |
|
111 |
|
112 return EFalse; |
|
113 } |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 // End of file |
|
119 |