|
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: Metadata view implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_GLXMETADATAVIEWIMP_H__ |
|
20 #define C_GLXMETADATAVIEWIMP_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <alf/alfwidgeteventhandler.h> |
|
24 |
|
25 #include "glxmetadataview.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MGlxMediaList; |
|
29 class CGlxDetailsMulModelProvider; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 /** |
|
33 * CGlxMetadataViewImp |
|
34 * |
|
35 * Metadata view implementation. |
|
36 */ |
|
37 NONSHARABLE_CLASS( CGlxMetadataViewImp ) : public CGlxMetadataView, public IAlfWidgetEventHandler |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * |
|
43 * @return Pointer to newly created object. |
|
44 */ |
|
45 static CGlxMetadataViewImp* NewL( MGlxMediaListFactory* aMediaListFactory ); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 * |
|
50 * @return Pointer to newly created object. |
|
51 */ |
|
52 static CGlxMetadataViewImp* NewLC( MGlxMediaListFactory* aMediaListFactory ); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CGlxMetadataViewImp(); |
|
58 |
|
59 private: |
|
60 |
|
61 /** |
|
62 * C++ default constructor. |
|
63 */ |
|
64 CGlxMetadataViewImp(); |
|
65 |
|
66 /** |
|
67 * By default Symbian 2nd phase constructor is private. |
|
68 */ |
|
69 void ConstructL( MGlxMediaListFactory* aMediaListFactory ); |
|
70 |
|
71 // From MEikMenuObserver |
|
72 void ViewDynInitMenuPaneL( TInt /*aResourceId*/, CEikMenuPane *aMenuPane ); |
|
73 |
|
74 public: // From CGlxMediaListViewBase |
|
75 |
|
76 virtual TBool HandleViewCommandL( TInt aCommand ); |
|
77 |
|
78 virtual TInt MenuResourceId(); |
|
79 |
|
80 MGlxMediaList& MediaList(); |
|
81 |
|
82 private: // from base class CGlxMediaListViewBase |
|
83 |
|
84 TUid Id() const; |
|
85 |
|
86 void DoMLViewActivateL( const TVwsViewId& /*aPrevViewId*/, |
|
87 TUid /*aCustomMessageId*/, |
|
88 const TDesC8& aCustomMessage ); |
|
89 |
|
90 void DoMLViewDeactivate(); |
|
91 |
|
92 |
|
93 public: // ialfwidgeteventhandler |
|
94 |
|
95 bool accept( CAlfWidgetControl& /*aControl*/, const TAlfEvent& /*aEvent*/ ) const; |
|
96 |
|
97 void setActiveStates( unsigned int /*aStates*/ ); |
|
98 |
|
99 AlfEventStatus offerEvent( CAlfWidgetControl& aControl, const TAlfEvent& aEvent ); |
|
100 |
|
101 IAlfInterfaceBase* makeInterface( const IfId& /*aType*/ ); |
|
102 |
|
103 void setEventHandlerData( const AlfWidgetEventHandlerInitData& /*aData*/ ); |
|
104 |
|
105 AlfWidgetEventHandlerInitData* eventHandlerData(); |
|
106 |
|
107 AlfEventHandlerType eventHandlerType() ; |
|
108 |
|
109 AlfEventHandlerExecutionPhase eventExecutionPhase() ; |
|
110 |
|
111 private : //new method |
|
112 |
|
113 /** |
|
114 * Create media list with URI filter |
|
115 * |
|
116 * @param aURI uri or file name of item |
|
117 */ |
|
118 void CreateMediaListL( const TDesC8& aURI ); |
|
119 |
|
120 /** |
|
121 * Sets the default text for the List View when empty |
|
122 */ |
|
123 void CreateEmptyText(); |
|
124 |
|
125 /** |
|
126 * Constructs the Alf Environment and display |
|
127 */ |
|
128 void ConstructAlfEnvL(); |
|
129 |
|
130 /** |
|
131 * Constructs the list widget |
|
132 */ |
|
133 void ConstructInitialViewL(); |
|
134 |
|
135 /** |
|
136 * Destroys the view Widget |
|
137 */ |
|
138 void DestroyListViewWidget(); |
|
139 |
|
140 /** |
|
141 * Send factory instance for the items to be shown in the list |
|
142 */ |
|
143 void AddListEntryL(); |
|
144 |
|
145 private: // Data |
|
146 |
|
147 MGlxMediaList* iItemMediaList;//own |
|
148 TInt iResourceOffset; |
|
149 HBufC* iItemURI; |
|
150 |
|
151 //Alf environment (not owned) |
|
152 CAlfEnv* iEnv; |
|
153 |
|
154 //Alf display (not owned) |
|
155 CAlfDisplay* iDisp; |
|
156 |
|
157 // Owns the list widget (not owned) |
|
158 IMulListWidget* iListWidget; |
|
159 IAlfViewWidget* iViewWidget; |
|
160 |
|
161 //Owns DetailsMulModelProvider |
|
162 CGlxDetailsMulModelProvider* iDetailsMulModelProvider; |
|
163 |
|
164 |
|
165 //Control gorup id |
|
166 TInt iControlGroupId; |
|
167 |
|
168 TBool iIsVideo; |
|
169 |
|
170 TBool iIsDrm; |
|
171 |
|
172 }; |
|
173 |
|
174 #endif // C_GLXMETADATAVIEWIMP_H__ |
|
175 |
|
176 // End of File |
|
177 |