1 /* |
|
2 * Copyright (c) 2003-2005 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 the License "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: Declares service API for providers offering menu services for |
|
15 * consumers. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 #ifndef LIW_SERVICE_IF_MENU_H |
|
25 #define LIW_SERVICE_IF_MENU_H |
|
26 |
|
27 // INCLUDES |
|
28 #include <liwserviceifbase.h> |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // DATA TYPES |
|
35 |
|
36 // FUNCTION PROTOTYPES |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class CLiwMenuPane; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * This is the menu service interface to access providers that offer menu services. |
|
45 * |
|
46 * Menu service providers should inherit this class. Providers offering |
|
47 * only base services should inherit CLiwServiceIfBase instead. |
|
48 * |
|
49 * @lib ServiceHandler.lib |
|
50 * @since Series 60 2.6 |
|
51 * @see CLiwServiceIfBase |
|
52 **/ |
|
53 class CLiwServiceIfMenu: public CLiwServiceIfBase |
|
54 { |
|
55 public: |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 IMPORT_C virtual ~CLiwServiceIfMenu(); |
|
60 |
|
61 /** |
|
62 * Provider should implement this method to initialise a menu pane by adding |
|
63 * provider specific menu items. The LIW framework gives the parameters to be |
|
64 * used in the addition process. |
|
65 * |
|
66 * @param aMenuPane Menu pane handle. |
|
67 * @param aIndex The position of the item where to add menu items. |
|
68 * @param aCascadeId ID of cascade menu item. |
|
69 * @param aInParamList Input parameter list for provider's parameter checking. |
|
70 */ |
|
71 virtual void InitializeMenuPaneL( |
|
72 CLiwMenuPane& aMenuPane, |
|
73 TInt aIndex, |
|
74 TInt aCascadeId, |
|
75 const CLiwGenericParamList& aInParamList) = 0; |
|
76 |
|
77 /** |
|
78 * Provider should implement this method to handle a menu command. Called by the |
|
79 * Service Handler when a consumer calls ExecuteMenuCmdL(). |
|
80 * |
|
81 * @param aMenuCmdId Original provider specific ommand ID for the menu command. |
|
82 * Defined in the provider's menu item resource. |
|
83 * @param aInParamList Input parameters, can be an empty list. |
|
84 * @param aOutParamList Output parameters, can be an empty list. |
|
85 * @param aCmdOptions Options for the command, see KLiwCmdOpt* in LiwCommon.hrh. |
|
86 * @param aCallback Callback if asynchronous command handling is wanted by consumer. |
|
87 * The provider may or may not support this. A provider should |
|
88 * leave with KErrNotSupported, if not. |
|
89 * @leave KErrNotSupported Callback is not supported. |
|
90 */ |
|
91 virtual void HandleMenuCmdL( |
|
92 TInt aMenuCmdId, |
|
93 const CLiwGenericParamList& aInParamList, |
|
94 CLiwGenericParamList& aOutParamList, |
|
95 TUint aCmdOptions = 0, |
|
96 const MLiwNotifyCallback* aCallback = NULL) = 0; |
|
97 |
|
98 /** |
|
99 * Returns current LIW menu pane for this menu service provider. |
|
100 * |
|
101 * @return Pointer to the current LIW menu pane object. |
|
102 */ |
|
103 IMPORT_C const CLiwMenuPane* MenuPane() const; |
|
104 |
|
105 protected: |
|
106 IMPORT_C virtual void* ExtensionInterface(TUid aInterface); |
|
107 |
|
108 private: |
|
109 // Rest of the class is for LIW's internal use and doesn't consern |
|
110 // service providers. |
|
111 friend class CLiwServiceHandlerImpl; |
|
112 |
|
113 void InitializeMenuPaneHookL( |
|
114 CLiwMenuPane* aMenuPane, |
|
115 TInt aIndex, |
|
116 TInt aCascadeId, |
|
117 const CLiwGenericParamList& aInParamList); |
|
118 |
|
119 void HandleMenuCmdHookL( |
|
120 CLiwMenuPane* aMenuPane, |
|
121 TInt aMenuCmdId, |
|
122 const CLiwGenericParamList& aInParamList, |
|
123 CLiwGenericParamList& aOutParamList, |
|
124 TUint aCmdOptions = 0, |
|
125 const MLiwNotifyCallback* aCallback = NULL); |
|
126 |
|
127 private: |
|
128 CLiwMenuPane* iMenuPane; // Not owned. |
|
129 |
|
130 // Reserved member |
|
131 TAny* iSpare; |
|
132 }; |
|
133 |
|
134 |
|
135 #endif // LIW_SERVICE_IF_MENU_H |
|
136 |
|
137 // End of file |
|