|
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 asynchronous menu operation base class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MCSMENUOPERATION_H__ |
|
20 #define __MCSMENUOPERATION_H__ |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class RMenu; |
|
25 |
|
26 /** |
|
27 * Asynchronous menu operation base class. |
|
28 * Defines ownership and cancellation of asynchronous menu operations; |
|
29 * does not define the operation itself. |
|
30 * Concrete derived classes must provide: |
|
31 * - A request function which sets the observer status to KRequesPending; |
|
32 * - DoCancel() which cancels the operation; |
|
33 * - RunL() which should, in addition to any other required functionality, |
|
34 * always end by completing the observer request status. |
|
35 * @lib - |
|
36 * @since S60 v5.0 |
|
37 */ |
|
38 class CMenuOperation : public CActive |
|
39 { |
|
40 |
|
41 protected: |
|
42 |
|
43 /** |
|
44 * Constructor. |
|
45 * @param aMenu Menu. |
|
46 * @param aPriority Active Object priority. |
|
47 * @param aObserverStatus Completes when the operation is finished. |
|
48 * @capability None. |
|
49 * @throws None. |
|
50 * @panic None. |
|
51 */ |
|
52 CMenuOperation( |
|
53 RMenu &aMenu, |
|
54 TInt aPriority, |
|
55 TRequestStatus &aObserverStatus ) |
|
56 : CActive( aPriority ), iMenu( aMenu ), iObserverStatus( aObserverStatus ) {} |
|
57 |
|
58 protected: // data |
|
59 |
|
60 RMenu& iMenu; ///< Menu. |
|
61 TRequestStatus& iObserverStatus; ///< Observer request status. |
|
62 |
|
63 }; |
|
64 |
|
65 #endif // __MCSMENUOPERATION_H__ |