|
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: Media item list observer interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef GLXMSKCONTROLLER_H_ |
|
21 #define GLXMSKCONTROLLER_H_ |
|
22 |
|
23 |
|
24 #include <mglxmedialistobserver.h> |
|
25 #include <eikbtgpc.h> |
|
26 #include "glxviewbase.h" |
|
27 |
|
28 class CGlxUiUtility; |
|
29 |
|
30 NONSHARABLE_CLASS( CGlxMSKController ): public CBase, public MGlxMediaListObserver |
|
31 { |
|
32 public: |
|
33 /* |
|
34 * function NewL |
|
35 */ |
|
36 static CGlxMSKController* NewL (); |
|
37 |
|
38 /* |
|
39 * Adds object of CGlxMSKController to observe medialist |
|
40 * @param aList Reference of MGlxMediaList |
|
41 */ |
|
42 void AddToObserverL(MGlxMediaList& aList, CEikButtonGroupContainer* aCba); |
|
43 |
|
44 /* |
|
45 * Removes object of CGlxMSKController from medialist observer |
|
46 * @param aList Reference of MGlxMediaList |
|
47 */ |
|
48 void RemoveFromObserver (MGlxMediaList& aList); |
|
49 |
|
50 /** |
|
51 * Sets MSK status.This is called after adding CGlxMSKController |
|
52 * to medialist observer, if there is no HandleAttributeAvailable callback. |
|
53 * @param aList Pointer to MGlxMediaList |
|
54 */ |
|
55 void SetStatusOnViewActivationL( MGlxMediaList* aList ); |
|
56 |
|
57 /* |
|
58 * Sets the MSK status for the Main List view. |
|
59 */ |
|
60 void SetMainStatusL(); |
|
61 |
|
62 /* |
|
63 * Destructor |
|
64 */ |
|
65 ~CGlxMSKController(); |
|
66 |
|
67 public: //From MGlxMediaListObserver |
|
68 void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList); |
|
69 void HandleMediaL(TInt aListIndex, MGlxMediaList* aList); |
|
70 void HandleItemRemovedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList); |
|
71 void HandleItemModifiedL(const RArray<TInt>& aItemIndexes, MGlxMediaList* aList); |
|
72 void HandleAttributesAvailableL(TInt aItemIndex, const RArray<TMPXAttribute>& aAttributes, |
|
73 MGlxMediaList* aList); |
|
74 void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, |
|
75 TInt aOldIndex, MGlxMediaList* aList); |
|
76 void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList); |
|
77 void HandleMessageL(const CMPXMessage& aMessage, MGlxMediaList* aList); |
|
78 |
|
79 private: |
|
80 /* |
|
81 * Default Constructor |
|
82 */ |
|
83 CGlxMSKController(); |
|
84 |
|
85 /* |
|
86 * Sets the MSK status on every attribute available callback. |
|
87 * If attributes not available, but there are items, then this call is forced |
|
88 * by SetStatusOnViewActivationL from MediaListViewBase |
|
89 * @param aList Pointer og MGlxMediaList |
|
90 */ |
|
91 void SetStatusL( MGlxMediaList* aList ); |
|
92 |
|
93 private: |
|
94 CEikButtonGroupContainer* iCba; |
|
95 TBool iAttributeAvailable; |
|
96 CGlxUiUtility* iUiUtility; |
|
97 }; |
|
98 |
|
99 |
|
100 #endif /*GLXMSKCONTROLLER_H_*/ |