|
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: List view plugin implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include "glxmainlistviewplugin.h" |
|
23 |
|
24 #include <StringLoader.h> //StringLoader |
|
25 |
|
26 #include <glxcommandhandlerhelp.h> //Command Handler Help |
|
27 #include <glxcommandhandlershowviaupnp.h> //Command Handlers Show Via upnp |
|
28 #include <glxlistview.h> |
|
29 #include <glxlistviewplugin.rsg> |
|
30 |
|
31 #include "glxlistviewplugin.hrh" |
|
32 |
|
33 // --------------------------------------------------------------------------- |
|
34 // Two-phased constructor for main list view plugin. |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 CGlxMainListViewPlugin* CGlxMainListViewPlugin::NewL() |
|
38 { |
|
39 CGlxMainListViewPlugin* self = new (ELeave) CGlxMainListViewPlugin(); |
|
40 CleanupStack::PushL(self); |
|
41 self->ConstructL(); |
|
42 CleanupStack::Pop(self); |
|
43 return self; |
|
44 } |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // Symbian 2nd phase constructor can leave. |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 void CGlxMainListViewPlugin::ConstructL() |
|
51 { |
|
52 // Do nothing |
|
53 } |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // C++ default constructor can NOT contain any code, that might leave. |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 CGlxMainListViewPlugin::CGlxMainListViewPlugin() |
|
60 { |
|
61 iResourceIds.iViewId = R_GLX_MAIN_LIST_VIEW; |
|
62 iResourceIds.iMenuId = R_GLX_MAIN_LIST_VIEW_MENU; |
|
63 iResourceIds.iCbaId = R_GLX_MAIN_LIST_VIEW_SOFTKEYS; |
|
64 iResourceIds.iEmptyTextId = R_GLX_LIST_VIEW_EMPTY_TEXT; |
|
65 } |
|
66 |
|
67 // --------------------------------------------------------------------------- |
|
68 // Destructor |
|
69 // --------------------------------------------------------------------------- |
|
70 // |
|
71 CGlxMainListViewPlugin::~CGlxMainListViewPlugin() |
|
72 { |
|
73 // Do nothing |
|
74 } |
|
75 |
|
76 // --------------------------------------------------------------------------- |
|
77 // From CGlxListViewPluginBase |
|
78 // --------------------------------------------------------------------------- |
|
79 // |
|
80 CGlxListView* CGlxMainListViewPlugin::ConstructListViewLC(MGlxMediaListFactory* aMediaListFactory) |
|
81 { |
|
82 HBufC* mainTitle = StringLoader::LoadLC(R_GLX_MAIN_LIST_VIEW_TITLE); |
|
83 |
|
84 CGlxListView* listView = CGlxListView::NewL(aMediaListFactory, KGlxMainListViewImplementationUid, iResourceIds,*mainTitle); |
|
85 |
|
86 CleanupStack::PopAndDestroy(mainTitle); |
|
87 |
|
88 CleanupStack::PushL(listView); |
|
89 |
|
90 iListView = listView; |
|
91 |
|
92 return listView; |
|
93 } |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // From CGlxListViewPluginBase |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 void CGlxMainListViewPlugin::AddCommandHandlersL() |
|
100 { |
|
101 // add help command handler |
|
102 TGlxHelpContext helpInfo; |
|
103 helpInfo.iBrowseContext = LGAL_HLP_VIEW_LIST; |
|
104 iListView->AddCommandHandlerL(CGlxCommandHandlerHelp::NewL(helpInfo)); |
|
105 //add ShowViaUpnp Command Handler for stop showing |
|
106 iListView->AddCommandHandlerL(CGlxCommandHandlerShowViaUpnp::NewL(iListView, EFalse)); |
|
107 } |
|
108 |
|
109 // End of File |