|
1 /* |
|
2 * Copyright (c) 2007 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: Definition of menu handler interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MCSMENUHANDLER_H__ |
|
20 #define __MCSMENUHANDLER_H__ |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class RMenu; |
|
25 class CMenuOperation; |
|
26 class CMenuItem; |
|
27 |
|
28 /** |
|
29 * Menu handler interface. |
|
30 * Menu handlers execute menu commands. |
|
31 * @lib mcsmenu.lib |
|
32 * @since S60 v5.0 |
|
33 */ |
|
34 class CMenuHandler: public CBase |
|
35 { |
|
36 |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Destructor. |
|
41 * @since S60 v5.0 |
|
42 * @capability None. |
|
43 * @throws None. |
|
44 * @panic None. |
|
45 */ |
|
46 IMPORT_C virtual ~CMenuHandler(); |
|
47 |
|
48 /** |
|
49 * Query support for item type. |
|
50 * @since S60 v5.0 |
|
51 * @param aType Type. |
|
52 * @return ETrue if handler supports this type, EFalse otherwise. |
|
53 * @capability None. |
|
54 * @throws None. |
|
55 * @panic None. |
|
56 */ |
|
57 IMPORT_C virtual TBool SupportsType( const TDesC& aType ); |
|
58 |
|
59 /** |
|
60 * Handle command. |
|
61 * @since S60 v5.0 |
|
62 * @param aItem Item of supported type. |
|
63 * @param aCommand Command. |
|
64 * @param aParams. Command parameters. |
|
65 * @param aStatus Observer request status. When the operation completes, |
|
66 * this status will be completed with the resulting error code. |
|
67 * @return Asynchronous operation. Owned by the caller. |
|
68 * @capability None. |
|
69 * @throws This implementation throws KErrNotSupported. |
|
70 * @panic None. |
|
71 */ |
|
72 IMPORT_C virtual CMenuOperation* HandleCommandL( |
|
73 CMenuItem& aItem, |
|
74 const TDesC8& aCommand, |
|
75 const TDesC8& aParams, |
|
76 TRequestStatus& aStatus ); |
|
77 |
|
78 protected: |
|
79 |
|
80 /** |
|
81 * Constructor. |
|
82 * @since S60 v5.0 |
|
83 * @param aMenu Menu. |
|
84 */ |
|
85 IMPORT_C CMenuHandler( RMenu &aMenu ); |
|
86 |
|
87 /** |
|
88 * Second phase constructor. |
|
89 * @since S60 v5.0 |
|
90 */ |
|
91 IMPORT_C void BaseConstructL(); |
|
92 |
|
93 protected: // data |
|
94 |
|
95 RMenu& iMenu; ///< Menu. |
|
96 |
|
97 private: // data |
|
98 |
|
99 class TData; |
|
100 TData* iData; ///< Private data. Own. |
|
101 |
|
102 }; |
|
103 |
|
104 #endif // __MCSMENUHANDLER_H__ |