author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 21:19:17 +0300 | |
branch | RCL_3 |
changeset 64 | 34937ec34dac |
parent 60 | 5b3385a43d68 |
child 75 | 01504893d9cb |
permissions | -rw-r--r-- |
60 | 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: Slideshow command handler |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
||
21 |
#ifndef C_GLXCOMMANDHANDLERSLIDESHOW_H |
|
22 |
#define C_GLXCOMMANDHANDLERSLIDESHOW_H |
|
23 |
||
24 |
#include <e32base.h> |
|
25 |
#include <shwconstants.h> // for playback direction |
|
26 |
#include <glxmedialistcommandhandler.h> |
|
27 |
#include <mglxmedialistobserver.h> // for media list observer |
|
28 |
||
29 |
// Forward Declarations |
|
30 |
class CGlxDefaultAttributeContext; |
|
31 |
class MGlxMediaListProvider; |
|
32 |
class TGlxMedia; |
|
33 |
class CGlxUiUtility; |
|
34 |
||
35 |
/** |
|
36 |
* @class CGlxCommandHandlerSlideshow |
|
37 |
* |
|
38 |
* Command handler that either launches slideshow with the selected items |
|
39 |
* from a media list or launches the slideshow settings. |
|
40 |
* @internal reviewed 07/06/2007 by Kimmo Hoikka |
|
41 |
*/ |
|
42 |
NONSHARABLE_CLASS (CGlxCommandHandlerSlideshow) : |
|
43 |
public CGlxMediaListCommandHandler, |
|
44 |
public MGlxMediaListObserver |
|
45 |
{ |
|
46 |
public: |
|
47 |
/** |
|
48 |
* Two-phase constructor |
|
49 |
* @param aMediaListProvider object that provides the media list |
|
50 |
* @param aStepBack EFalse if the command handler should not change |
|
51 |
* the path's level. E.g. this may depend on whether the view's media |
|
52 |
* list contains media items or if it is a "list of lists" |
|
53 |
* @param aHasToolbarItem Whether Command Should be toolbar item (ETrue - if toolbar item) |
|
54 |
* @param aFileName resource file |
|
55 |
*/ |
|
56 |
IMPORT_C static CGlxCommandHandlerSlideshow* NewL( |
|
57 |
MGlxMediaListProvider* aMediaListProvider, TBool aStepBack, |
|
58 |
TBool aHasToolbarItem, const TDesC& aFileName); |
|
59 |
||
60 |
/** Destructor */ |
|
61 |
IMPORT_C ~CGlxCommandHandlerSlideshow(); |
|
62 |
||
63 |
protected: |
|
64 |
||
65 |
/** @ref CGlxMediaListCommandHandler::ActivateL */ |
|
66 |
void DoActivateL(TInt aViewId); |
|
67 |
/** @ref CGlxMediaListCommandHandler::DoExecuteL */ |
|
68 |
TBool DoExecuteL(TInt aCommandId, MGlxMediaList& aList); |
|
69 |
/// @ref CGlxMediaListCommandHandler::DoIsDisabled |
|
70 |
TBool DoIsDisabled(TInt aCommandId, MGlxMediaList& aList) const; |
|
71 |
/// @ref CGlxMediaListCommandHandler::BypassFiltersForExecute |
|
72 |
TBool BypassFiltersForExecute() const; |
|
64
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
73 |
/// @ref CGlxMediaListCommandHandler::DynInitMenuPaneL |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
74 |
void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane, |
34937ec34dac
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
60
diff
changeset
|
75 |
TBool aIsBrowseMode); |
60 | 76 |
/// @ref CGlxCommandHandler::PopulateToolbar |
77 |
void PopulateToolbarL(); |
|
78 |
private: // From MGlxMediaListObserver |
|
79 |
void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex, |
|
80 |
MGlxMediaList* aList); |
|
81 |
void HandleMediaL(TInt aListIndex, MGlxMediaList* aList); |
|
82 |
void HandleItemRemovedL(TInt aStartIndex, TInt aEndIndex, |
|
83 |
MGlxMediaList* aList); |
|
84 |
void HandleItemModifiedL(const RArray<TInt>& aItemIndexes, |
|
85 |
MGlxMediaList* aList); |
|
86 |
void HandleAttributesAvailableL(TInt aItemIndex, |
|
87 |
const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList); |
|
88 |
void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, |
|
89 |
TInt aOldIndex, MGlxMediaList* aList); |
|
90 |
void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList); |
|
91 |
void HandleMessageL(const CMPXMessage& aMessage, MGlxMediaList* aList); |
|
92 |
void HandlePopulatedL( MGlxMediaList* aList ); |
|
93 |
||
94 |
private: |
|
95 |
/** Second phase constructor */ |
|
96 |
void ConstructL(const TDesC& aFileName); |
|
97 |
||
98 |
/** Constructor */ |
|
99 |
CGlxCommandHandlerSlideshow(MGlxMediaListProvider* aMediaListProvider, |
|
100 |
TBool aStepBack, TBool aHasToolbarItem ); |
|
101 |
||
102 |
/** |
|
103 |
* Helper function to activate the view with the relevant playback |
|
104 |
* direction |
|
105 |
*/ |
|
106 |
void ActivateViewL( NShwSlideshow::TPlayDirection aPlaybackDirection ); |
|
107 |
||
108 |
/** |
|
109 |
* Called when the owning view is deactivated |
|
110 |
*/ |
|
111 |
void Deactivate(); |
|
112 |
||
113 |
/** |
|
114 |
* To check whether the focused container contains any slideshow playable item. |
|
115 |
* @param aCommandId The Command id |
|
116 |
* @param aList MediaList reference |
|
117 |
* @return TBool ETrue if container is not slideshow playable |
|
118 |
*/ |
|
119 |
TBool IsSlideshowNotPlayableOnFocusedContainer(TInt aCommandId, MGlxMediaList& aList); |
|
120 |
||
121 |
/** |
|
122 |
* To update the floating toolbar in case of non-touch |
|
123 |
*/ |
|
124 |
void UpdateToolbar(); |
|
125 |
||
126 |
private: |
|
127 |
// ID of owning view |
|
128 |
TInt iViewId; |
|
129 |
// Not owned - HUI utility |
|
130 |
CGlxUiUtility* iUiUtility; |
|
131 |
/// Resource file offset |
|
132 |
TInt iResourceOffset; |
|
133 |
// Flag to control where in the list we should be |
|
134 |
TBool iStepBack; |
|
135 |
// Buffer used by the stream |
|
136 |
CBufFlat* iBufFlat; |
|
137 |
// Storage buffer to pass the path to the view |
|
138 |
HBufC* iBuffer; |
|
139 |
/** Whether the command is shown in the active palette */ |
|
140 |
TBool iShowInToolbar; |
|
141 |
}; |
|
142 |
||
143 |
#endif // C_GLXCOMMANDHANDLERSLIDESHOW_H |