|
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_GLXCOMMANDHANDLERDELETE_H__ |
|
22 #define __C_GLXCOMMANDHANDLERDELETE_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <glxmpxcommandcommandhandler.h> |
|
26 |
|
27 class MGlxMediaListProvider; |
|
28 class CGlxUiUtility; |
|
29 |
|
30 /** |
|
31 * @class CGlxCommandHandlerDelete |
|
32 * |
|
33 * Command handler that deletes selected items from a media list. |
|
34 * @author Aki Vanhatalo, Alex Birkett |
|
35 * |
|
36 */ |
|
37 |
|
38 NONSHARABLE_CLASS( CGlxCommandHandlerDelete) |
|
39 : public CGlxMpxCommandCommandHandler |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Two-phase constructor |
|
44 * @param aMediaListProvider object that provides the media list |
|
45 * @param aIsContainerList If ETrue, shows "delete container" |
|
46 * confirmation notes and does not allow |
|
47 * deleting system items |
|
48 * If EFalse, shows "delete item" |
|
49 * confirmation notes and does not check |
|
50 * for system items |
|
51 */ |
|
52 IMPORT_C static CGlxCommandHandlerDelete* NewL( |
|
53 MGlxMediaListProvider* aMediaListProvider, TBool aIsContainerList, TBool aHasToolbarItem); |
|
54 |
|
55 /** Destructor */ |
|
56 IMPORT_C ~CGlxCommandHandlerDelete(); |
|
57 |
|
58 public: // From CGlxMpxCommandCommandHandler |
|
59 /** See @ref CGlxMpxCommandCommandHandler::CreateCommandL */ |
|
60 virtual CMPXCommand* CreateCommandL(TInt aCommandId, MGlxMediaList& aList, |
|
61 TBool& aConsume) const; |
|
62 |
|
63 /** See CGlxMpxCommandCommandHandler::ProgressTextL */ |
|
64 virtual HBufC* ProgressTextL(TInt aCommandId) const; |
|
65 |
|
66 /** See CGlxMpxCommandCommandHandler::ConfirmationTextL */ |
|
67 virtual HBufC* ConfirmationTextL(TInt aCommandId, TBool aMultiSelection) const; |
|
68 |
|
69 public: // From CGlxCommandHandler |
|
70 /** See @ref CGlxCommandHandler::DoActivateL */ |
|
71 void DoActivateL(TInt aViewId); |
|
72 |
|
73 /** See @ref CGlxCommandHandler::OfferKeyEventL */ |
|
74 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
75 |
|
76 protected: |
|
77 /** See @ref CGlxCommandHandler::PopulateToolbar*/ |
|
78 void PopulateToolbarL(); |
|
79 |
|
80 private: |
|
81 /** Second phase constructor */ |
|
82 void ConstructL(TBool aIsContainerList); |
|
83 |
|
84 /** Constructor */ |
|
85 CGlxCommandHandlerDelete(MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem); |
|
86 |
|
87 /*single clk chngs-to update delete option*/ |
|
88 TBool DoIsDisabled(TInt aCommandId, MGlxMediaList& aList) const; |
|
89 private: |
|
90 /// Resource file offset |
|
91 TInt iResourceOffset; |
|
92 // Does the list contain containers or items |
|
93 |
|
94 TInt iIsContainerList; |
|
95 |
|
96 CGlxUiUtility* iUiUtility; |
|
97 }; |
|
98 |
|
99 #endif // __C_GLXCOMMANDHANDLERDELETE_H__ |