9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Delete command handler |
14 * Description: Save command handler |
15 * |
15 * |
16 */ |
16 */ |
17 |
|
18 |
|
19 |
|
20 |
17 |
21 #ifndef __C_GLXCOMMANDHANDLERSAVE_H__ |
18 #ifndef __C_GLXCOMMANDHANDLERSAVE_H__ |
22 #define __C_GLXCOMMANDHANDLERSAVE_H__ |
19 #define __C_GLXCOMMANDHANDLERSAVE_H__ |
23 |
20 |
24 #include <e32base.h> |
21 #include <e32base.h> |
25 #include <glxmpxcommandcommandhandler.h> |
22 #include <glxcommandhandler.h> |
26 #include <glximageviewermanager.h> |
23 #include <glximageviewermanager.h> |
27 |
|
28 class MGlxMediaListProvider; |
|
29 class CGlxUiUtility; |
|
30 |
24 |
31 /** |
25 /** |
32 * @class CGlxCommandHandlerSave |
26 * @class CGlxCommandHandlerSave |
33 * |
27 * |
34 * Command handler that deletes selected items from a media list. |
28 * Command handler that saves the current item to the file system. |
35 * |
29 * |
36 */ |
30 */ |
37 |
31 |
38 NONSHARABLE_CLASS( CGlxCommandHandlerSave) |
32 NONSHARABLE_CLASS( CGlxCommandHandlerSave) |
39 : public CGlxMpxCommandCommandHandler |
33 : public CGlxCommandHandler |
40 { |
34 { |
41 public: |
35 public: |
42 /** |
36 /** |
43 * Two-phase constructor |
37 * Two-phase constructor |
44 * @param aMediaListProvider object that provides the media list |
|
45 * @param aHasToolbarItem Whether Command Should be toolbar item (ETrue - if toolbar item) |
|
46 * @return pointer to CGlxCommandHandlerSave object |
38 * @return pointer to CGlxCommandHandlerSave object |
47 */ |
39 */ |
48 IMPORT_C static CGlxCommandHandlerSave* NewL( |
40 IMPORT_C static CGlxCommandHandlerSave* NewL(); |
49 MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem); |
41 |
50 |
|
51 /** Destructor */ |
42 /** Destructor */ |
52 IMPORT_C ~CGlxCommandHandlerSave(); |
43 IMPORT_C ~CGlxCommandHandlerSave(); |
53 |
44 |
54 public: // From CGlxMpxCommandCommandHandler |
45 public: // From MGlxCommandHandler |
55 /** See @ref CGlxMpxCommandCommandHandler::CreateCommandL */ |
46 /** |
56 virtual CMPXCommand* CreateCommandL(TInt aCommandId, MGlxMediaList& aList, |
47 * Execute the command, if applicable |
57 TBool& aConsume) const; |
48 * @param aCommand The command to handle |
|
49 * @return ETrue if command was handled |
|
50 */ |
|
51 TBool ExecuteL( TInt aCommandId); |
58 |
52 |
59 public: // From CGlxCommandHandler |
53 /** |
60 /** See @ref CGlxCommandHandler::DoActivateL */ |
54 * Modify a menu before it is displayed. |
61 void DoActivateL(TInt aViewId); |
55 * @param aResourceId The resource ID of the menu |
62 virtual void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); |
56 * @param aMenuPane The in-memory representation of the menu pane |
63 /** See @ref CGlxCommandHandler::OfferKeyEventL */ |
57 */ |
64 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
58 void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); |
|
59 |
|
60 /** |
|
61 * Called when the owning view is activated |
|
62 * @param aViewId The ID of the view |
|
63 */ |
|
64 void DoActivateL(TInt aViewId); |
65 |
65 |
66 protected: |
66 /** |
67 /** See @ref CGlxCommandHandler::PopulateToolbar*/ |
67 * Called when the owning view is deactivated |
68 void PopulateToolbarL(); |
68 */ |
|
69 void Deactivate(); |
|
70 |
|
71 /** |
|
72 * Offers key events to the command handler |
|
73 * @param aKeyEvent The key event. |
|
74 * @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown |
|
75 * @return Indicates whether or not the key event was used by this control. EKeyWasNotConsumed or EKeyWasConsumed |
|
76 */ |
|
77 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
78 |
|
79 /** |
|
80 * Perform any actions needed before the options menu is displayed. |
|
81 * The view calling this must first arrange a wait dialog to be displayed, as this operation may take |
|
82 * a long time to complete |
|
83 */ |
|
84 void PreDynInitMenuPaneL( TInt aResourceId ); |
|
85 |
|
86 /** |
|
87 * See @ref MGlxCommandHandler::GetRequiredAttributesL |
|
88 * No implementation required |
|
89 */ |
|
90 void GetRequiredAttributesL(RArray< TMPXAttribute >& /*aAttributes*/, |
|
91 TBool /*aFilterUsingSelection*/, |
|
92 TBool /*aFilterUsingCommandId*/, |
|
93 TInt /*aCommandId*/) const {} |
69 |
94 |
70 private: |
95 private: |
71 /** Second phase constructor */ |
96 /** Second phase constructor */ |
72 void ConstructL(); |
97 void ConstructL(); |
73 |
98 |
74 /** Constructor */ |
99 /** Constructor */ |
75 CGlxCommandHandlerSave(MGlxMediaListProvider* aMediaListProvider, TBool aHasToolbarItem); |
100 CGlxCommandHandlerSave(); |
76 |
101 |
77 |
102 private: |
78 private: |
|
79 /// Resource file offset |
|
80 TInt iResourceOffset; |
|
81 |
|
82 |
|
83 CGlxUiUtility* iUiUtility; |
|
84 // Not own |
103 // Not own |
85 CGlxImageViewerManager* iImageViewerInstance; |
104 CGlxImageViewerManager* iImageViewerInstance; |
86 }; |
105 }; |
87 |
|
88 |
106 |
89 #endif // __C_GLXCOMMANDHANDLERSAVE_H__ |
107 #endif // __C_GLXCOMMANDHANDLERSAVE_H__ |