|
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: Binding Set Factory ;Base for all Binding Set |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef _GLXBINDINGSETFACTORY_H_ |
|
22 #define _GLXBINDINGSETFACTORY_H_ |
|
23 |
|
24 #include <e32base.h> // Container Base Class |
|
25 #include <mpxattribute.h> // MPX Attribute data type class |
|
26 #include <mul/imulwidget.h> |
|
27 #include <mul/mulvisualitem.h> // Client need to use this class to add data in data model |
|
28 class CGlxBindingSet; // basically holds the bindings required to populate the visual item. |
|
29 class CMPXCollectionPath; // Encapsulates a 'bookmark' to a specific collection entry |
|
30 class MGlxBindingObserver; // Observer for Bindings |
|
31 class MGlxBoundCommand; // Handles user commands |
|
32 class TMPXAttribute; // TMPXAttribute data type class. |
|
33 class CGlxMulIconProvider; // Icon details |
|
34 |
|
35 class TGlxMulBindingSetFactory |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * CreateBindingSetL creates instance of Binding set |
|
40 * @param aObserver Binding observer |
|
41 */ |
|
42 CGlxBindingSet* CreateBindingSetL( MGlxBindingObserver& aObserver ) const; |
|
43 |
|
44 protected: |
|
45 /** |
|
46 * Constructor |
|
47 */ |
|
48 IMPORT_C TGlxMulBindingSetFactory(); |
|
49 |
|
50 /** |
|
51 * Destructor |
|
52 */ |
|
53 IMPORT_C virtual ~TGlxMulBindingSetFactory(); |
|
54 |
|
55 /** |
|
56 * Creates String binding and adds it to binding set |
|
57 * @param aMulTag Template attribute of widget |
|
58 * @param aString MPX constant string |
|
59 */ |
|
60 IMPORT_C void AddStringBindingL( const Alf::mulvisualitem::TVisualAttribute& aMulTag /*const char* const aMulTag*/, |
|
61 TInt aStringId ) const; |
|
62 |
|
63 /** |
|
64 * Creates MPX Attribute binding and adds it to binding set |
|
65 * @param aMulTag Template attribute of widget |
|
66 * @param aAttribute MPX attribute |
|
67 */ |
|
68 IMPORT_C void AddMpxAttributeBindingL( const Alf::mulvisualitem::TVisualAttribute& aMulTag /*const char* const aMulTag*/, |
|
69 const TMPXAttribute& aAttribute, TInt aFormatStringId = NULL ) const; |
|
70 |
|
71 /** |
|
72 * Creates Thumbnail binding and adds it to binding set |
|
73 * @param aMulTag Template attribute of widget |
|
74 */ |
|
75 IMPORT_C void AddThumbnailBindingL( const Alf::mulvisualitem::TVisualAttribute& aMulTag /*const char* const aMulTag*/, |
|
76 const TSize& aSize ) const; |
|
77 |
|
78 /** |
|
79 * Creates FullScreenThumbnail binding and adds it to binding set |
|
80 * @param aMulTag Template attribute of widget |
|
81 */ |
|
82 IMPORT_C void AddFullScreenThumbnailBindingL( const Alf::mulvisualitem::TVisualAttribute& aMulTag /*const char* const aMulTag*/ )const; |
|
83 |
|
84 /** |
|
85 * Creates icon binding and adds it to binding set |
|
86 * @param aMulTag Template attribute of widget |
|
87 */ |
|
88 IMPORT_C void AddIconBindingL( const Alf::mulvisualitem::TVisualAttribute& aMulTag /*const char* const aMulTag*/, |
|
89 const CGlxMulIconProvider* aMulIcon, const TSize& aSize )const; |
|
90 |
|
91 /** |
|
92 * Creates Container list binding and adds it to binding set |
|
93 * @param aMulTag Template attribute of widget |
|
94 * @param aPath MPX collection path which will be used to fetch the attributes for media item |
|
95 */ |
|
96 IMPORT_C void AddContainerListBindingL( const Alf::mulvisualitem::TVisualAttribute& aMulTag /*const char* const aMulTag*/, |
|
97 const CMPXCollectionPath& aPath ) const; |
|
98 |
|
99 /** |
|
100 * Creates command binding and adds it to binding set |
|
101 * @param aCommand command associated with option menu item/items |
|
102 */ |
|
103 /** takes ownership of aCommand */ |
|
104 IMPORT_C void AddCommandBindingL( MGlxBoundCommand* aCommand ) const; |
|
105 |
|
106 /** @param aTemplateWhenFocused template to be used when item is focused. |
|
107 * if not defined, uses aTemplate also for the focused item */ |
|
108 IMPORT_C void AddTemplateBindingL( |
|
109 Alf::mulwidget::TLogicalTemplate aTemplate, |
|
110 Alf::mulwidget::TLogicalTemplate aTemplateWhenFocused = Alf::mulwidget::KTemplateUnknown) const; |
|
111 |
|
112 /** |
|
113 * Creates preview thumbnail binding and adds it to binding set |
|
114 */ |
|
115 IMPORT_C void AddPreviewThumbnailBindingL() const; |
|
116 |
|
117 private: |
|
118 virtual void AddBindingsL() const = 0; |
|
119 |
|
120 private: |
|
121 mutable CGlxBindingSet* iBindingSet; // not own |
|
122 }; |
|
123 |
|
124 #endif // _GLXBINDINGSETFACTORY_H_ |