|
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: bindings required to populate the visual item |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef _GLXBINDINGSET_H_ |
|
22 #define _GLXBINDINGSET_H_ |
|
23 |
|
24 #include <e32base.h> // Container Base Class |
|
25 #include "glxbinding.h" // holds the bindings required to populate the visual item |
|
26 #include "mglxbindingobserver.h" // Notifies that binding has changed |
|
27 |
|
28 class TGlxMedia; // media item in the item pool |
|
29 |
|
30 namespace Alf |
|
31 { |
|
32 class MulVisualItem; // Client need to use this class to add data in data model |
|
33 } |
|
34 |
|
35 class CGlxAttributeRequirements; // class will set the required attribute to the medialist |
|
36 |
|
37 /** |
|
38 * CGlxBindingSet |
|
39 * The binding set is created by the binding set factory. |
|
40 * This basically holds the bindings required to populate the visual item. |
|
41 */ |
|
42 NONSHARABLE_CLASS( CGlxBindingSet ) : public CGlxBinding, public MGlxBindingObserver |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * Two phase construction |
|
47 * @param aObserver Observes binding |
|
48 */ |
|
49 static CGlxBindingSet* NewLC( MGlxBindingObserver& aObserver ); |
|
50 |
|
51 /** |
|
52 *Destructor |
|
53 */ |
|
54 ~CGlxBindingSet(); |
|
55 |
|
56 /** |
|
57 * Adds the bindings to the binding set |
|
58 * @param aBinding The binding to be added to the binding set : owned |
|
59 */ |
|
60 void AddBindingL( CGlxBinding* aBinding ); |
|
61 |
|
62 // From CGlxBinding |
|
63 void PopulateT( Alf::MulVisualItem& aItem, const TGlxMedia& aMedia, |
|
64 TBool aIsFocused ) const; |
|
65 TBool HasRelevantAttributes( const RArray< TMPXAttribute >& aAttributes ) const; |
|
66 |
|
67 TResponse HandleFocusChanged( TBool aIsGained ); |
|
68 |
|
69 void HandleItemChangedL(const CMPXCollectionPath& aPath ); |
|
70 /** |
|
71 * Adds the fetch context to medialist |
|
72 * @param aAttributeRequirement The object that sets the attribute to medialist |
|
73 */ |
|
74 void AddRequirementsL( CGlxAttributeRequirements& aAttributeRequirement,TSize aSize); |
|
75 |
|
76 private: |
|
77 /** |
|
78 * Constructor |
|
79 * @param aObserver Observes binding |
|
80 */ |
|
81 CGlxBindingSet( MGlxBindingObserver& aObserver ); |
|
82 |
|
83 // From MGlxBindingObserver |
|
84 void HandleBindingChanged( const CGlxBinding& aBinding ); |
|
85 |
|
86 private: |
|
87 // Binding Observer |
|
88 MGlxBindingObserver& iObserver; |
|
89 |
|
90 // Array of Binding-Bindingset |
|
91 RPointerArray< CGlxBinding > iBindings; |
|
92 |
|
93 }; |
|
94 |
|
95 #endif // _GLXBINDINGSET_H_ |