26
|
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: Implementation class for Media data provider.
|
|
15 |
* providign the data to the clients
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef _GLXMEDIALISTMULMODELPROVIDERIMPL_H_
|
|
23 |
#define _GLXMEDIALISTMULMODELPROVIDERIMPL_H_
|
|
24 |
|
|
25 |
#include <e32base.h> // Container Base Class
|
|
26 |
#include <glxmediaid.h>
|
|
27 |
#include "glxmulmodelproviderbase.h" // DataProvider Base
|
|
28 |
#include "mglxbindingobserver.h" // Notifies that binding has changed
|
|
29 |
|
|
30 |
namespace Alf
|
|
31 |
{
|
|
32 |
class IMulWidget; // An interface for all Multimedia widgets
|
|
33 |
}
|
|
34 |
|
|
35 |
// Forward declarations
|
|
36 |
class TGlxMulBindingSetFactory; // Create binding set
|
|
37 |
class CGlxAttributeRequirements; // This class will set the required attribute to the medialist
|
|
38 |
class CAlfEnv; // This is the UI Accelerator Toolkit environment object
|
|
39 |
class MGlxMediaList; // Interface for reading lists of media items
|
|
40 |
class CGlxBindingSet; // basically holds the bindings required to populate the visual item.
|
|
41 |
class CGlxResolutionUtility; // Singleton containing resolution utility methods
|
|
42 |
class CGlxUiUtility; // lib glxalfutils.lib ; Alf utils
|
|
43 |
|
|
44 |
/**
|
|
45 |
* CGlxMediaListMulModelProviderImpl
|
|
46 |
* The actual implemntation for providign the data to the clients is done here
|
|
47 |
*/
|
|
48 |
NONSHARABLE_CLASS( CGlxMediaListMulModelProviderImpl ) : public CGlxMulModelProviderBase,
|
|
49 |
public MGlxBindingObserver
|
|
50 |
{
|
|
51 |
|
|
52 |
public:
|
|
53 |
/**
|
|
54 |
* The medialist data provider uses this API to create the provider impl
|
|
55 |
* @param aEnv The Alf Environment
|
|
56 |
* @param aWidget The widget being used by client for which the model has to be set
|
|
57 |
* @param aMediaList The instance of medialist which provides data for the model
|
|
58 |
* @param aFactory The instance of the bindingset factory
|
|
59 |
* @param aDefaultTemplate The template that is being used for the widget.
|
|
60 |
*/
|
|
61 |
static CGlxMediaListMulModelProviderImpl* NewL( CAlfEnv& aEnv,
|
|
62 |
Alf::IMulWidget& aWidget,
|
|
63 |
MGlxMediaList& aMediaList,
|
|
64 |
const TGlxMulBindingSetFactory& aFactory,
|
|
65 |
Alf::mulwidget::TLogicalTemplate aDefaultTemplate,
|
|
66 |
TInt aDataWindowSize );
|
|
67 |
|
|
68 |
/**
|
|
69 |
* Destructor
|
|
70 |
*/
|
|
71 |
~CGlxMediaListMulModelProviderImpl();
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Requests the data model to update
|
|
75 |
*
|
|
76 |
* @param aIndex Position from where items have to be updated.
|
|
77 |
* @param aCount Number of items to be updated.
|
|
78 |
*/
|
|
79 |
void UpdateItems( TInt aIndex, TInt aCount );
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Enable/disable animation
|
|
83 |
* @param aAnimate - ETrue to enable the animation; EFalse Otherwise.
|
|
84 |
*/
|
|
85 |
void AnimateDRMGifItem( TBool aAnimate );
|
|
86 |
|
|
87 |
private:
|
|
88 |
/**
|
|
89 |
* Constructor
|
|
90 |
* @param aWidget The widget being used by client for which the model has to be set
|
|
91 |
* @param aMediaList The instance of medialist which provides data for the model
|
|
92 |
*/
|
|
93 |
CGlxMediaListMulModelProviderImpl( Alf::IMulWidget& aWidget, MGlxMediaList& aMediaList );
|
|
94 |
|
|
95 |
/**
|
|
96 |
* ConstructL
|
|
97 |
* @param aEnv The Alf Environment
|
|
98 |
* @param aFactory The instance of the bindingset factory
|
|
99 |
* @param aDefaultTemplate The template that is being used for the widget.
|
|
100 |
*/
|
|
101 |
void ConstructL( CAlfEnv& aEnv,
|
|
102 |
const TGlxMulBindingSetFactory& aFactory,
|
|
103 |
Alf::mulwidget::TLogicalTemplate aDefaultTemplate,
|
|
104 |
TInt aDataWindowSize );
|
|
105 |
|
|
106 |
/**
|
|
107 |
* Helper function used be HandleError
|
|
108 |
* @param aError the error code to handle.
|
|
109 |
*/
|
|
110 |
void DoHandleErrorL( TInt aError );
|
|
111 |
|
|
112 |
// From MGlxBindingObserver
|
|
113 |
void HandleBindingChanged( const CGlxBinding& aBinding );
|
|
114 |
|
|
115 |
void HandleOrientationChanged();
|
|
116 |
// From CGlxMulModelProviderBase
|
|
117 |
void HandleFocusChanged(TInt aNewFocusIndex, TInt aPreviousFocusIndex);
|
|
118 |
// From MGlxMediaListObserver
|
|
119 |
void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
|
|
120 |
void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
|
|
121 |
void HandleAttributesAvailableL( TInt aItemIndex,
|
|
122 |
const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList );
|
|
123 |
void HandleFocusChangedL( NGlxListDefs::TFocusChangeType aType,
|
|
124 |
TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList );
|
|
125 |
void HandleError( TInt aError );
|
|
126 |
//Bug fix for PKAA-7NRBYZ
|
|
127 |
void HandleItemModifiedL( const RArray<TInt>& aItemIndexes, MGlxMediaList* aList );
|
|
128 |
|
|
129 |
// From IMulModelProvider
|
|
130 |
void ProvideData (int aIndex, int aCount, Alf::MulDataPath aPath);
|
|
131 |
private:
|
|
132 |
|
|
133 |
MGlxMediaList& iMediaList;
|
|
134 |
CGlxBindingSet* iBindingSet; // own
|
|
135 |
TBool iIsReleventAttribute;
|
|
136 |
CGlxAttributeRequirements* iAttributeRequirements; // own
|
|
137 |
CGlxResolutionUtility* iResolutionUtility;
|
|
138 |
Alf::IMulWidget& iWidget;
|
|
139 |
CGlxUiUtility* iUiUtility;
|
|
140 |
TGlxMediaId iMediaIDForTextureDeletion;
|
|
141 |
};
|
|
142 |
|
|
143 |
#endif // _GLXMEDIALISTMULMODELPROVIDERIMPL_H_
|
|
144 |
|
|
145 |
|