|
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 change notifier |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MCSMENUNOTIFIER_H__ |
|
20 #define __MCSMENUNOTIFIER_H__ |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class RMenu; |
|
25 |
|
26 /** |
|
27 * Menu change notifier. |
|
28 * @lib mcsmenu.lib |
|
29 * @since S60 v5.0 |
|
30 */ |
|
31 NONSHARABLE_CLASS( RMenuNotifier ): public RSubSessionBase |
|
32 { |
|
33 |
|
34 public: |
|
35 |
|
36 enum TEvent ///< Menu events. |
|
37 { |
|
38 EItemsNone = 0,///< Nothing changed. |
|
39 EItemsAddedRemoved = 0x1, ///< Items added and/or removed in folder. |
|
40 EItemsReordered = 0x2, ///< Items reordered in folder. |
|
41 EItemAttributeChanged = 0x4, ///< Item attribute and/or flag changed. |
|
42 }; |
|
43 |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Constructor. |
|
48 * @since S60 v5.0 |
|
49 * @capability None. |
|
50 * @throws None. |
|
51 * @panic None. |
|
52 */ |
|
53 RMenuNotifier(){ iData = NULL; }; |
|
54 |
|
55 /** |
|
56 * Close the notifier. Safe to call if not open. |
|
57 * Outstanding request, if any, is cancelled. |
|
58 * @since S60 v5.0 |
|
59 * @capability ECapabilityReadDeviceData. |
|
60 * @throws None. |
|
61 * @panic None. |
|
62 */ |
|
63 IMPORT_C void Close(); |
|
64 |
|
65 /** |
|
66 * Open the notifier. |
|
67 * @since S60 v5.0 |
|
68 * @param aMenu Menu. |
|
69 * @return Error code. |
|
70 * @capability ECapabilityReadDeviceData. |
|
71 * @throws System-wide error codes if an error occurs. |
|
72 * @panic None. |
|
73 */ |
|
74 IMPORT_C TInt Open( RMenu& aMenu ); |
|
75 |
|
76 /** |
|
77 * Request notification of menu events occurring in specified folder. |
|
78 * @since S60 v5.0 |
|
79 * @param aFolder Folder to observe. Pass 0 to observe all folders |
|
80 * (the whole menu). |
|
81 * @param aEvents Events to be notified about. A combination of TEvent bits. |
|
82 * @param aStatus Completes when menu events occur in the specified folder, |
|
83 * or on error. Completion value is error code (if negative), or a combination |
|
84 * of events specified in aEvents (if positive). Note, more than one event |
|
85 * bit can be set. |
|
86 * @capability ECapabilityReadDeviceData. |
|
87 * @throws None. |
|
88 * @panic None. |
|
89 */ |
|
90 IMPORT_C void Notify( TInt aFolder, TInt aEvents, TRequestStatus &aStatus ); |
|
91 |
|
92 /** |
|
93 * Cancel notification request. |
|
94 * @since S60 v5.0 |
|
95 * @capability ECapabilityReadDeviceData. |
|
96 * @throws None. |
|
97 * @panic None. |
|
98 */ |
|
99 IMPORT_C void Cancel(); |
|
100 |
|
101 private: // data |
|
102 |
|
103 class TData; |
|
104 TData* iData; ///< Private data. Own. |
|
105 |
|
106 }; |
|
107 |
|
108 #endif // __MCSMENUNOTIFIER_H__ |