|
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 |
|
21 #ifndef GLXTOOLBARCONTROLLER_H |
|
22 #define GLXTOOLBARCONTROLLER_H |
|
23 |
|
24 #include <mglxmedialistobserver.h> |
|
25 #include <akntoolbar.h> // For Toolbar |
|
26 |
|
27 |
|
28 NONSHARABLE_CLASS( CGlxToolbarController ): public CBase, public MGlxMediaListObserver |
|
29 { |
|
30 public: |
|
31 /* |
|
32 * function NewL |
|
33 */ |
|
34 static CGlxToolbarController* NewL (); |
|
35 |
|
36 /* |
|
37 * Adds object of CGlxToolbar to observe medialist |
|
38 * @param aList Reference of MGlxMediaList |
|
39 */ |
|
40 void AddToObserverL(MGlxMediaList& aList, CAknToolbar* aToolbar); |
|
41 |
|
42 /* |
|
43 * Removes object of CGlxToolbar from medialist observer |
|
44 * @param aList Reference of MGlxMediaList |
|
45 */ |
|
46 void RemoveFromObserver (MGlxMediaList& aList); |
|
47 |
|
48 /** |
|
49 * Sets toolbar status.This is called after adding CGlxToolbarController |
|
50 * to medialist observer, if there is no HandleAttributeAvailable callback. |
|
51 * (This is done to activate toolbar when attributes are already available in cache) |
|
52 * @param aList Pointer to MGlxMediaList |
|
53 */ |
|
54 void SetStatusOnViewActivationL( MGlxMediaList* aList ); |
|
55 |
|
56 /* |
|
57 * Sets the toolbar status on every attribute available callback. |
|
58 * If attributes not available, but there are items, then this call is forced |
|
59 * by SetStatusOnViewActivationL from MediaListViewBase |
|
60 * @param aList Pointer og MGlxMediaList |
|
61 */ |
|
62 void SetStatusL( MGlxMediaList* aList ); |
|
63 |
|
64 /* |
|
65 * Destructor |
|
66 */ |
|
67 ~CGlxToolbarController(); |
|
68 |
|
69 public: //From MGlxMediaListObserver |
|
70 void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList); |
|
71 void HandleMediaL(TInt aListIndex, MGlxMediaList* aList); |
|
72 void HandleItemRemovedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList); |
|
73 void HandleItemModifiedL(const RArray<TInt>& aItemIndexes, MGlxMediaList* aList); |
|
74 void HandleAttributesAvailableL(TInt aItemIndex, const RArray<TMPXAttribute>& aAttributes, |
|
75 MGlxMediaList* aList); |
|
76 void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, |
|
77 TInt aOldIndex, MGlxMediaList* aList); |
|
78 void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList); |
|
79 void HandleMessageL(const CMPXMessage& aMessage, MGlxMediaList* aList); |
|
80 void HandlePopulatedL( MGlxMediaList* aList ); |
|
81 |
|
82 private: |
|
83 /* |
|
84 * Default Constructor |
|
85 */ |
|
86 CGlxToolbarController(); |
|
87 |
|
88 /* Enables or disables latching on the toolbar button. |
|
89 * Used in Marking mode. |
|
90 * @param aCommandId The Command on toolbar that needs to be latched/unlatched. |
|
91 * aLatched ETrue if the command button needs to be latched. |
|
92 */ |
|
93 void EnableLatch( TInt aCommandId, TInt aLatched ); |
|
94 |
|
95 /* |
|
96 * Set toolbar items dimmed. |
|
97 * @param aDimmed Flag for the toolbar items to be dimmed. |
|
98 */ |
|
99 void SetToolbarItemsDimmed(TBool aDimmed); |
|
100 |
|
101 /** |
|
102 * To check whether OneClickUpload is supported by the Shareonline |
|
103 * application. |
|
104 * NOTE: OneClickUpload is a feature of ShareOnline 4.3 and above. Hence this function |
|
105 * ensures that the upload command works only if this version of ShareOnline is |
|
106 * available in the build. Else, Upload will not work! |
|
107 */ |
|
108 void CheckShareonlineVersionL(); |
|
109 |
|
110 private: |
|
111 CAknToolbar* iToolbar; |
|
112 TBool iAttributeAvailable; |
|
113 }; |
|
114 |
|
115 #endif /*GLXTOOLBARCONTROLLER_H*/ |
|
116 |
|
117 |