|
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: Video Playback command handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_GLXCOMMANDHANDLERVIDEOPLAYBACK_H |
|
22 #define C_GLXCOMMANDHANDLERVIDEOPLAYBACK_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <shwconstants.h> // for playback direction |
|
26 #include "glxmedialistcommandhandler.h" |
|
27 |
|
28 #include <mpxplaybackutility.h> |
|
29 #include <mpxplaybackobserver.h> |
|
30 #include <mpxviewutility.h> |
|
31 |
|
32 class MGlxMediaListProvider; |
|
33 class CGlxUiUtility; |
|
34 class CGlxDefaultAttributeContext; |
|
35 |
|
36 /** |
|
37 * @class CGlxCommandHandlerVideoPlayback |
|
38 * |
|
39 * Command handler that either launches videoplayback with the selected items |
|
40 * from a media list or launches the videoplayback settings. |
|
41 * Author: Rowland Cook |
|
42 * @internal reviewed 11/06/2007 by Alex Birkett |
|
43 */ |
|
44 NONSHARABLE_CLASS(CGlxCommandHandlerVideoPlayback) : |
|
45 public CGlxMediaListCommandHandler, |
|
46 public MGlxMediaListObserver, |
|
47 public MMPXPlaybackObserver |
|
48 { |
|
49 public: |
|
50 /** |
|
51 * Two-phase constructor |
|
52 * @param aMediaListProvider object that provides the media list |
|
53 * |
|
54 * @param aIsContainerList If ETrue, shows "videoplayback container" |
|
55 * confirmation notes and does not allow |
|
56 * deleting system items |
|
57 |
|
58 * If EFalse, shows "videoplayback item" |
|
59 * confirmation notes and does not check |
|
60 * for system items |
|
61 |
|
62 */ |
|
63 IMPORT_C static CGlxCommandHandlerVideoPlayback* NewL( |
|
64 MGlxMediaListProvider* aMediaListProvider); |
|
65 |
|
66 /** Destructor */ |
|
67 IMPORT_C ~CGlxCommandHandlerVideoPlayback(); |
|
68 |
|
69 protected: |
|
70 /** see CGlxMediaListCommandHandler::DoExcecuteL */ |
|
71 virtual TBool DoExecuteL(TInt aCommandId, MGlxMediaList& aList); |
|
72 |
|
73 /** see CGlxMediaListCommandHandler::DoIsDisabled */ |
|
74 virtual void DoDynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); |
|
75 |
|
76 private: // From MGlxMediaListObserver |
|
77 // See @ref MGlxMediaListObserver::HandleItemAddedL |
|
78 void HandleItemAddedL(TInt /* aStartIndex */, TInt /* aEndIndex */,MGlxMediaList* /* aList */) { }; |
|
79 |
|
80 // See @ref MGlxMediaListObserver::HandleMediaL |
|
81 void HandleMediaL(TInt /*aListIndex*/, MGlxMediaList* /*aList*/) { }; |
|
82 |
|
83 // See @ref MGlxMediaListObserver::HandleItemRemovedL |
|
84 void HandleItemRemovedL(TInt /*aStartIndex*/, TInt /*aEndIndex*/, MGlxMediaList* /*aList*/) { }; |
|
85 |
|
86 // See @ref MGlxMediaListObserver::HandleItemModifiedL |
|
87 void HandleItemModifiedL(const RArray<TInt>& /*aItemIndexes*/, MGlxMediaList* /*aList*/) { }; |
|
88 |
|
89 // See @ref MGlxMediaListObserver::HandleAttributesAvailableL |
|
90 void HandleAttributesAvailableL(TInt aItemIndex, const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList); |
|
91 |
|
92 // See @ref MGlxMediaListObserver::HandleFocusChangedL |
|
93 void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList); |
|
94 |
|
95 // See @ref MGlxMediaListObserver::HandleItemSelectedL |
|
96 void HandleItemSelectedL(TInt /* aIndex */, TBool /* aSelected */, MGlxMediaList* /* aList */) { }; |
|
97 |
|
98 // See @ref MGlxMediaListObserver::HandleMessageL |
|
99 void HandleMessageL(const CMPXMessage& /* aMessage */, MGlxMediaList* /* aList */) { }; |
|
100 |
|
101 private:// From MMPXPlaybackObserver |
|
102 |
|
103 void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError ); |
|
104 |
|
105 private: |
|
106 /** Second phase constructor */ |
|
107 void ConstructL(); |
|
108 |
|
109 /** |
|
110 * Constructor |
|
111 * @param aMediaListProvider The owner of the media list to use |
|
112 */ |
|
113 CGlxCommandHandlerVideoPlayback(MGlxMediaListProvider* aMediaListProvider); |
|
114 |
|
115 /** Helper function to activate the view with the relevant playback |
|
116 * direction |
|
117 */ |
|
118 void ActivateViewL(); |
|
119 |
|
120 /** Deactivate this command handler */ |
|
121 void Deactivate(); |
|
122 |
|
123 /** Activate this command handler */ |
|
124 void DoActivateL(TInt aViewId); |
|
125 |
|
126 /** Sets the ToolBar to the correct state */ |
|
127 void SetToolBar(); |
|
128 |
|
129 void DoHandlePlaybackMessageL( const CMPXMessage& aMessage ); |
|
130 |
|
131 void HandlePlaybackPlayerChangedL(); |
|
132 |
|
133 private: |
|
134 // Pointer to the CGlxHuiUtility (reference counted). |
|
135 CGlxUiUtility* iUiUtility; |
|
136 |
|
137 // Pointer to an attribute context. We own this. |
|
138 CGlxDefaultAttributeContext* iAttributeContext; |
|
139 |
|
140 // Remembers the ViewId passed in ActivateL. |
|
141 TInt iViewId; |
|
142 |
|
143 // This is current state of the Icon displayed in the toolbar |
|
144 // Initially set to EUndefined, this forces the first update |
|
145 // After that we only update the toolbar if a change is necessary |
|
146 enum TIconDisplayState { EUndefined, EVisible, EHidden }; |
|
147 TIconDisplayState iIconDisplayState; |
|
148 |
|
149 MMPXPlaybackUtility* iPlaybackUtility; |
|
150 MMPXViewUtility* iViewUtility; |
|
151 }; |
|
152 |
|
153 #endif // C_GLXCOMMANDHANDLERVIDEOPLAYBACK_H |