|
1 /* |
|
2 * Copyright (c) 2008 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: Declaration of class CFscContactActionMenu. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_FSCCONTACTACTIONMENU_H |
|
20 #define C_FSCCONTACTACTIONMENU_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include "fsccontactactionmenudefines.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CFscContactActionService; |
|
28 class MFscContactActionMenuModel; |
|
29 class CFscContactActionMenuItem; |
|
30 |
|
31 /** |
|
32 * Contact Action Menu API. |
|
33 * Defines an ECom interface for the Contact Action Menu. |
|
34 * |
|
35 * @since S60 3.1 |
|
36 */ |
|
37 class CFscContactActionMenu : public CBase |
|
38 { |
|
39 |
|
40 public: // Public constructor and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * |
|
45 * @param aService Reference to Contact Action Service. |
|
46 * @param aMode Menu mode |
|
47 * In EFscContactActionMenuModeNormal mode Action Menu works |
|
48 * like a normal modal dialog. In EFscContactActionMenuModeAI mode |
|
49 * number key events close the menu without consuming the events. |
|
50 * AI Mode is intended to be used in Active Idle when it must be |
|
51 * possible to start an emergency call while Action Menu is open |
|
52 * @return New isntance of the component |
|
53 */ |
|
54 static CFscContactActionMenu* NewL( |
|
55 CFscContactActionService& aService, |
|
56 TFscContactActionMenuMode aMode = EFscContactActionMenuModeNormal |
|
57 ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CFscContactActionMenu(); |
|
63 |
|
64 public: // Public methods |
|
65 |
|
66 /** |
|
67 * Execute Action Menu |
|
68 * ExecuteL opens Action Menu with current item set. Method is |
|
69 * synchronous and it will return when Action Menu is closed. |
|
70 * |
|
71 * @param aPosition Vertical position where menu is to be openned |
|
72 * @param aIndex Index of focused/highlighted item when menu is opened |
|
73 * @return Execution result |
|
74 */ |
|
75 virtual TFscActionMenuResult ExecuteL( |
|
76 TFscContactActionMenuPosition aPosition = EFscCenter, TInt aIndex = 0, MFsActionMenuPositionGiver* aPositionGiver = 0) = 0; |
|
77 |
|
78 /** |
|
79 * Dismiss menu |
|
80 * Menu gets closed if it was visible when the method was called. |
|
81 * Otherwise method call does not do anything |
|
82 * |
|
83 * @param aSlide If ETrue menu slides away from the screen. |
|
84 * Otherwise it disappears instantly |
|
85 */ |
|
86 virtual void Dismiss( TBool aSlide ) = 0; |
|
87 |
|
88 /** |
|
89 * Return a reference to Action Menu's model |
|
90 * |
|
91 * @return Reference to menu model |
|
92 */ |
|
93 virtual MFscContactActionMenuModel& Model() = 0; |
|
94 |
|
95 /** |
|
96 * Return index of highlighted item |
|
97 * |
|
98 * @return index of highlighted item |
|
99 */ |
|
100 virtual TInt FocusedItemIndex() = 0; |
|
101 |
|
102 /** |
|
103 * Return selected menu item object. |
|
104 * |
|
105 * @return selected menu item object. |
|
106 */ |
|
107 virtual CFscContactActionMenuItem& FocusedItem() = 0; |
|
108 |
|
109 private: // data |
|
110 |
|
111 /** iDtor_ID_Key Instance identifier key. When instance of an |
|
112 * implementation is created by ECOM framework, the |
|
113 * framework will assign UID for it. The UID is used in |
|
114 * destructor to notify framework that this instance is |
|
115 * being destroyed and resources can be released. |
|
116 */ |
|
117 TUid iDtor_ID_Key; |
|
118 |
|
119 }; |
|
120 |
|
121 #include "cfsccontactactionmenu.inl" |
|
122 |
|
123 #endif // C_FSCCONTACTACTIONMENU_H |