|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 #ifndef GLXMPXCOMMANDHANDLER_H |
|
18 #define GLXMPXCOMMANDHANDLER_H |
|
19 |
|
20 #include <QObject> |
|
21 #include<glxcommandhandler.h> |
|
22 #include <glxfiltergeneraldefs.h> |
|
23 #include <mpxcommand.h> |
|
24 #include <mglxmedialistobserver.h> |
|
25 |
|
26 #ifdef BUILD_COMMANDHANDLERBASE |
|
27 #define GLX_COMMANDHANDLERBASE_EXPORT Q_DECL_EXPORT |
|
28 #else |
|
29 #define GLX_COMMANDHANDLERBASE_EXPORT Q_DECL_IMPORT |
|
30 #endif |
|
31 class MGlxMediaList; |
|
32 |
|
33 class GLX_COMMANDHANDLERBASE_EXPORT GlxMpxCommandHandler : public GlxCommandHandler, public MGlxMediaListObserver |
|
34 { |
|
35 public: |
|
36 GlxMpxCommandHandler(); |
|
37 virtual ~GlxMpxCommandHandler(); |
|
38 virtual void executeCommand(int commandId,int collectionId); |
|
39 |
|
40 protected: // From MGlxMediaListObserver |
|
41 /// See @ref MGlxMediaListObserver::HandleItemAddedL |
|
42 void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList); |
|
43 |
|
44 /// See @ref MGlxMediaListObserver::HandleMediaL |
|
45 void HandleMediaL(TInt aListIndex, MGlxMediaList* aList); |
|
46 |
|
47 /// See @ref MGlxMediaListObserver::HandleItemRemovedL |
|
48 void HandleItemRemovedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList); |
|
49 |
|
50 /// See @ref MGlxMediaListObserver::HandleItemModifiedL |
|
51 void HandleItemModifiedL(const RArray<TInt>& aItemIndexes, MGlxMediaList* aList); |
|
52 |
|
53 /// See @ref MGlxMediaListObserver::HandleAttributesAvailableL |
|
54 void HandleAttributesAvailableL(TInt aItemIndex, |
|
55 const RArray<TMPXAttribute>& aAttributes, MGlxMediaList* aList); |
|
56 |
|
57 /// See @ref MGlxMediaListObserver::HandleFocusChangedL |
|
58 void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, TInt aOldIndex, MGlxMediaList* aList); |
|
59 |
|
60 /// See @ref MGlxMediaListObserver::HandleItemSelectedL |
|
61 void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList); |
|
62 |
|
63 /// See @ref MGlxMediaListObserver::HandleMessageL |
|
64 void HandleMessageL(const CMPXMessage& aMessage, MGlxMediaList* aList); |
|
65 |
|
66 /// See @ref MGlxMediaListObserver::HandleCommandCompleteL |
|
67 void HandleCommandCompleteL(TAny* aSessionId, CMPXCommand* aCommandResult, TInt aError, MGlxMediaList* aList); |
|
68 |
|
69 protected: // From derived class |
|
70 |
|
71 virtual void DoHandleCommandCompleteL(TAny* aSessionId, |
|
72 CMPXCommand* aCommandResult, TInt aError, MGlxMediaList* aList); |
|
73 |
|
74 virtual CMPXCommand* CreateCommandL(TInt aCommandId, MGlxMediaList& aMediaList, TBool& aConsume) const = 0; |
|
75 virtual void DoExecuteCommandL(TInt aCommandId, MGlxMediaList& aMediaList, TBool& aConsume); |
|
76 |
|
77 private: |
|
78 |
|
79 void CreateMediaListL(int aCollectionId, int aHierarchyId, TGlxFilterItemType aFilterType) ; |
|
80 void CreateMediaListAlbumItemL(int aCollectionId, int aHierarchyId, TGlxFilterItemType aFilterType); |
|
81 private: |
|
82 // Instance of Media List |
|
83 MGlxMediaList* iMediaList; |
|
84 |
|
85 }; |
|
86 #endif //GLXMPXCOMMANDHANDLER_H |