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