|
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: Delete command handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __C_GLXCOMMANDHANDLERREMOVEFROM_H__ |
|
22 #define __C_GLXCOMMANDHANDLERREMOVEFROM_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <glxmedia.h> |
|
26 #include <glxmpxcommandcommandhandler.h> |
|
27 #include <mpxmediageneraldefs.h> |
|
28 |
|
29 class MGlxMediaListProvider; |
|
30 |
|
31 /** |
|
32 * @class CGlxCommandHandlerRemoveFrom |
|
33 * |
|
34 * Command handler that removes relationships between media objects. |
|
35 * |
|
36 */ |
|
37 |
|
38 NONSHARABLE_CLASS( CGlxCommandHandlerRemoveFrom ) |
|
39 : public CGlxMpxCommandCommandHandler |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Two-phase constructor |
|
44 * @param aMediaListProvider object that provides the media list |
|
45 * @param aContainerType specifies the container type. (Used to determine |
|
46 * the correct confirmation note.) Only confirmation notes for EMPXAlbum |
|
47 * and EMPXTag are supported. A confirmation note will not be displayed for |
|
48 * unsupported types. |
|
49 */ |
|
50 IMPORT_C static CGlxCommandHandlerRemoveFrom* NewL( |
|
51 MGlxMediaListProvider* aMediaListProvider, |
|
52 TMPXGeneralCategory aContainerType, TInt aCommandId = NULL); |
|
53 |
|
54 /** |
|
55 * Create remove (from) Favourites command handler |
|
56 * @param aMediaListProvider object that provides the media list. |
|
57 */ |
|
58 IMPORT_C static CGlxCommandHandlerRemoveFrom* NewRemFromFavCommandHandlerL( |
|
59 MGlxMediaListProvider* aMediaListProvider); |
|
60 |
|
61 |
|
62 /** Destructor */ |
|
63 IMPORT_C ~CGlxCommandHandlerRemoveFrom(); |
|
64 |
|
65 /** |
|
66 * Set the container from which the items will be removed. |
|
67 * If this is not set, the items will be removed from their container (their |
|
68 * parent) on the path owned by the media list passed as a parameter to |
|
69 * CreateCommandL(). |
|
70 * @param aContainerId. The container from which the items will be removed. |
|
71 */ |
|
72 IMPORT_C void SetContainerId(TGlxMediaId aContainerId); |
|
73 |
|
74 protected: // From CGlxMpxCommandCommandHandler |
|
75 /** See @ref CGlxMpxCommandCommandHandler::CreateCommandL */ |
|
76 virtual CMPXCommand* CreateCommandL(TInt aCommandId, MGlxMediaList& aList, |
|
77 TBool& aConsume) const; |
|
78 |
|
79 /** See CGlxMpxCommandCommandHandler::ConfirmationTextL */ |
|
80 virtual HBufC* ConfirmationTextL(TInt aCommandId, TBool aMultiSelection) const; |
|
81 |
|
82 virtual HBufC* CompletionTextL() const; |
|
83 |
|
84 protected: // from CGlxCommandHandler |
|
85 /** See @ref CGlxCommandHandler::DoActivateL */ |
|
86 void DoActivateL(TInt /*aViewId*/); |
|
87 |
|
88 private: |
|
89 /** Second phase constructor */ |
|
90 void ConstructL(TInt aCommandId); |
|
91 |
|
92 /** Constructor */ |
|
93 CGlxCommandHandlerRemoveFrom(MGlxMediaListProvider* aMediaListProvider, TMPXGeneralCategory aContainerType); |
|
94 |
|
95 private: |
|
96 /// Resource file offset |
|
97 TInt iResourceOffset; |
|
98 TGlxMediaId iRemoveFromContainerId; |
|
99 TMPXGeneralCategory iContainerType; |
|
100 TInt iCommandId; |
|
101 }; |
|
102 |
|
103 #endif // __C_GLXCOMMANDHANDLERREMOVEFROM_H__ |