|
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: Command Handler interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef M_GLXCOMMANDHANDLER_H |
|
22 #define M_GLXCOMMANDHANDLER_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <coedef.h> |
|
26 #include <w32std.h> |
|
27 #include <mpxattribute.h> |
|
28 |
|
29 class CEikMenuPane; |
|
30 |
|
31 |
|
32 /** |
|
33 * MGlxCommandHandler |
|
34 * |
|
35 * Command handler interface |
|
36 */ |
|
37 class MGlxCommandHandler |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Execute the command, if applicable |
|
42 * @param aCommand The command to handle |
|
43 * @return ETrue iff command was handled |
|
44 */ |
|
45 virtual TBool ExecuteL(TInt aCommand) = 0; |
|
46 |
|
47 /** |
|
48 * Modify a menu before it is displayed. |
|
49 * @param aResourceId The resource ID of the menu |
|
50 * @param aMenuPane The in-memory representation of the menu pane |
|
51 */ |
|
52 virtual void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) = 0; |
|
53 |
|
54 /** |
|
55 * Called when the owning view is activated |
|
56 * @param aViewId The ID of the view |
|
57 */ |
|
58 virtual void ActivateL(TInt aViewId) = 0; |
|
59 |
|
60 /** |
|
61 * Called when the owning view is deactivated |
|
62 */ |
|
63 virtual void Deactivate() = 0; |
|
64 |
|
65 /** |
|
66 * Offers key events to the command handler |
|
67 * @param aKeyEvent The key event. |
|
68 * @param aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown |
|
69 * @return Indicates whether or not the key event was used by this control. EKeyWasNotConsumed or EKeyWasConsumed |
|
70 */ |
|
71 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) = 0; |
|
72 |
|
73 /** |
|
74 * Perform any actions needed before the options menu is displayed. |
|
75 * The view calling this must first arrange a wait dialog to be displayed, as this operation may take |
|
76 * a long time to complete |
|
77 * @param aResourceId Menu resource id |
|
78 */ |
|
79 virtual void PreDynInitMenuPaneL( TInt aResourceId ) = 0; |
|
80 |
|
81 /** |
|
82 * Deriving classes should append required attributes to aAttributes |
|
83 * @param aAttributes array to append attributes to. |
|
84 * @param aFilterUsingSelection If ETrue, the deriving class should only append |
|
85 * attributes relevant to the current selection, If EFalse all attributes |
|
86 * should be appended. |
|
87 * @param aFilterUsingCommandId If ETrue, only attributes relevant |
|
88 * to the command id specified by aCommandId will be appended |
|
89 * @param aCommandId if aFilterUsingCommandId is ETrue, only |
|
90 * attributes relevant to aCommandId will be appened. |
|
91 */ |
|
92 virtual void GetRequiredAttributesL(RArray< TMPXAttribute >& aAttributes, |
|
93 TBool aFilterUsingSelection, |
|
94 TBool aFilterUsingCommandId, |
|
95 TInt aCommandId = 0) const = 0; |
|
96 |
|
97 /** |
|
98 * Destructor |
|
99 */ |
|
100 virtual ~MGlxCommandHandler() {}; |
|
101 }; |
|
102 |
|
103 |
|
104 #endif // M_GLXCOMMANDHANDLER_H |